mercurial/commands.py
changeset 47429 5c49e0aa7fad
parent 47415 b1b3127227be
child 47430 3ee036c6f834
--- a/mercurial/commands.py	Thu Jun 10 14:25:16 2021 -0700
+++ b/mercurial/commands.py	Thu Jun 10 14:36:26 2021 -0700
@@ -3088,8 +3088,7 @@
 
 
 def _dograft(ui, repo, *revs, **opts):
-    opts = pycompat.byteskwargs(opts)
-    if revs and opts.get(b'rev'):
+    if revs and opts.get('rev'):
         ui.warn(
             _(
                 b'warning: inconsistent use of --rev might give unexpected '
@@ -3098,12 +3097,13 @@
         )
 
     revs = list(revs)
-    revs.extend(opts.get(b'rev'))
+    revs.extend(opts.get('rev'))
     # a dict of data to be stored in state file
     statedata = {}
     # list of new nodes created by ongoing graft
     statedata[b'newnodes'] = []
 
+    opts = pycompat.byteskwargs(opts)
     cmdutil.resolvecommitoptions(ui, opts)
 
     editor = cmdutil.getcommiteditor(