# HG changeset patch # User Alexis S. L. Carvalho # Date 1165509343 7200 # Node ID b3b868113d245bcbc21adcea4b5a0c9787049f15 # Parent 000d122071b5188617709f2450a9007b8049f19c fix encoding conversion of branch names when mq is loaded diff -r 000d122071b5 -r b3b868113d24 hgext/mq.py --- a/hgext/mq.py Thu Dec 07 14:15:11 2006 -0200 +++ b/hgext/mq.py Thu Dec 07 14:35:43 2006 -0200 @@ -2043,13 +2043,10 @@ return tagscache - def branchtags(self): - if self.branchcache != None: - return self.branchcache - + def _branchtags(self): q = self.mq if not q.applied: - return super(mqrepo, self).branchtags() + return super(mqrepo, self)._branchtags() self.branchcache = {} # avoid recursion in changectx cl = self.changelog @@ -2069,8 +2066,7 @@ # update the cache up to the tip self._updatebranchcache(partial, start, cl.count()) - self.branchcache = partial - return self.branchcache + return partial if repo.local(): repo.__class__ = mqrepo diff -r 000d122071b5 -r b3b868113d24 mercurial/localrepo.py --- a/mercurial/localrepo.py Thu Dec 07 14:15:11 2006 -0200 +++ b/mercurial/localrepo.py Thu Dec 07 14:35:43 2006 -0200 @@ -312,12 +312,7 @@ self.nodetagscache.setdefault(n, []).append(t) return self.nodetagscache.get(node, []) - def branchtags(self): - if self.branchcache != None: - return self.branchcache - - self.branchcache = {} # avoid recursion in changectx - + def _branchtags(self): partial, last, lrev = self._readbranchcache() tiprev = self.changelog.count() - 1 @@ -325,6 +320,15 @@ self._updatebranchcache(partial, lrev+1, tiprev+1) self._writebranchcache(partial, self.changelog.tip(), tiprev) + return partial + + def branchtags(self): + if self.branchcache is not None: + return self.branchcache + + self.branchcache = {} # avoid recursion in changectx + partial = self._branchtags() + # the branch cache is stored on disk as UTF-8, but in the local # charset internally for k, v in partial.items():