This is an archive of the discontinued Mercurial Phabricator instance.

copies: explicitly filter out existing file in graftcopies
ClosedPublic

Authored by marmoute on Jan 15 2021, 8:23 PM.

Details

Summary

The graftcopies function does something very strange (maybe even wrong), it
calls _filter with a pair of changeset that does not match the one used to
compute the copies informations.

We are about to do some rework of _filter to make it closer to its documented
intent and fix a couple of bug. This means some of the logic that only make
sense for graft need to go somewhere else. We add the extra filtering with
proper documentation to graftcopies.

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.Jan 15 2021, 8:23 PM
baymax updated this revision to Diff 25105.Jan 18 2021, 8:54 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

baymax updated this revision to Diff 25264.Jan 26 2021, 1:31 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

pulkit accepted this revision.Jan 26 2021, 3:09 PM
This revision is now accepted and ready to land.Jan 26 2021, 3:09 PM
martinvonz added inline comments.
mercurial/copies.py
1225–1226

That sounds pretty bad (creating a filelog entry with two parents for a non-merge commit), even though I'm not sure what user-visible effect it would have. Could you add a test case demonstrating the bug?

marmoute added inline comments.Jan 28 2021, 2:35 AM
mercurial/copies.py
1225–1226

The coverage stayed the same. I am adding new code explicitly catching this before removing older code that handled this at a less adequate location.

martinvonz added inline comments.Jan 28 2021, 2:37 AM
mercurial/copies.py
1225–1226

Okay. Is there an existing test for it? Which one?

marmoute added inline comments.Jan 28 2021, 2:56 AM
mercurial/copies.py
1225–1226

They are tests related to graft dedicated to this kind of copy tracing dropping that fails, if we take change the other logic without adding this one.

I forgot which one exactly.

martinvonz added inline comments.Jan 28 2021, 3:05 AM
mercurial/copies.py
1225–1226

I'm guessing you meant test-rebase-rename.t. If that's correct, I don't think the comment here is correct. I'll send a patch to fix it.