Comments
Patch
@@ -445,10 +445,18 @@
@propertycache
def _repopath(self):
return self._path
+ def __nonzero__(self):
+ try:
+ self._filenode
+ return True
+ except error.LookupError:
+ # file is missing
+ return False
+
class filectx(basefilectx):
"""A filecontext object makes access to data related to a particular
filerevision convenient."""
def __init__(self, repo, path, changeid=None, fileid=None,
filelog=None, changectx=None):
@@ -494,18 +502,10 @@
# Linkrevs have several serious troubles with filtering that are
# complicated to solve. Proper handling of the issue here should be
# considered when solving linkrev issue are on the table.
return changectx(self._repo.unfiltered(), self._changeid)
- def __nonzero__(self):
- try:
- self._filenode
- return True
- except error.LookupError:
- # file is missing
- return False
-
def __str__(self):
return "%s@%s" % (self.path(), short(self.node()))
def __repr__(self):
return "<filectx %s>" % str(self)