# HG changeset patch # User Mads Kiilerich # Date 2013-11-17 23:21:58 # Node ID 3bff26f6716934d0c5257784e857af9c6dfb153c # Parent a259f7b488ab54d37ef1fd0574b583e2c63914fd rebase: improve error message for empty --source set Before, it just said 'nothing to rebase' in this case. Now, it aborts mentioning the reason: 'empty "source" revision set'. Specifying revisions that cannot be rebased is a 'soft' error, but specifying an empty set deserves an abort that explains exactly what the problem is. 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]