comparison mercurial/commands.py @ 38154:decdb587ea12

graft: reuse --user and --date values in `hg graft --continue` (BC) Reading the user and date information from graftstate during `hg graft --continue` will help us in preserving the user and date arguments passed when `hg graft` was called. This patch reads that information and reuses that while running `hg graft --continue`. So after this patch, --user and --date values are preserved even if conflicts occur and user don't need to pass them again. The test changes demonstrate the fix. This is a backward incompatible change but I think of this more as a bug fix. Also thinking about removing the line from `hg help graft` which says --continue does not reapply other flags but need to check what are the other flags which needs to be preserved. Differential Revision: https://phab.mercurial-scm.org/D3659
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 25 May 2018 17:21:01 +0530
parents 63553c2bef7e
children 5736570718fe
comparison
equal deleted inserted replaced
38153:108ebd8eff5c 38154:decdb587ea12
2224 cont = True 2224 cont = True
2225 if revs: 2225 if revs:
2226 raise error.Abort(_("can't specify --continue and revisions")) 2226 raise error.Abort(_("can't specify --continue and revisions"))
2227 # read in unfinished revisions 2227 # read in unfinished revisions
2228 if graftstate.exists(): 2228 if graftstate.exists():
2229 nodes = _readgraftstate(repo, graftstate)['nodes'] 2229 statedata = _readgraftstate(repo, graftstate)
2230 if statedata.get('date'):
2231 opts['date'] = statedata['date']
2232 if statedata.get('user'):
2233 opts['user'] = statedata['user']
2234 nodes = statedata['nodes']
2230 revs = [repo[node].rev() for node in nodes] 2235 revs = [repo[node].rev() for node in nodes]
2231 else: 2236 else:
2232 cmdutil.wrongtooltocontinue(repo, _('graft')) 2237 cmdutil.wrongtooltocontinue(repo, _('graft'))
2233 else: 2238 else:
2234 if not revs: 2239 if not revs: