##// END OF EJS Templates
avoid %r markup of unicode strings in user facing messages...
Mads Kiilerich -
r3575:ca7785fa beta
parent child Browse files
Show More
@@ -768,7 +768,7 b' def check_git_version():'
768 if 'git' in BACKENDS:
768 if 'git' in BACKENDS:
769 log.debug('GIT version detected: %s' % stdout)
769 log.debug('GIT version detected: %s' % stdout)
770 if stderr:
770 if stderr:
771 log.warning('Unable to detect git version org error was:%r' % stderr)
771 log.warning('Unable to detect git version, org error was: %r' % stderr)
772 elif to_old_git:
772 elif to_old_git:
773 log.warning('RhodeCode detected git version %s, which is too old '
773 log.warning('RhodeCode detected git version %s, which is too old '
774 'for the system to function properly. Make sure '
774 'for the system to function properly. Make sure '
@@ -153,7 +153,7 b' class GitChangeset(BaseChangeset):'
153 self._stat_modes[name] = stat
153 self._stat_modes[name] = stat
154 if not path in self._paths:
154 if not path in self._paths:
155 raise NodeDoesNotExistError("There is no file nor directory "
155 raise NodeDoesNotExistError("There is no file nor directory "
156 "at the given path %r at revision %r"
156 "at the given path '%s' at revision %s"
157 % (path, self.short_id))
157 % (path, self.short_id))
158 return self._paths[path]
158 return self._paths[path]
159
159
@@ -167,8 +167,8 b' class GitChangeset(BaseChangeset):'
167 def _get_filectx(self, path):
167 def _get_filectx(self, path):
168 path = self._fix_path(path)
168 path = self._fix_path(path)
169 if self._get_kind(path) != NodeKind.FILE:
169 if self._get_kind(path) != NodeKind.FILE:
170 raise ChangesetError("File does not exist for revision %r at "
170 raise ChangesetError("File does not exist for revision %s at "
171 " %r" % (self.raw_id, path))
171 " '%s'" % (self.raw_id, path))
172 return path
172 return path
173
173
174 def _get_file_nodes(self):
174 def _get_file_nodes(self):
@@ -394,8 +394,8 b' class GitChangeset(BaseChangeset):'
394
394
395 def get_nodes(self, path):
395 def get_nodes(self, path):
396 if self._get_kind(path) != NodeKind.DIR:
396 if self._get_kind(path) != NodeKind.DIR:
397 raise ChangesetError("Directory does not exist for revision %r at "
397 raise ChangesetError("Directory does not exist for revision %s at "
398 " %r" % (self.revision, path))
398 " '%s'" % (self.revision, path))
399 path = self._fix_path(path)
399 path = self._fix_path(path)
400 id = self._get_id_for_path(path)
400 id = self._get_id_for_path(path)
401 tree = self.repository._repo[id]
401 tree = self.repository._repo[id]
@@ -458,7 +458,7 b' class GitChangeset(BaseChangeset):'
458 node._blob = obj
458 node._blob = obj
459 else:
459 else:
460 raise NodeDoesNotExistError("There is no file nor directory "
460 raise NodeDoesNotExistError("There is no file nor directory "
461 "at the given path %r at revision %r"
461 "at the given path '%s' at revision %s"
462 % (path, self.short_id))
462 % (path, self.short_id))
463 # cache node
463 # cache node
464 self.nodes[path] = node
464 self.nodes[path] = node
@@ -267,7 +267,7 b' class GitRepository(BaseRepository):'
267 try:
267 try:
268 revision = self.revisions[int(revision)]
268 revision = self.revisions[int(revision)]
269 except:
269 except:
270 raise ChangesetDoesNotExistError("Revision %r does not exist "
270 raise ChangesetDoesNotExistError("Revision %s does not exist "
271 "for this repository" % (revision))
271 "for this repository" % (revision))
272
272
273 elif is_bstr(revision):
273 elif is_bstr(revision):
@@ -282,12 +282,12 b' class GitRepository(BaseRepository):'
282 return _tags_shas[_tags_shas.index(revision)]
282 return _tags_shas[_tags_shas.index(revision)]
283
283
284 elif not pattern.match(revision) or revision not in self.revisions:
284 elif not pattern.match(revision) or revision not in self.revisions:
285 raise ChangesetDoesNotExistError("Revision %r does not exist "
285 raise ChangesetDoesNotExistError("Revision %s does not exist "
286 "for this repository" % (revision))
286 "for this repository" % (revision))
287
287
288 # Ensure we return full id
288 # Ensure we return full id
289 if not pattern.match(str(revision)):
289 if not pattern.match(str(revision)):
290 raise ChangesetDoesNotExistError("Given revision %r not recognized"
290 raise ChangesetDoesNotExistError("Given revision %s not recognized"
291 % revision)
291 % revision)
292 return revision
292 return revision
293
293
@@ -174,14 +174,14 b' class MercurialChangeset(BaseChangeset):'
174 elif path in self._dir_paths:
174 elif path in self._dir_paths:
175 return NodeKind.DIR
175 return NodeKind.DIR
176 else:
176 else:
177 raise ChangesetError("Node does not exist at the given path %r"
177 raise ChangesetError("Node does not exist at the given path '%s'"
178 % (path))
178 % (path))
179
179
180 def _get_filectx(self, path):
180 def _get_filectx(self, path):
181 path = self._fix_path(path)
181 path = self._fix_path(path)
182 if self._get_kind(path) != NodeKind.FILE:
182 if self._get_kind(path) != NodeKind.FILE:
183 raise ChangesetError("File does not exist for revision %r at "
183 raise ChangesetError("File does not exist for revision %s at "
184 " %r" % (self.raw_id, path))
184 " '%s'" % (self.raw_id, path))
185 return self._ctx.filectx(path)
185 return self._ctx.filectx(path)
186
186
187 def _extract_submodules(self):
187 def _extract_submodules(self):
@@ -300,8 +300,8 b' class MercurialChangeset(BaseChangeset):'
300 """
300 """
301
301
302 if self._get_kind(path) != NodeKind.DIR:
302 if self._get_kind(path) != NodeKind.DIR:
303 raise ChangesetError("Directory does not exist for revision %r at "
303 raise ChangesetError("Directory does not exist for revision %s at "
304 " %r" % (self.revision, path))
304 " '%s'" % (self.revision, path))
305 path = self._fix_path(path)
305 path = self._fix_path(path)
306
306
307 filenodes = [FileNode(f, changeset=self) for f in self._file_paths
307 filenodes = [FileNode(f, changeset=self) for f in self._file_paths
@@ -344,7 +344,7 b' class MercurialChangeset(BaseChangeset):'
344 node = DirNode(path, changeset=self)
344 node = DirNode(path, changeset=self)
345 else:
345 else:
346 raise NodeDoesNotExistError("There is no file nor directory "
346 raise NodeDoesNotExistError("There is no file nor directory "
347 "at the given path: %r at revision %r"
347 "at the given path: '%s' at revision %s"
348 % (path, self.short_id))
348 % (path, self.short_id))
349 # cache node
349 # cache node
350 self.nodes[path] = node
350 self.nodes[path] = node
@@ -404,7 +404,7 b' class MercurialRepository(BaseRepository'
404 try:
404 try:
405 revision = hex(self._repo.lookup(revision))
405 revision = hex(self._repo.lookup(revision))
406 except (IndexError, ValueError, RepoLookupError, TypeError):
406 except (IndexError, ValueError, RepoLookupError, TypeError):
407 raise ChangesetDoesNotExistError("Revision %r does not "
407 raise ChangesetDoesNotExistError("Revision %s does not "
408 "exist for this repository"
408 "exist for this repository"
409 % (revision))
409 % (revision))
410 return revision
410 return revision
@@ -291,7 +291,7 b' removed extra unicode conversion in diff'
291 revision=rev,
291 revision=rev,
292 f_path=f_path))
292 f_path=f_path))
293
293
294 msg = """Revision %r does not exist for this repository""" % (rev)
294 msg = """Revision %s does not exist for this repository""" % (rev)
295 self.checkSessionFlash(response, msg)
295 self.checkSessionFlash(response, msg)
296
296
297 self.assertEqual('http://localhost/%s/files/tip/' % HG_REPO, response.headers['location'])
297 self.assertEqual('http://localhost/%s/files/tip/' % HG_REPO, response.headers['location'])
@@ -305,7 +305,7 b' removed extra unicode conversion in diff'
305 revision=rev,
305 revision=rev,
306 f_path=f_path))
306 f_path=f_path))
307
307
308 msg = "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12])
308 msg = "There is no file nor directory at the given path: '%s' at revision %s" % (f_path, rev[:12])
309 self.checkSessionFlash(response, msg)
309 self.checkSessionFlash(response, msg)
310
310
311 #==========================================================================
311 #==========================================================================
@@ -329,7 +329,7 b' removed extra unicode conversion in diff'
329 repo_name=HG_REPO,
329 repo_name=HG_REPO,
330 revision=rev,
330 revision=rev,
331 f_path=f_path))
331 f_path=f_path))
332 msg = """Revision %r does not exist for this repository""" % (rev)
332 msg = """Revision %s does not exist for this repository""" % (rev)
333 self.checkSessionFlash(response, msg)
333 self.checkSessionFlash(response, msg)
334
334
335 self.assertEqual('http://localhost/%s/files/tip/' % HG_REPO, response.headers['location'])
335 self.assertEqual('http://localhost/%s/files/tip/' % HG_REPO, response.headers['location'])
@@ -342,7 +342,7 b' removed extra unicode conversion in diff'
342 repo_name=HG_REPO,
342 repo_name=HG_REPO,
343 revision=rev,
343 revision=rev,
344 f_path=f_path))
344 f_path=f_path))
345 msg = "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12])
345 msg = "There is no file nor directory at the given path: '%s' at revision %s" % (f_path, rev[:12])
346 self.checkSessionFlash(response, msg)
346 self.checkSessionFlash(response, msg)
347
347
348 def test_ajaxed_files_list(self):
348 def test_ajaxed_files_list(self):
General Comments 0
You need to be logged in to leave comments. Login now