Changeset 18e7e5ed7a5a…
Parent 5df7cf58e31c…
by
Changes to one file · Browse files at 18e7e5ed7a5a Showing diff from parent 5df7cf58e31c Diff from another changeset...
@@ -82,8 +82,7 @@ try:
fctx = self._links[line][0]
if fctx.rev() != self._lastrev:
- s = hglib.get_revision_desc(fctx,
- hglib.fromunicode(self.annfile))
+ s = hglib.get_revision_desc(fctx, self.annfile)
self.revisionHint.emit(s)
self._lastrev = fctx.rev()
except IndexError:
@@ -162,14 +161,22 @@
line is counted from 1.
"""
- if self.annfile == wfile and self.rev == rev:
+ if isinstance(wfile, (unicode, QString)):
+ # setSource can be used as a slot, in which case wfile is a QString
+ lwfile = hglib.fromunicode(wfile)
+ else:
+ # or it can be called directly with a local encoded wfile string
+ lwfile = wfile
+ wfile = hglib.tounicode(wfile)
+
+ if self.annfile == lwfile and self.rev == rev:
if line:
self.setCursorPosition(int(line) - 1, 0)
return
try:
ctx = self.repo[rev]
- fctx = ctx[hglib.fromunicode(wfile)]
+ fctx = ctx[lwfile]
except error.LookupError:
qtlib.ErrorMsgBox(_('Unable to annotate'),
_('%s is not found in revision %d') % (wfile, ctx.rev()))
@@ -192,7 +199,7 @@ else:
self._rev = ctx.rev()
self.clear()
- self.annfile = wfile
+ self.annfile = lwfile
if util.binary(fctx.data()):
self.setText(_('File is binary.\n'))
else:
@@ -208,7 +215,7 @@ if not self.isAnnotationEnabled() or not self.annfile:
return
ctx = self.repo[self._rev]
- fctx = ctx[hglib.fromunicode(self.annfile)]
+ fctx = ctx[self.annfile]
if util.binary(fctx.data()):
return
self._thread.abort()
|
Loading...