changeset 12731:95514b58709d

context: narrow down filter special case in filectx.cmp() cmp via filelog when encode filters are present, but only when actually comparing to the working directory.
author Christian Ebert <blacktrash@gmx.net>
date Thu, 14 Oct 2010 22:47:50 +0200
parents 33e1fd2aeb3c
children 4bca87c29445
files mercurial/context.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Thu Oct 14 21:36:00 2010 +0200
+++ b/mercurial/context.py	Thu Oct 14 22:47:50 2010 +0200
@@ -357,10 +357,11 @@
 
         returns True if different than fctx.
         """
-        if not self._repo._encodefilterpats and self.size() != fctx.size():
-            return True
+        if (fctx._filerev is None and self._repo._encodefilterpats
+            or self.size() == fctx.size()):
+            return self._filelog.cmp(self._filenode, fctx.data())
 
-        return self._filelog.cmp(self._filenode, fctx.data())
+        return True
 
     def renamed(self):
         """check if file was actually renamed in this changeset revision