This is an archive of the discontinued Mercurial Phabricator instance.

copies: correctly skip directories that have already been considered
ClosedPublic

Authored by spectral on Aug 15 2018, 5:47 PM.

Details

Summary

Previously, if dsrc in invalid would never be true, since we added
dsrc +"/" to invalid, not dsrc itself. Since it's much more common for
individual files (not whole directories) to be moved, it seemed cleaner to
delay appending the "/" until we know we have some directory moves to
actually consider.

I haven't benchmarked this, but I imagine this is a mild performance win.

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

spectral created this revision.Aug 15 2018, 5:47 PM
spectral edited the summary of this revision. (Show Details)Aug 23 2018, 5:08 PM
jpsugar added inline comments.
mercurial/copies.py
615

Maybe do this after the debug loop to avoid an un-pretty output?

spectral added inline comments.Aug 24 2018, 4:35 PM
mercurial/copies.py
615

I personally have no preference, but had been trying to make this an unobservable difference, whereas that is technically observable (though I doubt anything is relying on this particular one, we have had reports of tooling like one of the IDEs depending on the format of some of our debug messages in the past)

Asking martinvonz in person, they prefer the slashes on the end to more strongly indicate that this is a directory, especially in the debug messages (which most people will never see).

martinvonz accepted this revision.Aug 24 2018, 4:52 PM
This revision is now accepted and ready to land.Aug 24 2018, 4:52 PM
This revision was automatically updated to reflect the committed changes.