diff mercurial/context.py @ 12709:4147a292c508

filectx: use ctx.size comparisons to speed up ctx.cmp Comparing sizes is cheaper than comparing file contents, as it does not involve reading the file on disk or from the filelog. It is however not always possible: some extensions, or encode filters, change data when extracting it to the working directory.
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Tue, 27 Jul 2010 23:07:30 +0900
parents 2754c8273132
children 95514b58709d
line wrap: on
line diff
--- a/mercurial/context.py	Sun Oct 10 18:58:45 2010 +0200
+++ b/mercurial/context.py	Tue Jul 27 23:07:30 2010 +0900
@@ -357,6 +357,9 @@
 
         returns True if different than fctx.
         """
+        if not self._repo._encodefilterpats and self.size() != fctx.size():
+            return True
+
         return self._filelog.cmp(self._filenode, fctx.data())
 
     def renamed(self):