Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

stable filedialogs, repoview: make sure no unicode passed to repo.changectx

Because cset: hyperlink is unicode, calling repo[param] happens to pass
unicode to Mercurial. This patch uses hglib.fromunicode() instead of str(),
just in case of goto(tagname), where tagname can contain non-ascii chars.

Changeset ca850860de21

Parent dd09a860d097

by Yuya Nishihara

Changes to 2 files · Browse files at ca850860de21 Showing diff from parent dd09a860d097 Diff from another changeset...

 
288
289
290
291
 
292
293
294
 
288
289
290
 
291
292
293
294
@@ -288,7 +288,7 @@
  if ':' in link:   scheme, param = link.split(':', 1)   if scheme == 'cset': - rev = self.repo[param].rev() + rev = self.repo[hglib.fromunicode(param)].rev()   return self.goto(rev)   QDesktopServices.openUrl(QUrl(link))  
 
268
269
270
271
272
 
 
273
274
275
 
268
269
270
 
 
271
272
273
274
275
@@ -268,8 +268,8 @@
  """   Select revision 'rev' (can be anything understood by repo.changectx())   """ - if type(rev) is QString: - rev = str(rev) + if isinstance(rev, (unicode, QString)): + rev = hglib.fromunicode(rev)   try:   rev = self.repo.changectx(rev).rev()   except error.RepoError: