changeset 2641:156fb1feab62

lookup should allow -1 to represent nullid (if passed an int as arg)
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Mon, 17 Jul 2006 01:58:50 +0200
parents a49534aac47d
children 6414ee2eb688
files mercurial/revlog.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Sun Jul 16 16:40:24 2006 +0200
+++ b/mercurial/revlog.py	Mon Jul 17 01:58:50 2006 +0200
@@ -746,10 +746,7 @@
         if id in self.nodemap:
             return id
         if type(id) == type(0):
-            rev = id
-            if rev < 0: rev = self.count() + rev
-            if rev < 0 or rev >= self.count(): return None
-            return self.node(rev)
+            return self.node(id)
         try:
             rev = int(id)
             if str(rev) != id: raise ValueError