[PATCH 1 of 5] rebase: do not set internal dryrun flag by --confirm

Yuya Nishihara yuya at tcha.org
Wed Aug 15 02:06:28 UTC 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1534296730 -32400
#      Wed Aug 15 10:32:10 2018 +0900
# Node ID c1a1fb389b4dda254ae5d7af56a9b11de0c5e288
# Parent  33f5cffe725fc649d4cfffb02f4370ce9b348d95
rebase: do not set internal dryrun flag by --confirm

This prepares for cleaning up option checking.

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -805,6 +805,7 @@ def rebase(ui, repo, **opts):
     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 @@ def rebase(ui, repo, **opts):
             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 @@ def rebase(ui, repo, **opts):
         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)


More information about the Mercurial-devel mailing list