mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
rebase: improve error message for empty --rev set
Before, it just said 'nothing to rebase' in this case. Now, it aborts mentioning the reason: 'empty "rev" 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.
This commit is contained in:
parent
1ad0732dbb
commit
c8d7c5a8c0
@ -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)
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user