filectx: _fileid isn't normalized, use _filenode instead stable
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Mon, 19 Apr 2010 20:30:31 +0200
branchstable
changeset 10942 6f26ce7ae175
parent 10940 898d68468df2
child 10943 15aaa3637f19
child 10944 6f1894d6a6b0
filectx: _fileid isn't normalized, use _filenode instead _fileid can be anything the lookup accepts (hex(node), node, rev, etc.), we should use something stable for comparisons (like _filenode).
mercurial/context.py
--- a/mercurial/context.py	Sun Apr 18 15:47:49 2010 +0200
+++ b/mercurial/context.py	Mon Apr 19 20:30:31 2010 +0200
@@ -276,14 +276,14 @@
 
     def __hash__(self):
         try:
-            return hash((self._path, self._fileid))
+            return hash((self._path, self._filenode))
         except AttributeError:
             return id(self)
 
     def __eq__(self, other):
         try:
             return (self._path == other._path
-                    and self._fileid == other._fileid)
+                    and self._filenode == other._filenode)
         except AttributeError:
             return False