[Request] [+ ] D8700: commitctx: document a fast path in _filecommit

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Wed Jul 8 08:37:21 UTC 2020


marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This block cut off a lot of logic, documenting the why and how seems useful to
  future reader.
  
  This is part of a larger refactoring/cleanup of the commitctx code to clarify
  and augment the logic gathering metadata useful for copy tracing. The current
  code is a tad too long and entangled to make such update easy. We start with
  easy and small cleanup.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8700

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2808,6 +2808,11 @@
         fparent1 = manifest1.get(fname, nullid)
         fparent2 = manifest2.get(fname, nullid)
         if isinstance(fctx, context.filectx):
+            # This block fast path most comparison, making the assumption that
+            # is a bare filectx is used, no merge happened on this file., and
+            # therefor they are chance of needing to a create a new file
+            # revision, even if the content was identical to one of the
+            # parents.
             node = fctx.filenode()
             if node in [fparent1, fparent2]:
                 self.ui.debug(b'reusing %s filelog entry\n' % fname)



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200708/34eaefe2/attachment.html>


More information about the Mercurial-patches mailing list