changeset 3822:000d122071b5

fix hg diff -r ''
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 07 Dec 2006 14:15:11 -0200
parents 2631b506e93d
children b3b868113d24
files mercurial/cmdutil.py tests/test-diffdir tests/test-diffdir.out
diffstat 3 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -18,7 +18,7 @@ def revpair(repo, revs):
     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
+++ b/tests/test-diffdir
@@ -13,3 +13,8 @@ hg diff --nodates -r tip
 
 echo foo > a
 hg diff --nodates
+
+hg diff -r ""
+hg diff -r tip -r ""
+
+true
--- a/tests/test-diffdir.out
+++ b/tests/test-diffdir.out
@@ -18,3 +18,5 @@ diff -r acd8075edac9 b
 +++ b/b
 @@ -0,0 +1,1 @@
 +123
+abort: Ambiguous identifier!
+abort: Ambiguous identifier!