mercurial/context.py
changeset 15869 e5feebc1f3bb
parent 15822 d523b6e7ad26
parent 15848 012b285cf643
child 15895 933b9ff73750
--- a/mercurial/context.py	Fri Jan 13 11:29:40 2012 -0600
+++ b/mercurial/context.py	Fri Jan 13 11:29:53 2012 -0600
@@ -385,7 +385,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())