##// END OF EJS Templates
rebase: handle revtodo as a special value when storing/restoring state...
Pierre-Yves David -
r23491:9972758a default
parent child Browse files
Show More
@@ -18,7 +18,7 b' from mercurial import hg, util, repair, '
18 from mercurial import extensions, patch, scmutil, phases, obsolete, error
18 from mercurial import extensions, patch, scmutil, phases, obsolete, error
19 from mercurial import copies
19 from mercurial import copies
20 from mercurial.commands import templateopts
20 from mercurial.commands import templateopts
21 from mercurial.node import nullrev
21 from mercurial.node import nullrev, nullid, hex
22 from mercurial.lock import release
22 from mercurial.lock import release
23 from mercurial.i18n import _
23 from mercurial.i18n import _
24 import os, errno
24 import os, errno
@@ -737,8 +737,12 b' def storestatus(repo, originalwd, target'
737 f.write('%s\n' % (activebookmark or ''))
737 f.write('%s\n' % (activebookmark or ''))
738 for d, v in state.iteritems():
738 for d, v in state.iteritems():
739 oldrev = repo[d].hex()
739 oldrev = repo[d].hex()
740 if v > nullmerge:
740 if v >= 0:
741 newrev = repo[v].hex()
741 newrev = repo[v].hex()
742 elif v == revtodo:
743 # To maintain format compatibility, we have to use nullid.
744 # Please do remove this special case when upgrading the format.
745 newrev = hex(nullid)
742 else:
746 else:
743 newrev = v
747 newrev = v
744 f.write("%s:%s\n" % (oldrev, newrev))
748 f.write("%s:%s\n" % (oldrev, newrev))
@@ -780,6 +784,9 b' def restorestatus(repo):'
780 oldrev, newrev = l.split(':')
784 oldrev, newrev = l.split(':')
781 if newrev in (str(nullmerge), str(revignored)):
785 if newrev in (str(nullmerge), str(revignored)):
782 state[repo[oldrev].rev()] = int(newrev)
786 state[repo[oldrev].rev()] = int(newrev)
787 elif newrev == nullid:
788 state[repo[oldrev].rev()] = revtodo
789 # Legacy compat special case
783 else:
790 else:
784 state[repo[oldrev].rev()] = repo[newrev].rev()
791 state[repo[oldrev].rev()] = repo[newrev].rev()
785
792
General Comments 0
You need to be logged in to leave comments. Login now