Mercurial > hg
changeset 21197:cb4223c65f79 stable
rebase: don't abort if we're asked to rebase an empty revset
The documentation says we exit 1 if we have nothing to do, so avoid
breaking that contract when we're passed an empty revset.
This was changed in http://www.selenic.com/hg/rev/a259f7b488ab to
improve the error message; keep the improved message, just not the
abort.
author | Julien Cristau <julien.cristau@logilab.fr> |
---|---|
date | Wed, 23 Apr 2014 13:51:35 +0200 |
parents | 5c0d5b95b824 |
children | 56a04085c23c |
files | hgext/rebase.py tests/test-rebase-parameters.t |
diffstat | 2 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/rebase.py Fri Apr 25 22:34:09 2014 -0400 +++ b/hgext/rebase.py Wed Apr 23 13:51:35 2014 +0200 @@ -222,8 +222,9 @@ if revf: rebaseset = scmutil.revrange(repo, revf) if not rebaseset: - raise util.Abort(_('empty "rev" revision set - ' - 'nothing to rebase')) + ui.status(_('empty "rev" revision set - ' + 'nothing to rebase\n')) + return 1 elif srcf: src = scmutil.revrange(repo, [srcf]) if not src:
--- a/tests/test-rebase-parameters.t Fri Apr 25 22:34:09 2014 -0400 +++ b/tests/test-rebase-parameters.t Wed Apr 23 13:51:35 2014 +0200 @@ -80,8 +80,8 @@ [255] $ hg rebase --rev '1 & !1' - abort: empty "rev" revision set - nothing to rebase - [255] + empty "rev" revision set - nothing to rebase + [1] $ hg rebase --source '1 & !1' abort: empty "source" revision set - nothing to rebase