diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2805,6 +2805,12 @@ fparent1 = manifest1.get(fname, nullid) fparent2 = manifest2.get(fname, nullid) if isinstance(fctx, context.filectx): + # This block fast path most comparison usually done, It is making + # the assumption that a bare filectx is used, and that no merge + # happened on this file. + # + # It assume they are no need to a create a new file revision in + # this case. node = fctx.filenode() if node in [fparent1, fparent2]: self.ui.debug(b'reusing %s filelog entry\n' % fname)