diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -169,6 +169,9 @@ def backout(ui, repo, node=None, rev=Non if not rev: rev = node + if not rev: + raise util.Abort(_("please specify a revision to backout")) + cmdutil.bail_if_changed(repo) op1, op2 = repo.dirstate.parents() if op2 != nullid: diff --git a/tests/test-backout b/tests/test-backout --- a/tests/test-backout +++ b/tests/test-backout @@ -2,9 +2,14 @@ HGMERGE=true; export HGMERGE -echo '# basic operation' hg init basic cd basic + +echo '# should complain' +hg backout +hg backout -r 0 0 + +echo '# basic operation' echo a > a hg commit -d '0 0' -A -m a echo b >> a diff --git a/tests/test-backout.out b/tests/test-backout.out --- a/tests/test-backout.out +++ b/tests/test-backout.out @@ -1,3 +1,6 @@ +# should complain +abort: please specify a revision to backout +abort: please specify just one revision # basic operation adding a reverting a