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.
--- 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