[PATCH 2 of 3] rebase: handle revtodo as a special value when storing/restoring state
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Tue Dec 2 14:32:23 CST 2014
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1417551792 28800
# Tue Dec 02 12:23:12 2014 -0800
# Node ID 627b344d81f64444216dc0ac7cfc33d63d7fcdff
# Parent 0e50f872225ac6082796871f236c05c2e51a4d25
rebase: handle revtodo as a special value when storing/restoring state
Revtodo happen to share its value with nullrev but this is an implementation
details. So we move away from it.
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -728,11 +728,11 @@ def storestatus(repo, originalwd, target
f.write('%d\n' % int(keep))
f.write('%d\n' % int(keepbranches))
f.write('%s\n' % (activebookmark or ''))
for d, v in state.iteritems():
oldrev = repo[d].hex()
- if v > nullmerge:
+ if v >= 0:
newrev = repo[v].hex()
else:
newrev = v
f.write("%s:%s\n" % (oldrev, newrev))
f.close()
@@ -769,11 +769,11 @@ def restorestatus(repo):
# line 6 is a recent addition, so for backwards compatibility
# check that the line doesn't look like the oldrev:newrev lines
activebookmark = l
else:
oldrev, newrev = l.split(':')
- if newrev in (str(nullmerge), str(revignored)):
+ if newrev in (str(revtodo), str(nullmerge), str(revignored)):
state[repo[oldrev].rev()] = int(newrev)
else:
state[repo[oldrev].rev()] = repo[newrev].rev()
if keepbranches is None:
More information about the Mercurial-devel
mailing list