diff mercurial/revlog.py @ 2642:6414ee2eb688

correct the handling of linkrev with nullid
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Mon, 17 Jul 2006 01:58:59 +0200
parents 156fb1feab62
children f23973ea3107
line wrap: on
line diff
--- a/mercurial/revlog.py	Mon Jul 17 01:58:50 2006 +0200
+++ b/mercurial/revlog.py	Mon Jul 17 01:58:59 2006 +0200
@@ -469,7 +469,8 @@
             return self.nodemap[node]
         except KeyError:
             raise RevlogError(_('%s: no node %s') % (self.indexfile, hex(node)))
-    def linkrev(self, node): return self.index[self.rev(node)][-4]
+    def linkrev(self, node):
+        return (node == nullid) and -1 or self.index[self.rev(node)][-4]
     def parents(self, node):
         if node == nullid: return (nullid, nullid)
         r = self.rev(node)