diff -r f330d6117a5b -r 61719b9658b1 mercurial/commands.py --- a/mercurial/commands.py Sat May 30 12:36:00 2020 -0400 +++ b/mercurial/commands.py Wed Jun 03 19:20:18 2020 +0900 @@ -2971,9 +2971,6 @@ revs = list(revs) revs.extend(opts.get(b'rev')) - basectx = None - if opts.get(b'base'): - basectx = scmutil.revsingle(repo, opts[b'base'], None) # a dict of data to be stored in state file statedata = {} # list of new nodes created by ongoing graft @@ -3063,6 +3060,8 @@ opts[b'log'] = True if statedata.get(b'no_commit'): opts[b'no_commit'] = statedata.get(b'no_commit') + if statedata.get(b'base'): + opts[b'base'] = statedata.get(b'base') nodes = statedata[b'nodes'] revs = [repo[node].rev() for node in nodes] else: @@ -3075,6 +3074,9 @@ revs = scmutil.revrange(repo, revs) skipped = set() + basectx = None + if opts.get(b'base'): + basectx = scmutil.revsingle(repo, opts[b'base'], None) if basectx is None: # check for merges for rev in repo.revs(b'%ld and merge()', revs): @@ -3167,6 +3169,8 @@ if opts.get(b'no_commit'): statedata[b'no_commit'] = True + if opts.get(b'base'): + statedata[b'base'] = opts[b'base'] for pos, ctx in enumerate(repo.set(b"%ld", revs)): desc = b'%d:%s "%s"' % ( ctx.rev(),