Page MenuHomePhabricator

changing-files: add clean computation of changed files for linear changesets
ClosedPublic

Authored by marmoute on Sep 30 2020, 9:11 AM.

Details

Summary

The files field is not reliable, so we need to compute things from scratch. We
deal with the second simplest case, linear changesets. We diff the current
manifest with the parent manifest. This reveal the file added, changed and
removed.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

marmoute created this revision.Sep 30 2020, 9:11 AM
marmoute updated this revision to Diff 22986.Oct 2 2020, 3:14 AM
marmoute updated this revision to Diff 22994.Oct 2 2020, 5:09 AM
Alphare accepted this revision.Oct 2 2020, 5:45 AM
Alphare added a subscriber: Alphare.

I think _process_linear is missing one or two inline comments because it's hard to read if you don't know the diff interface by heart, but otherwise it looks good.

mercurial/metadata.py
238

Fascinating

276

I understand that from a performance perspective this kind of indexing is good, but I think a comment on what d[1][0] is would improve readability by a lot.

marmoute updated this revision to Diff 23014.Oct 2 2020, 12:40 PM
pulkit accepted this revision.Oct 7 2020, 8:10 AM
This revision is now accepted and ready to land.Oct 7 2020, 8:10 AM