diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1394,7 +1394,7 @@ diffopts = self.diffopts() with repo.wlock(): heads = [] - for hs in repo.branchmap().itervalues(): + for hs in repo.branchmap().iterheads(): heads.extend(hs) if not heads: heads = [nullid] diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py --- a/mercurial/branchmap.py +++ b/mercurial/branchmap.py @@ -178,9 +178,6 @@ def iteritems(self): return self.entries.iteritems() - def itervalues(self): - return self.entries.itervalues() - @classmethod def fromfile(cls, repo): f = None @@ -287,6 +284,10 @@ for bn, heads in self.iteritems(): yield (bn, heads) + self._branchtip(heads) + def iterheads(self): + """ returns all the heads """ + return self.entries.itervalues() + def copy(self): """return an deep copy of the branchcache object""" return branchcache( @@ -369,7 +370,7 @@ # cache key are not valid anymore self.tipnode = nullid self.tiprev = nullrev - for heads in self.itervalues(): + for heads in self.iterheads(): tiprev = max(cl.rev(node) for node in heads) if tiprev > self.tiprev: self.tipnode = cl.node(tiprev) diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1980,7 +1980,7 @@ op.gettransaction() currentheads = set() - for ls in op.repo.branchmap().itervalues(): + for ls in op.repo.branchmap().iterheads(): currentheads.update(ls) for h in heads: diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1240,7 +1240,7 @@ getargs(x, 0, 0, _("head takes no arguments")) hs = set() cl = repo.changelog - for ls in repo.branchmap().itervalues(): + for ls in repo.branchmap().iterheads(): hs.update(cl.rev(h) for h in ls) return subset & baseset(hs)