diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -226,7 +226,11 @@ def rebase(ui, repo, **opts): 'nothing to rebase')) elif srcf: src = scmutil.revrange(repo, [srcf]) + if not src: + raise util.Abort(_('empty "source" revision set - ' + 'nothing to rebase')) rebaseset = repo.revs('(%ld)::', src) + assert rebaseset else: base = scmutil.revrange(repo, [basef or '.']) rebaseset = repo.revs( 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 @@ -83,6 +83,10 @@ These fail: abort: empty "rev" revision set - nothing to rebase [255] + $ hg rebase --source '1 & !1' + abort: empty "source" revision set - nothing to rebase + [255] + $ hg rebase nothing to rebase [1]