[Updated] D8700: commitctx: document a fast path in _filecommit

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Mon Jul 20 16:51:01 UTC 2020


marmoute updated this revision to Diff 21984.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8700?vs=21797&id=21984

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8700/new/

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
@@ -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)



To: marmoute, #hg-reviewers, durin42
Cc: durin42, pulkit, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200720/badc9286/attachment-0002.html>


More information about the Mercurial-patches mailing list