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	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