[Request] [+ ] D9089: changing-files: add a utility to compute the merged files post-commit

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Sat Sep 26 12:10:12 UTC 2020


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

REVISION SUMMARY
  We will need it in `_getsidedata` as soon as we start persisting that set.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/metadata.py

CHANGE DETAILS

diff --git a/mercurial/metadata.py b/mercurial/metadata.py
--- a/mercurial/metadata.py
+++ b/mercurial/metadata.py
@@ -265,6 +265,21 @@
     return removed
 
 
+def computechangesetfilesmerged(ctx):
+    """return the list of files merged in a changeset
+    """
+    merged = []
+    if len(ctx.parents()) < 2:
+        return merged
+    for f in ctx.files():
+        if f in ctx:
+            fctx = ctx[f]
+            parents = fctx._filelog.parents(fctx._filenode)
+            if parents[1] != node.nullid:
+                merged.append(f)
+    return merged
+
+
 def computechangesetcopies(ctx):
     """return the copies data for a changeset
 



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/20200926/c3c57ba3/attachment.html>


More information about the Mercurial-patches mailing list