rebase: do not set internal dryrun flag by --confirm
authorYuya Nishihara <yuya@tcha.org>
Wed, 15 Aug 2018 10:32:10 +0900
changeset 39097 c1a1fb389b4d
parent 39096 33f5cffe725f
child 39098 a42506059522
rebase: do not set internal dryrun flag by --confirm This prepares for cleaning up option checking.
hgext/rebase.py
--- a/hgext/rebase.py	Fri Jul 27 14:30:28 2018 +0530
+++ b/hgext/rebase.py	Wed Aug 15 10:32:10 2018 +0900
@@ -805,6 +805,7 @@
     opts = pycompat.byteskwargs(opts)
     inmemory = ui.configbool('rebase', 'experimental.inmemory')
     dryrun = opts.get('dry_run')
+    confirm = opts.get('confirm')
     stop = opts.get('stop')
     if stop:
         if opts.get('dry_run') or opts.get('confirm'):
@@ -817,8 +818,7 @@
             raise error.Abort(_('cannot specify both --dry-run and --abort'))
         if opts.get('continue'):
             raise error.Abort(_('cannot specify both --dry-run and --continue'))
-    if opts.get('confirm'):
-        dryrun = True
+    if confirm:
         if opts.get('dry_run'):
             raise error.Abort(_('cannot specify both --confirm and --dry-run'))
         if opts.get('abort'):
@@ -842,7 +842,7 @@
         opts['rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)]
         opts['dest'] = '_destautoorphanrebase(SRC)'
 
-    if dryrun:
+    if dryrun or confirm:
         return _dryrunrebase(ui, repo, opts)
     elif stop:
         rbsrt = rebaseruntime(repo, ui)