Mercurial > public > mercurial-scm > hg-stable
diff hgext/rebase.py @ 44565:05654ea5137c
rebase: accept multiple --source arguments (BC)
I think it's a little surprising that `hg rebase -s A -s B` rebases
only `B::` and ignores `A`. That's because the `-s` flag is not a
repeated flag. This patch makes it a repeated flag.
Differential Revision: https://phab.mercurial-scm.org/D8292
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 13 Mar 2020 16:39:32 -0700 |
parents | c4c97cabfc16 |
children | f63598aa1c4b |
line wrap: on
line diff
--- a/hgext/rebase.py Fri Mar 13 19:29:02 2020 -0700 +++ b/hgext/rebase.py Fri Mar 13 16:39:32 2020 -0700 @@ -815,8 +815,8 @@ ( b's', b'source', - b'', - _(b'rebase the specified changeset and descendants'), + [], + _(b'rebase the specified changesets and their descendants'), _(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): @@ -1186,7 +1186,7 @@ repo, inmemory, opts.get(b'dest', None), - opts.get(b'source', None), + opts.get(b'source', []), opts.get(b'base', None), opts.get(b'rev', []), destspace=destspace, @@ -1243,11 +1243,12 @@ ui.status(_(b'empty "rev" revision set - nothing to rebase\n')) return None elif srcf: - src = scmutil.revrange(repo, [srcf]) + src = scmutil.revrange(repo, srcf) if not src: ui.status(_(b'empty "source" revision set - nothing to rebase\n')) return None - rebaseset = repo.revs(b'(%ld)::', src) or src + # `+ (%ld)` to work around `wdir()::` being empty + rebaseset = repo.revs(b'(%ld):: + (%ld)', src, src) else: base = scmutil.revrange(repo, [basef or b'.']) if not base: