Mercurial > hg
changeset 3454:23ede9e7ad4d
filecontext: report False for missing files
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 18 Oct 2006 14:06:48 -0500 |
parents | dba3cadef789 |
children | baa271270829 |
files | mercurial/context.py |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Wed Oct 18 11:44:56 2006 -0500 +++ b/mercurial/context.py Wed Oct 18 14:06:48 2006 -0500 @@ -151,7 +151,10 @@ if '_fileid' in self.__dict__: self._filenode = self._filelog.lookup(self._fileid) else: - self._filenode = self._changectx.filenode(self._path) + try: + self._filenode = self._changectx.filenode(self._path) + except: + self._filenode = self._filerev = None except revlog.RevlogError, inst: raise repo.LookupError(str(inst)) return self._filenode @@ -162,7 +165,7 @@ raise AttributeError, name def __nonzero__(self): - return self._filerev != nullid + return self._filenode != None def __str__(self): return "%s@%s" % (self.path(), short(self.node()))