Patchwork D8293: rebase: accept multiple --base arguments

login
register
mail settings
Submitter phabricator
Date March 14, 2020, 12:23 a.m.
Message ID <differential-rev-PHID-DREV-3psbpde3loicqy2hbb3b-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/45780/
State Superseded
Headers show

Comments

phabricator - March 14, 2020, 12:23 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Same reasoning as for the previous patch. Rebase has worked well with
  `--base 'A + B'` since 51e7c83e05ee <https://phab.mercurial-scm.org/rHG51e7c83e05ee742a6e5c7266c6b95ffaa078e903> (rebase: calculate ancestors for
  --base separately (issue5420), 2016-11-28).

REPOSITORY
  rHG Mercurial

BRANCH
  default

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: mercurial-devel
phabricator - March 14, 2020, 1:45 a.m.
mharbison72 added inline comments.

INLINE COMMENTS

> rebase.py:874
>      + cmdutil.confirmopts,
>      _(b'[-s REV | -b REV] [-d REV] [OPTION]'),
>      helpcategory=command.CATEGORY_CHANGE_MANAGEMENT,

Maybe these need to be updated to `REV...` like some other commands that take multiple revs.  (I looked to `graft` for reference.)  I forgot to mention this on the previous patch.

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
phabricator - March 14, 2020, 2:40 a.m.
martinvonz added a comment.
martinvonz marked an inline comment as done.


  I've updated the synopsis (also added another patch in the series for adding `-r` to the synopsis).

REPOSITORY
  rHG Mercurial

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

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

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'),
         ),
@@ -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")