changeset 19581:fe50d21be01a

basefilectx: move __hash__ from filectx
author Sean Farley <sean.michael.farley@gmail.com>
date Sun, 11 Aug 2013 22:47:39 -0500
parents e86a594ab11f
children bda1d48bb07f
files mercurial/context.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Sun Aug 11 22:46:54 2013 -0500
+++ b/mercurial/context.py	Sun Aug 11 22:47:39 2013 -0500
@@ -461,6 +461,12 @@
     def __repr__(self):
         return "<%s %s>" % (type(self).__name__, str(self))
 
+    def __hash__(self):
+        try:
+            return hash((self._path, self._filenode))
+        except AttributeError:
+            return id(self)
+
 class filectx(basefilectx):
     """A filecontext object makes access to data related to a particular
        filerevision convenient."""
@@ -510,12 +516,6 @@
             # considered when solving linkrev issue are on the table.
             return changectx(self._repo.unfiltered(), self._changeid)
 
-    def __hash__(self):
-        try:
-            return hash((self._path, self._filenode))
-        except AttributeError:
-            return id(self)
-
     def __eq__(self, other):
         try:
             return (self._path == other._path