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

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 15, 2018, 2:06 a.m.
Message ID <c1a1fb389b4dda254ae5.1534298788@mimosa>
Download mbox | patch
Permalink /patch/33736/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 15, 2018, 2:06 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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.
Pulkit Goyal - Aug. 15, 2018, 3:14 p.m.
On Wed, Aug 15, 2018 at 5:06 AM Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@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
>

Queued this series. Many thanks for the cleanup!

Patch

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)