diff mercurial/context.py @ 3578:3b4e00cba57a

Define and use nullrev (revision of nullid) instead of -1.
author Thomas Arendsen Hein <thomas@intevation.de>
date Sun, 29 Oct 2006 10:53:51 +0100
parents 23ede9e7ad4d
children 66a17364c30e eb0b4a2d70a9
line wrap: on
line diff
--- a/mercurial/context.py	Sat Oct 28 23:37:59 2006 -0300
+++ b/mercurial/context.py	Sun Oct 29 10:53:51 2006 +0100
@@ -39,7 +39,7 @@
         return self._rev == other._rev
 
     def __nonzero__(self):
-        return self._rev != -1
+        return self._rev != nullrev
 
     def __getattr__(self, name):
         if name == '_changeset':
@@ -257,7 +257,7 @@
                 if r:
                     pl[0] = (r[0], getlog(r[0]).rev(r[1]))
 
-            return [ getctx(p, n) for p, n in pl if n != -1 ]
+            return [getctx(p, n) for p, n in pl if n != nullrev]
 
         # use linkrev to find the first changeset where self appeared
         if self.rev() != self._filelog.linkrev(self._filenode):