mercurial/context.py
branchstable
changeset 15848 012b285cf643
parent 15337 cf5f9df6406b
child 15869 e5feebc1f3bb
child 15872 a3e2b9a1f063
--- a/mercurial/context.py	Wed Jan 11 09:26:47 2012 -0600
+++ b/mercurial/context.py	Thu Jan 12 00:49:45 2012 +0900
@@ -368,7 +368,11 @@
 
         returns True if different than fctx.
         """
-        if (fctx._filerev is None and self._repo._encodefilterpats
+        if (fctx._filerev is None
+            and (self._repo._encodefilterpats
+                 # if file data starts with '\1\n', empty metadata block is
+                 # prepended, which adds 4 bytes to fielog.size().
+                 or self.size() - 4 == fctx.size())
             or self.size() == fctx.size()):
             return self._filelog.cmp(self._filenode, fctx.data())