changeset 19578:2c149635c2c5

basefilectx: move __nonzero__ from filectx
author Sean Farley <sean.michael.farley@gmail.com>
date Sun, 11 Aug 2013 22:45:13 -0500
parents b52d572a2177
children 964844d64ef8
files mercurial/context.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Sun Aug 11 22:44:51 2013 -0500
+++ b/mercurial/context.py	Sun Aug 11 22:45:13 2013 -0500
@@ -447,6 +447,14 @@
     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."""
@@ -496,14 +504,6 @@
             # 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()))