changeset 3143:db25f7b80fdb

context: handle fileid or changeid == 0
author Brendan Cully <brendan@kublai.com>
date Fri, 22 Sep 2006 08:19:25 -0700
parents aabc5ef7d159
children 8342ad5abe0b
files mercurial/context.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Fri Sep 22 08:48:56 2006 +0200
+++ b/mercurial/context.py	Fri Sep 22 08:19:25 2006 -0700
@@ -16,7 +16,7 @@
         """changeid is a revision number, node, or tag"""
         self._repo = repo
 
-        if not changeid:
+        if not changeid and changeid != 0:
             p1, p2 = self._repo.dirstate.parents()
             self._rev = self._repo.changelog.rev(p1)
             if self._rev == -1:
@@ -94,14 +94,14 @@
         self._repo = repo
         self._path = path
 
-        assert changeid or fileid
+        assert changeid is not None or fileid is not None
 
         if filelog:
             self._filelog = filelog
         else:
             self._filelog = self._repo.file(self._path)
 
-        if not fileid:
+        if fileid is None:
             # if given a changeset id, go ahead and look up the file
             self._changeid = changeid
             self._changectx = self.changectx()