Patchwork D8293: rebase: accept multiple --base arguments (BC)

login
register
mail settings
Submitter phabricator
Date March 14, 2020, 2:38 a.m.
Message ID <eb57260a001555901dbb5543631dd881@localhost.localdomain>
Download mbox | patch
Permalink /patch/45787/
State Not Applicable
Headers show

Comments

phabricator - March 14, 2020, 2:38 a.m.
martinvonz updated this revision to Diff 20792.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8293?vs=20784&id=20792

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8293/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8293

AFFECTED FILES
  hgext/rebase.py
  relnotes/next
  tests/test-rebase-dest.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel

Patch

diff --git a/tests/test-rebase-dest.t b/tests/test-rebase-dest.t
--- a/tests/test-rebase-dest.t
+++ b/tests/test-rebase-dest.t
@@ -156,7 +156,7 @@ 
 
 Multiple destinations cannot be used with --base:
 
-  $ rebasewithdag -b B+E -d 'SRC^^' --collapse <<'EOS'
+  $ rebasewithdag -b B -b E -d 'SRC^^' --collapse <<'EOS'
   > B E
   > | |
   > A D
diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -58,12 +58,12 @@ 
    can use the new `conflictparents()` revset for finding the other
    parent during a conflict.
 
- * `hg rebase` now accepts repeated `--source` arguments. For example,
-   `hg rebase --source 'A + B'` is equivalent to `hg rebase --source A
-   --source B`. This is a backwards-incompatible change because it
-   will break overriding an alias `myrebase = rebase --source A` by
-   `hg myrebase --source B` (it will now rebase `(A + B)::` instead of
-   `B::`).
+ * `hg rebase` now accepts repeated `--source` and `--base`
+   arguments. For example, `hg rebase --source 'A + B'` is equivalent
+   to `hg rebase --source A --source B`. This is a
+   backwards-incompatible change because it will break overriding an
+   alias `myrebase = rebase --source A` by `hg myrebase --source B`
+   (it will now rebase `(A + B)::` instead of `B::`).
 
  * `hg recover` does not verify the validity of the whole repository
    anymore. You can pass `--verify` or call `hg verify` if necessary.
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -822,7 +822,7 @@ 
         (
             b'b',
             b'base',
-            b'',
+            [],
             _(b'rebase everything from branching point of specified changeset'),
             _(b'REV'),
         ),
@@ -871,7 +871,7 @@ 
     + cmdutil.dryrunopts
     + cmdutil.formatteropts
     + cmdutil.confirmopts,
-    _(b'[[-s REV]... | -b REV | [-r REV]...] [-d REV] [OPTION]...'),
+    _(b'[[-s REV]... | [-b REV]... | [-r REV]...] [-d REV] [OPTION]...'),
     helpcategory=command.CATEGORY_CHANGE_MANAGEMENT,
 )
 def rebase(ui, repo, **opts):
@@ -1187,7 +1187,7 @@ 
                 inmemory,
                 opts.get(b'dest', None),
                 opts.get(b'source', []),
-                opts.get(b'base', None),
+                opts.get(b'base', []),
                 opts.get(b'rev', []),
                 destspace=destspace,
             )
@@ -1250,7 +1250,7 @@ 
         # `+  (%ld)` to work around `wdir()::` being empty
         rebaseset = repo.revs(b'(%ld):: + (%ld)', src, src)
     else:
-        base = scmutil.revrange(repo, [basef or b'.'])
+        base = scmutil.revrange(repo, basef or [b'.'])
         if not base:
             ui.status(
                 _(b'empty "base" revision set - ' b"can't compute rebase set\n")