fix hg diff -r ''
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Thu, 07 Dec 2006 14:15:11 -0200
changeset 3825 000d122071b5
parent 3824 2631b506e93d
child 3826 b3b868113d24
fix hg diff -r ''
mercurial/cmdutil.py
tests/test-diffdir
tests/test-diffdir.out
--- a/mercurial/cmdutil.py	Thu Dec 07 11:22:17 2006 +0100
+++ b/mercurial/cmdutil.py	Thu Dec 07 14:15:11 2006 -0200
@@ -18,7 +18,7 @@
     be None, meaning use working dir.'''
 
     def revfix(repo, val, defval):
-        if not val and val != 0:
+        if not val and val != 0 and defval is not None:
             val = defval
         return repo.lookup(val)
 
--- a/tests/test-diffdir	Thu Dec 07 11:22:17 2006 +0100
+++ b/tests/test-diffdir	Thu Dec 07 14:15:11 2006 -0200
@@ -13,3 +13,8 @@
 
 echo foo > a
 hg diff --nodates
+
+hg diff -r ""
+hg diff -r tip -r ""
+
+true
--- a/tests/test-diffdir.out	Thu Dec 07 11:22:17 2006 +0100
+++ b/tests/test-diffdir.out	Thu Dec 07 14:15:11 2006 -0200
@@ -18,3 +18,5 @@
 +++ b/b
 @@ -0,0 +1,1 @@
 +123
+abort: Ambiguous identifier!
+abort: Ambiguous identifier!