diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -221,6 +221,9 @@ def rebase(ui, repo, **opts): if revf: rebaseset = scmutil.revrange(repo, revf) + if not rebaseset: + raise util.Abort(_('empty "rev" revision set - ' + 'nothing to rebase')) elif srcf: src = scmutil.revrange(repo, [srcf]) rebaseset = repo.revs('(%ld)::', src) diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t --- a/tests/test-rebase-parameters.t +++ b/tests/test-rebase-parameters.t @@ -79,6 +79,10 @@ These fail: abort: cannot specify both a revision and a base [255] + $ hg rebase --rev '1 & !1' + abort: empty "rev" revision set - nothing to rebase + [255] + $ hg rebase nothing to rebase [1]