changeset 43881: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 c6feee1e4d5b
children e5f69e3bb3f6
files mercurial/commands.py
diffstat 1 files changed, 1 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Dec 13 15:46:25 2019 -0800
+++ b/mercurial/commands.py	Thu Dec 12 15:30:16 2019 -0800
@@ -2971,14 +2971,7 @@
     # list of new nodes created by ongoing graft
     statedata[b'newnodes'] = []
 
-    if opts.get(b'user') and opts.get(b'currentuser'):
-        raise error.Abort(_(b'--user and --currentuser are mutually exclusive'))
-    if opts.get(b'date') and opts.get(b'currentdate'):
-        raise error.Abort(_(b'--date and --currentdate are mutually exclusive'))
-    if not opts.get(b'user') and opts.get(b'currentuser'):
-        opts[b'user'] = ui.username()
-    if not opts.get(b'date') and opts.get(b'currentdate'):
-        opts[b'date'] = b"%d %d" % dateutil.makedate()
+    cmdutil.resolvecommitoptions(ui, opts)
 
     editor = cmdutil.getcommiteditor(
         editform=b'graft', **pycompat.strkwargs(opts)