update: fix check for no rev when a date is given
authorIdan Kamara <idankk86@gmail.com>
Tue, 19 Apr 2011 14:56:46 +0300
changeset 13960 190e5f2043d9
parent 13959 141f88ae5276
child 13961 1708a0cad774
update: fix check for no rev when a date is given The previous check caught a corner case in which rev was pointing to 0.
mercurial/commands.py
tests/test-simple-update.t
--- a/mercurial/commands.py	Tue Apr 19 15:19:54 2011 +0200
+++ b/mercurial/commands.py	Tue Apr 19 14:56:46 2011 +0300
@@ -4198,7 +4198,7 @@
             raise util.Abort(_("uncommitted local changes"))
 
     if date:
-        if rev:
+        if rev is not None:
             raise util.Abort(_("you can't specify a revision and a date"))
         rev = cmdutil.finddate(ui, repo, date)
 
--- a/tests/test-simple-update.t	Tue Apr 19 15:19:54 2011 +0200
+++ b/tests/test-simple-update.t	Tue Apr 19 14:56:46 2011 +0300
@@ -49,3 +49,8 @@
   $ hg manifest --debug
   6f4310b00b9a147241b071a60c28a650827fb03d 644   foo
 
+update to rev 0 with a date
+
+  $ hg upd -d foo 0
+  abort: you can't specify a revision and a date
+  [255]