Changeset - b0c75d6f8f32
[Not reviewed]
default
0 5 0
Mads Kiilerich - 6 years ago 2019-11-23 22:17:54
mads@kiilerich.com
Grafted from: bd5412f3641d
py3: use explicit octal literals

From 2to3 numliterals.
5 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -243,15 +243,15 @@ class MercurialChangeset(BaseChangeset):
 
    def get_file_mode(self, path):
 
        """
 
        Returns stat mode of the file at the given ``path``.
 
        """
 
        fctx = self._get_filectx(path)
 
        if 'x' in fctx.flags():
 
            return 0100755
 
            return 0o100755
 
        else:
 
            return 0100644
 
            return 0o100644
 

	
 
    def get_file_content(self, path):
 
        """
 
        Returns content of the file at given ``path``.
 
        """
 
        fctx = self._get_filectx(path)
kallithea/lib/vcs/nodes.py
Show inline comments
 
@@ -252,13 +252,13 @@ class FileNode(Node):
 

	
 
        if content and changeset:
 
            raise NodeError("Cannot use both content and changeset")
 
        super(FileNode, self).__init__(path, kind=NodeKind.FILE)
 
        self.changeset = changeset
 
        self._content = content
 
        self._mode = mode or 0100644
 
        self._mode = mode or 0o100644
 

	
 
    @LazyProperty
 
    def mode(self):
 
        """
 
        Returns lazily mode of the FileNode. If ``changeset`` is not set, would
 
        use value given at initialization or 0100644 (default).
kallithea/model/scm.py
Show inline comments
 
@@ -747,13 +747,13 @@ class ScmModel(object):
 
            if has_hook or force_create:
 
                log.debug('writing %s hook file !', h_type)
 
                try:
 
                    with open(_hook_file, 'wb') as f:
 
                        tmpl = tmpl.replace('_TMPL_', kallithea.__version__)
 
                        f.write(tmpl)
 
                    os.chmod(_hook_file, 0755)
 
                    os.chmod(_hook_file, 0o755)
 
                except IOError as e:
 
                    log.error('error writing %s: %s', _hook_file, e)
 
            else:
 
                log.debug('skipping writing hook file')
 

	
 

	
kallithea/tests/vcs/test_git.py
Show inline comments
 
@@ -654,13 +654,13 @@ class TestGitSpecificWithRepo(_BackendTe
 
                'message': 'Initial',
 
                'author': 'Joe Doe <joe.doe@example.com>',
 
                'date': datetime.datetime(2010, 1, 1, 20),
 
                'added': [
 
                    FileNode('foobar/static/js/admin/base.js', content='base'),
 
                    FileNode('foobar/static/admin', content='admin',
 
                        mode=0120000), # this is a link
 
                        mode=0o120000), # this is a link
 
                    FileNode('foo', content='foo'),
 
                ],
 
            },
 
            {
 
                'message': 'Second',
 
                'author': 'Joe Doe <joe.doe@example.com>',
kallithea/tests/vcs/test_nodes.py
Show inline comments
 
@@ -141,19 +141,19 @@ class TestNodeBasic(object):
 
        assert not mode & stat.S_IWOTH
 
        assert not mode & stat.S_IXUSR
 
        assert not mode & stat.S_IXGRP
 
        assert not mode & stat.S_IXOTH
 

	
 
    def test_file_node_is_executable(self):
 
        node = FileNode('foobar', 'empty... almost', mode=0100755)
 
        node = FileNode('foobar', 'empty... almost', mode=0o100755)
 
        assert node.is_executable
 

	
 
        node = FileNode('foobar', 'empty... almost', mode=0100500)
 
        node = FileNode('foobar', 'empty... almost', mode=0o100500)
 
        assert node.is_executable
 

	
 
        node = FileNode('foobar', 'empty... almost', mode=0100644)
 
        node = FileNode('foobar', 'empty... almost', mode=0o100644)
 
        assert not node.is_executable
 

	
 
    def test_mimetype(self):
 
        py_node = FileNode('test.py')
 
        tar_node = FileNode('test.tar.gz')
 

	
0 comments (0 inline, 0 general)