Mercurial > hg
changeset 26717:1755e1d9d1c3
rebase: extra default destination in its own function
This makes it much simple to wrap for other extension.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 15 Oct 2015 01:50:31 +0100 |
parents | c027641f8a83 |
children | 806ca3a37858 |
files | hgext/rebase.py |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/rebase.py Thu Oct 15 01:47:28 2015 +0100 +++ b/hgext/rebase.py Thu Oct 15 01:50:31 2015 +0100 @@ -63,6 +63,12 @@ c(ctx, extra) return extrafn +def _destrebase(repo): + # Destination defaults to the latest revision in the + # current branch + branch = repo[None].branch() + return repo[branch].rev() + def _rebasedefaultdest(repo, subset, x): # ``_rebasedefaultdest()`` @@ -73,10 +79,7 @@ # # XXX: - probably merging with the merge destination. # i18n: "_rebasedefaultdest" is a keyword revset.getargs(x, 0, 0, _("_rebasedefaultdest takes no arguments")) - # Destination defaults to the latest revision in the - # current branch - branch = repo[None].branch() - return subset & revset.baseset([repo[branch].rev()]) + return subset & revset.baseset([_destrebase(repo)]) @command('rebase', [('s', 'source', '',