Mercurial > public > mercurial-scm > hg-stable
diff mercurial/discovery.py @ 18124:79db6d40bced
branchmap: store branchcache in a dedicated object
Value and key of branchcache would benefit from being hold by the same object.
Moreover some logic (update, write, validation) could be move on such object.
The creation of this object is the first step toward this move. The result will
clarify branchcache related code and hide most of the detail in the class
itself. This encapsulation will greatly helps implementation of branchcache for
filtered view of the repo.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Sat, 22 Dec 2012 01:44:42 +0100 |
parents | 88990d3e3d75 |
children | f0eeb9b3444a |
line wrap: on
line diff
--- a/mercurial/discovery.py Sat Dec 22 01:34:23 2012 +0100 +++ b/mercurial/discovery.py Sat Dec 22 01:44:42 2012 +0100 @@ -193,8 +193,9 @@ # D. Update newmap with outgoing changes. # This will possibly add new heads and remove existing ones. - newmap = dict((branch, heads[1]) for branch, heads in headssum.iteritems() - if heads[0] is not None) + newmap = branchmap.branchcache((branch, heads[1]) + for branch, heads in headssum.iteritems() + if heads[0] is not None) branchmap.update(repo, newmap, missingctx) for branch, newheads in newmap.iteritems(): headssum[branch][1][:] = newheads