Fix and test 'hg backout' without or with too many revisions.
authorThomas Arendsen Hein <thomas@intevation.de>
Tue, 26 Jun 2007 15:28:17 +0200
changeset 4726 f6e961c0155b
parent 4725 cf8b8f62688a
child 4727 79cc512a34ed
Fix and test 'hg backout' without or with too many revisions.
mercurial/commands.py
tests/test-backout
tests/test-backout.out
--- a/mercurial/commands.py	Mon Jun 25 21:23:24 2007 -0500
+++ b/mercurial/commands.py	Tue Jun 26 15:28:17 2007 +0200
@@ -169,6 +169,9 @@
     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	Mon Jun 25 21:23:24 2007 -0500
+++ b/tests/test-backout	Tue Jun 26 15:28:17 2007 +0200
@@ -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	Mon Jun 25 21:23:24 2007 -0500
+++ b/tests/test-backout.out	Tue Jun 26 15:28:17 2007 +0200
@@ -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