comparison mercurial/commands.py @ 41174:08dd462ea782

graft: abort if --date/user specified with --currentdate/currentuser (BC) They are conflicting options. Let's explicitly ban such combination. Note that this means you need "--no-currentdate --date" to override --currentdate specified in aliases/defaults.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 10 Jan 2019 21:57:21 +0900
parents 074c72a38423
children 183df3df6031
comparison
equal deleted inserted replaced
41173:4145fd3569c3 41174:08dd462ea782
2391 # a dict of data to be stored in state file 2391 # a dict of data to be stored in state file
2392 statedata = {} 2392 statedata = {}
2393 # list of new nodes created by ongoing graft 2393 # list of new nodes created by ongoing graft
2394 statedata['newnodes'] = [] 2394 statedata['newnodes'] = []
2395 2395
2396 if opts.get('user') and opts.get('currentuser'):
2397 raise error.Abort(_('--user and --currentuser are mutually exclusive'))
2398 if opts.get('date') and opts.get('currentdate'):
2399 raise error.Abort(_('--date and --currentdate are mutually exclusive'))
2396 if not opts.get('user') and opts.get('currentuser'): 2400 if not opts.get('user') and opts.get('currentuser'):
2397 opts['user'] = ui.username() 2401 opts['user'] = ui.username()
2398 if not opts.get('date') and opts.get('currentdate'): 2402 if not opts.get('date') and opts.get('currentdate'):
2399 opts['date'] = "%d %d" % dateutil.makedate() 2403 opts['date'] = "%d %d" % dateutil.makedate()
2400 2404