Comments
Patch
@@ -369,22 +369,28 @@ def retractboundary(repo, tr, targetphas
This function move boundary *backward* this means that all nodes
are set in the target phase or kept in a *higher* phase.
Simplify boundary to contains phase roots only."""
phcache = repo._phasecache.copy()
phcache.retractboundary(repo, tr, targetphase, nodes)
repo._phasecache.replace(phcache)
-def listphases(repo):
- """List phases root for serialization over pushkey"""
+def listphasesraw(repo):
+ """Obtain phases pushkey keys.
+
+ Keys are raw binary nodes. Values are '1' to indicate a draft root.
+
+ The special key ``publishing`` with value of ``True`` indicates that the
+ repo is publishing.
+ """
keys = {}
value = '%i' % draft
for root in repo._phasecache.phaseroots[draft]:
- keys[hex(root)] = value
+ keys[root] = value
if repo.publishing():
# Add an extra data to let remote know we are a publishing
# repo. Publishing repo can't just pretend they are old repo.
# When pushing to a publishing repo, the client still need to
# push phase boundary
#
# Push do not only push changeset. It also push phase data.
@@ -396,16 +402,26 @@ def listphases(repo):
# 3) repo B push to repo A. X is not pushed but the data that
# X as now public should
#
# The server can't handle it on it's own as it has no idea of
# client phase data.
keys['publishing'] = 'True'
return keys
+def listphases(repo):
+ """List phases root for serialization over pushkey"""
+ d = {}
+ for k, v in listphasesraw(repo).iteritems():
+ if k != 'publishing':
+ k = hex(k)
+ d[k] = v
+
+ return d
+
def pushphase(repo, nhex, oldphasestr, newphasestr):
"""List phases root for serialization over pushkey"""
repo = repo.unfiltered()
with repo.lock():
currentphase = repo[nhex].phase()
newphase = abs(int(newphasestr)) # let's avoid negative index surprise
oldphase = abs(int(oldphasestr)) # let's avoid negative index surprise
if currentphase == oldphase and newphase < oldphase: