Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.4, 2.0.5, and 2.1

stable annotate: keep self.annfile as a local string (fixes #570)

Changeset 18e7e5ed7a5a

Parent 5df7cf58e31c

by Steve Borho

Changes to one file · Browse files at 18e7e5ed7a5a Showing diff from parent 5df7cf58e31c Diff from another changeset...

 
82
83
84
85
86
 
87
88
89
 
162
163
164
165
 
 
 
 
 
 
 
 
 
166
167
168
169
170
171
172
 
173
174
175
 
192
193
194
195
 
196
197
198
 
208
209
210
211
 
212
213
214
 
82
83
84
 
 
85
86
87
88
 
161
162
163
 
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
 
179
180
181
182
 
199
200
201
 
202
203
204
205
 
215
216
217
 
218
219
220
221
@@ -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()