[PATCH 1 of 1] context: expensive cmp only when filename matches _encodefilterpats
Christian Ebert
blacktrash at gmx.net
Fri Oct 15 12:29:26 CDT 2010
# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1287163715 -7200
# Node ID e99f83c82307809d07b8868f58363a24dbfdd212
# Parent 4bca87c29445a6fb67aebe7eaed3f89c171cae41
context: expensive cmp only when filename matches _encodefilterpats
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -357,8 +357,14 @@
returns True if different than fctx.
"""
- if (fctx._filerev is None and self._repo._encodefilterpats
- or self.size() == fctx.size()):
+ filtermatch = False
+ if fctx._filerev is None and self._repo._encodefilterpats:
+ path = fctx.path()
+ for mf, fn, cmd in self._repo._encodefilterpats:
+ if mf(path):
+ filtermatch = True
+ break
+ if filtermatch or self.size() == fctx.size():
return self._filelog.cmp(self._filenode, fctx.data())
return True
More information about the Mercurial-devel
mailing list