Mercurial > hg
comparison mercurial/metadata.py @ 45613:ddcee0b0fd67
changing-files: add a utility to compute the merged files post-commit
We will need it in `_getsidedata` as soon as we start persisting that set.
Differential Revision: https://phab.mercurial-scm.org/D9089
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 25 Sep 2020 11:29:19 +0200 |
parents | e5578dbe36cb |
children | 646a676f5365 |
comparison
equal
deleted
inserted
replaced
45612:094a91a183f1 | 45613:ddcee0b0fd67 |
---|---|
261 removed.append(f) | 261 removed.append(f) |
262 if removed: | 262 if removed: |
263 rf = get_removal_filter(ctx) | 263 rf = get_removal_filter(ctx) |
264 removed = [r for r in removed if not rf(r)] | 264 removed = [r for r in removed if not rf(r)] |
265 return removed | 265 return removed |
266 | |
267 | |
268 def computechangesetfilesmerged(ctx): | |
269 """return the list of files merged in a changeset | |
270 """ | |
271 merged = [] | |
272 if len(ctx.parents()) < 2: | |
273 return merged | |
274 for f in ctx.files(): | |
275 if f in ctx: | |
276 fctx = ctx[f] | |
277 parents = fctx._filelog.parents(fctx._filenode) | |
278 if parents[1] != node.nullid: | |
279 merged.append(f) | |
280 return merged | |
266 | 281 |
267 | 282 |
268 def computechangesetcopies(ctx): | 283 def computechangesetcopies(ctx): |
269 """return the copies data for a changeset | 284 """return the copies data for a changeset |
270 | 285 |