Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 3826:b3b868113d24
fix encoding conversion of branch names when mq is loaded
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Thu, 07 Dec 2006 14:35:43 -0200 |
parents | 2aef481ac73c |
children | d1ce5461beed |
comparison
equal
deleted
inserted
replaced
3825:000d122071b5 | 3826:b3b868113d24 |
---|---|
310 self.nodetagscache = {} | 310 self.nodetagscache = {} |
311 for t, n in self.tags().items(): | 311 for t, n in self.tags().items(): |
312 self.nodetagscache.setdefault(n, []).append(t) | 312 self.nodetagscache.setdefault(n, []).append(t) |
313 return self.nodetagscache.get(node, []) | 313 return self.nodetagscache.get(node, []) |
314 | 314 |
315 def branchtags(self): | 315 def _branchtags(self): |
316 if self.branchcache != None: | |
317 return self.branchcache | |
318 | |
319 self.branchcache = {} # avoid recursion in changectx | |
320 | |
321 partial, last, lrev = self._readbranchcache() | 316 partial, last, lrev = self._readbranchcache() |
322 | 317 |
323 tiprev = self.changelog.count() - 1 | 318 tiprev = self.changelog.count() - 1 |
324 if lrev != tiprev: | 319 if lrev != tiprev: |
325 self._updatebranchcache(partial, lrev+1, tiprev+1) | 320 self._updatebranchcache(partial, lrev+1, tiprev+1) |
326 self._writebranchcache(partial, self.changelog.tip(), tiprev) | 321 self._writebranchcache(partial, self.changelog.tip(), tiprev) |
322 | |
323 return partial | |
324 | |
325 def branchtags(self): | |
326 if self.branchcache is not None: | |
327 return self.branchcache | |
328 | |
329 self.branchcache = {} # avoid recursion in changectx | |
330 partial = self._branchtags() | |
327 | 331 |
328 # the branch cache is stored on disk as UTF-8, but in the local | 332 # the branch cache is stored on disk as UTF-8, but in the local |
329 # charset internally | 333 # charset internally |
330 for k, v in partial.items(): | 334 for k, v in partial.items(): |
331 self.branchcache[util.tolocal(k)] = v | 335 self.branchcache[util.tolocal(k)] = v |