changeset 4726:f6e961c0155b

Fix and test 'hg backout' without or with too many revisions.
author Thomas Arendsen Hein <thomas@intevation.de>
date Tue, 26 Jun 2007 15:28:17 +0200
parents cf8b8f62688a
children 79cc512a34ed
files mercurial/commands.py tests/test-backout tests/test-backout.out
diffstat 3 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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:
--- 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
--- 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