comparison mercurial/commands.py @ 43875:8376d5d62d36

graft: reuse cmdutl.resolvecommitoptions() Differential Revision: https://phab.mercurial-scm.org/D7632
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 12 Dec 2019 15:30:16 -0800
parents 8caec25f5d8f
children d587937600be
comparison
equal deleted inserted replaced
43874:c6feee1e4d5b 43875:8376d5d62d36
2969 # a dict of data to be stored in state file 2969 # a dict of data to be stored in state file
2970 statedata = {} 2970 statedata = {}
2971 # list of new nodes created by ongoing graft 2971 # list of new nodes created by ongoing graft
2972 statedata[b'newnodes'] = [] 2972 statedata[b'newnodes'] = []
2973 2973
2974 if opts.get(b'user') and opts.get(b'currentuser'): 2974 cmdutil.resolvecommitoptions(ui, opts)
2975 raise error.Abort(_(b'--user and --currentuser are mutually exclusive'))
2976 if opts.get(b'date') and opts.get(b'currentdate'):
2977 raise error.Abort(_(b'--date and --currentdate are mutually exclusive'))
2978 if not opts.get(b'user') and opts.get(b'currentuser'):
2979 opts[b'user'] = ui.username()
2980 if not opts.get(b'date') and opts.get(b'currentdate'):
2981 opts[b'date'] = b"%d %d" % dateutil.makedate()
2982 2975
2983 editor = cmdutil.getcommiteditor( 2976 editor = cmdutil.getcommiteditor(
2984 editform=b'graft', **pycompat.strkwargs(opts) 2977 editform=b'graft', **pycompat.strkwargs(opts)
2985 ) 2978 )
2986 2979