# HG changeset patch # User Thomas Arendsen Hein # Date 2007-06-26 13:28:17 # Node ID f6e961c0155b759b658bf547ed81117d0a8651a2 # Parent cf8b8f62688aef733ca6f97f1b8833030da2d63c Fix and test 'hg backout' without or with too many revisions. 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