graft: fix --base value to be saved in state file stable
authorYuya Nishihara <yuya@tcha.org>
Tue, 02 Jun 2020 20:40:06 +0900
branchstable
changeset 44915 2dc5ae953c4a
parent 44914 6d968cd40961
child 44916 61719b9658b1
child 44917 bad37041fc1e
graft: fix --base value to be saved in state file 'True' just works because it is treated as an integer revision '1' and only the truthiness of the basectx is important. If multiple source revisions were supported with --base, the resumed graft operation would go wrong.
mercurial/commands.py
--- a/mercurial/commands.py	Sat May 16 20:38:53 2020 +0200
+++ b/mercurial/commands.py	Tue Jun 02 20:40:06 2020 +0900
@@ -3168,7 +3168,7 @@
     if opts.get(b'no_commit'):
         statedata[b'no_commit'] = True
     if opts.get(b'base'):
-        statedata[b'base'] = True
+        statedata[b'base'] = opts[b'base']
     for pos, ctx in enumerate(repo.set(b"%ld", revs)):
         desc = b'%d:%s "%s"' % (
             ctx.rev(),