diff mercurial/cmd_impls/graft.py @ 52367:0b52283d50bb

graft: get the editor later We don't use it in that function, so I would rather have it close to the return.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 20 Nov 2024 04:23:45 +0100
parents 77cb5d8643b3
children 8faabe8abf66
line wrap: on
line diff
--- a/mercurial/cmd_impls/graft.py	Wed Nov 20 04:22:12 2024 +0100
+++ b/mercurial/cmd_impls/graft.py	Wed Nov 20 04:23:45 2024 +0100
@@ -46,8 +46,6 @@
 
     cmdutil.resolve_commit_options(ui, opts)
 
-    editor = cmdutil.getcommiteditor(editform=b'graft', **opts)
-
     cmdutil.check_at_most_one_arg(opts, 'abort', 'stop', 'continue')
 
     cont = False
@@ -220,6 +218,7 @@
         if not revs:
             return "ERROR", None, None
 
+    editor = cmdutil.getcommiteditor(editform=b'graft', **opts)
     dry_run = bool(opts.get("dry_run"))
     tool = opts.get('tool', b'')
     return "GRAFT", graftstate, (statedata, revs, editor, cont, dry_run, tool)