Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 17075:28ed1c4511ce
obsolete: exchange obsolete marker over pushkey
For a version of the exchange, all markers are exchange. This won't
scale and we will need a better protocol later.
author | Pierre-Yves.David@ens-lyon.org |
---|---|
date | Thu, 07 Jun 2012 19:21:59 +0200 |
parents | ad0d6c2b3279 |
children | f1b7683f3f95 b090601a80d1 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Thu Jun 07 19:20:44 2012 +0200 +++ b/mercurial/localrepo.py Thu Jun 07 19:21:59 2012 +0200 @@ -4,12 +4,11 @@ # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. - from node import bin, hex, nullid, nullrev, short from i18n import _ import repo, changegroup, subrepo, discovery, pushkey, obsolete import changelog, dirstate, filelog, manifest, context, bookmarks, phases -import lock, transaction, store, encoding +import lock, transaction, store, encoding, base85 import scmutil, util, extensions, hook, error, revset import match as matchmod import merge as mergemod @@ -1674,6 +1673,11 @@ # Remote is old or publishing all common changesets # should be seen as public phases.advanceboundary(self, phases.public, subset) + + remoteobs = remote.listkeys('obsolete') + if 'dump' in remoteobs: + data = base85.b85decode(remoteobs['dump']) + self.obsstore.mergemarkers(data) finally: lock.release() @@ -1814,6 +1818,12 @@ if not r: self.ui.warn(_('updating %s to public failed!\n') % newremotehead) + if 'obsolete' in self.listkeys('namespaces') and self.obsstore: + data = self.obsstore._writemarkers() + r = remote.pushkey('obsolete', 'dump', '', + base85.b85encode(data)) + if not r: + self.ui.warn(_('failed to push obsolete markers!\n')) finally: if lock is not None: lock.release()