##// END OF EJS Templates
code: fixed deprecated octal calls for py3 compat.
marcink -
r3268:6e0a80a7 default
parent child Browse files
Show More
@@ -63,7 +63,7 b' def maybe_create_history_store(event):'
63 settings = event.app.registry.settings
63 settings = event.app.registry.settings
64 history_dir = settings.get('channelstream.history.location', '')
64 history_dir = settings.get('channelstream.history.location', '')
65 if history_dir and not os.path.exists(history_dir):
65 if history_dir and not os.path.exists(history_dir):
66 os.makedirs(history_dir, 0750)
66 os.makedirs(history_dir, 0o750)
67
67
68
68
69 def includeme(config):
69 def includeme(config):
@@ -476,7 +476,7 b' def _sanitize_cache_settings(settings):'
476
476
477 # ensure we have our dir created
477 # ensure we have our dir created
478 if not os.path.isdir(default_cache_dir):
478 if not os.path.isdir(default_cache_dir):
479 os.makedirs(default_cache_dir, mode=0755)
479 os.makedirs(default_cache_dir, mode=0o755)
480
480
481 # exception store cache
481 # exception store cache
482 _string_setting(
482 _string_setting(
@@ -50,8 +50,8 b' from rhodecode.lib.vcs.exceptions import'
50 log = logging.getLogger(__name__)
50 log = logging.getLogger(__name__)
51
51
52
52
53 FILEMODE_DEFAULT = 0100644
53 FILEMODE_DEFAULT = 0o100644
54 FILEMODE_EXECUTABLE = 0100755
54 FILEMODE_EXECUTABLE = 0o100755
55
55
56 Reference = collections.namedtuple('Reference', ('type', 'name', 'commit_id'))
56 Reference = collections.namedtuple('Reference', ('type', 'name', 'commit_id'))
57 MergeResponse = collections.namedtuple(
57 MergeResponse = collections.namedtuple(
@@ -209,7 +209,7 b' class BaseRepository(object):'
209 def get_create_shadow_cache_pr_path(self, db_repo):
209 def get_create_shadow_cache_pr_path(self, db_repo):
210 path = db_repo.cached_diffs_dir
210 path = db_repo.cached_diffs_dir
211 if not os.path.exists(path):
211 if not os.path.exists(path):
212 os.makedirs(path, 0755)
212 os.makedirs(path, 0o755)
213 return path
213 return path
214
214
215 @classmethod
215 @classmethod
@@ -1046,7 +1046,7 b' class BaseCommit(object):'
1046 ('tags', ','.join(self.tags)),
1046 ('tags', ','.join(self.tags)),
1047 ]
1047 ]
1048 meta = ["%s:%s" % (f_name, value) for f_name, value in metadata]
1048 meta = ["%s:%s" % (f_name, value) for f_name, value in metadata]
1049 file_info.append(('.archival.txt', 0644, False, '\n'.join(meta)))
1049 file_info.append(('.archival.txt', 0o644, False, '\n'.join(meta)))
1050
1050
1051 connection.Hg.archive_repo(file_path, mtime, file_info, kind)
1051 connection.Hg.archive_repo(file_path, mtime, file_info, kind)
1052
1052
@@ -161,7 +161,7 b' class GitRepository(BaseRepository):'
161 GitRepository.check_url(src_url, self.config)
161 GitRepository.check_url(src_url, self.config)
162
162
163 if create:
163 if create:
164 os.makedirs(self.path, mode=0755)
164 os.makedirs(self.path, mode=0o755)
165
165
166 if bare:
166 if bare:
167 self._remote.init_bare()
167 self._remote.init_bare()
@@ -355,7 +355,7 b' class MercurialRepository(BaseRepository'
355 create = False
355 create = False
356
356
357 if create:
357 if create:
358 os.makedirs(self.path, mode=0755)
358 os.makedirs(self.path, mode=0o755)
359
359
360 self._remote.localrepository(create)
360 self._remote.localrepository(create)
361
361
@@ -181,7 +181,7 b' class RepoGroupModel(BaseModel):'
181 self.check_exist_filesystem(group_name)
181 self.check_exist_filesystem(group_name)
182 create_path = os.path.join(self.repos_path, group_name)
182 create_path = os.path.join(self.repos_path, group_name)
183 log.debug('creating new group in %s', create_path)
183 log.debug('creating new group in %s', create_path)
184 os.makedirs(create_path, mode=0755)
184 os.makedirs(create_path, mode=0o755)
185 log.debug('created group in %s', create_path)
185 log.debug('created group in %s', create_path)
186
186
187 def _rename_group(self, old, new):
187 def _rename_group(self, old, new):
@@ -538,7 +538,7 b' TODO: To be written...'
538 'sys.exit(1)',
538 'sys.exit(1)',
539 ]
539 ]
540 f.write('\n'.join(script_lines))
540 f.write('\n'.join(script_lines))
541 os.chmod(hook_path, 0755)
541 os.chmod(hook_path, 0o755)
542
542
543 def test_local_push_does_not_execute_hook(self):
543 def test_local_push_does_not_execute_hook(self):
544 target_repo = self.get_empty_repo()
544 target_repo = self.get_empty_repo()
@@ -1061,7 +1061,7 b' class TestGitSpecificWithRepo(BackendTes'
1061 FileNode('foobar/static/js/admin/base.js', content='base'),
1061 FileNode('foobar/static/js/admin/base.js', content='base'),
1062 FileNode(
1062 FileNode(
1063 'foobar/static/admin', content='admin',
1063 'foobar/static/admin', content='admin',
1064 mode=0120000), # this is a link
1064 mode=0o120000), # this is a link
1065 FileNode('foo', content='foo'),
1065 FileNode('foo', content='foo'),
1066 ],
1066 ],
1067 },
1067 },
@@ -190,13 +190,13 b' class TestNodeBasics:'
190 assert not mode & stat.S_IXOTH
190 assert not mode & stat.S_IXOTH
191
191
192 def test_file_node_is_executable(self):
192 def test_file_node_is_executable(self):
193 node = FileNode('foobar', 'empty... almost', mode=0100755)
193 node = FileNode('foobar', 'empty... almost', mode=0o100755)
194 assert node.is_executable
194 assert node.is_executable
195
195
196 node = FileNode('foobar', 'empty... almost', mode=0100500)
196 node = FileNode('foobar', 'empty... almost', mode=0o100500)
197 assert node.is_executable
197 assert node.is_executable
198
198
199 node = FileNode('foobar', 'empty... almost', mode=0100644)
199 node = FileNode('foobar', 'empty... almost', mode=0o100644)
200 assert not node.is_executable
200 assert not node.is_executable
201
201
202 def test_file_node_is_not_symlink(self):
202 def test_file_node_is_not_symlink(self):
General Comments 0
You need to be logged in to leave comments. Login now