##// END OF EJS Templates
filectx: use ctx.size comparisons to speed up ctx.cmp...
Nicolas Dumazet -
r12709:4147a292 default
parent child Browse files
Show More
@@ -82,7 +82,7 b" like CVS' $Log$, are not supported. A ke"
82 82 {desc}" expands to the first line of the changeset description.
83 83 '''
84 84
85 from mercurial import commands, cmdutil, dispatch, filelog, extensions
85 from mercurial import commands, context, cmdutil, dispatch, filelog, extensions
86 86 from mercurial import localrepo, match, patch, templatefilters, templater, util
87 87 from mercurial.hgweb import webcommands
88 88 from mercurial.i18n import _
@@ -586,6 +586,12 b' def reposetup(ui, repo):'
586 586
587 587 repo.__class__ = kwrepo
588 588
589 def kwfilectx_cmp(orig, self, fctx):
590 # keyword affects data size, comparing wdir and filelog size does
591 # not make sense
592 return self._filelog.cmp(self._filenode, fctx.data())
593 extensions.wrapfunction(context.filectx, 'cmp', kwfilectx_cmp)
594
589 595 extensions.wrapfunction(patch.patchfile, '__init__', kwpatchfile_init)
590 596 extensions.wrapfunction(patch, 'diff', kw_diff)
591 597 extensions.wrapfunction(cmdutil, 'copy', kw_copy)
@@ -357,6 +357,9 b' class filectx(object):'
357 357
358 358 returns True if different than fctx.
359 359 """
360 if not self._repo._encodefilterpats and self.size() != fctx.size():
361 return True
362
360 363 return self._filelog.cmp(self._filenode, fctx.data())
361 364
362 365 def renamed(self):
General Comments 0
You need to be logged in to leave comments. Login now