Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 15650:5b26667fc4d3
phases: exchange phase boundaries on pull
Add an extra argument to addchangegroup to all phase code to execute before the
lock is released.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Thu, 15 Dec 2011 11:28:42 +0100 |
parents | 218ec96c45d7 |
children | e69a3cdad37e |
line wrap: on
line diff
--- a/mercurial/localrepo.py Thu Dec 15 02:18:24 2011 +0100 +++ b/mercurial/localrepo.py Thu Dec 15 11:28:42 2011 +0100 @@ -1507,6 +1507,7 @@ common, fetch, rheads = tmp if not fetch: self.ui.status(_("no changes found\n")) + added = [] result = 0 else: if heads is None and list(common) == [nullid]: @@ -1526,8 +1527,26 @@ "changegroupsubset.")) else: cg = remote.changegroupsubset(fetch, heads, 'pull') + clstart = len(self.changelog) result = self.addchangegroup(cg, 'pull', remote.url()) - phases.advanceboundary(self, 0, common) + clend = len(self.changelog) + added = [self.changelog.node(r) for r in xrange(clstart, clend)] + + + # Get remote phases data from remote + remotephases = remote.listkeys('phases') + publishing = bool(remotephases.get('publishing', False)) + if remotephases and not publishing: + # remote is new and unpublishing + subset = common + added + rheads, rroots = phases.analyzeremotephases(self, subset, + remotephases) + for phase, boundary in enumerate(rheads): + phases.advanceboundary(self, phase, boundary) + else: + # Remote is old or publishing all common changesets + # should be seen as public + phases.advanceboundary(self, 0, common + added) finally: lock.release()