Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 9675:ee913987e4b0
localrepo/branchcache: remove lbranchmap(), convert users to use utf-8 names
We don't need a "local-charset" aware branchmap() function, we can convert the
names when needed during the output.
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Sat, 31 Oct 2009 00:31:08 +0100 |
parents | 603b23c6967b |
children | f8e1456e1c2c |
line wrap: on
line diff
--- a/mercurial/localrepo.py Sat Oct 31 00:27:50 2009 +0100 +++ b/mercurial/localrepo.py Sat Oct 31 00:31:08 2009 +0100 @@ -318,16 +318,6 @@ return partial - def lbranchmap(self): - branchcache = {} - partial = self.branchmap() - - # the branch cache is stored on disk as UTF-8, but in the local - # charset internally - for k, v in partial.iteritems(): - branchcache[encoding.tolocal(k)] = v - return branchcache - def branchmap(self): tip = self.changelog.tip() if self._branchcache is not None and self._branchcachetip == tip: @@ -351,7 +341,7 @@ '''return a dict where branch names map to the tipmost head of the branch, open heads come before closed''' bt = {} - for bn, heads in self.lbranchmap().iteritems(): + for bn, heads in self.branchmap().iteritems(): head = None for i in range(len(heads)-1, -1, -1): h = heads[i] @@ -1167,7 +1157,7 @@ ''' if branch is None: branch = self[None].branch() - branches = self.lbranchmap() + branches = self.branchmap() if branch not in branches: return [] # the cache returns heads ordered lowest to highest