[PATCH 46 of 48 RFC] commitablefilectx: move __nonzero__ from workingfilectx

Sean Farley sean.michael.farley at gmail.com
Thu Sep 5 15:07:40 CDT 2013


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1376590986 18000
#      Thu Aug 15 13:23:06 2013 -0500
# Node ID 2d2d9d92a1d104410d6ba7d29517d7d6f311eecd
# Parent  abc3acd32a7860c73680d15cecf525ec1cca0b8a
commitablefilectx: move __nonzero__ from workingfilectx

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1200,23 +1200,23 @@
         if filelog is not None:
             self._filelog = filelog
         if ctx:
             self._changectx = ctx
 
+    def __nonzero__(self):
+        return True
+
 class workingfilectx(commitablefilectx):
     """A workingfilectx object makes access to data related to a particular
        file in the working directory convenient."""
     def __init__(self, repo, path, filelog=None, workingctx=None):
         super(workingfilectx, self).__init__(repo, path, filelog, workingctx)
 
     @propertycache
     def _changectx(self):
         return workingctx(self._repo)
 
-    def __nonzero__(self):
-        return True
-
     def data(self):
         return self._repo.wread(self._path)
     def renamed(self):
         rp = self._repo.dirstate.copied(self._path)
         if not rp:


More information about the Mercurial-devel mailing list