This is an archive of the discontinued Mercurial Phabricator instance.

sparse: use set for capturing profiles
ClosedPublic

Authored by indygreg on Jul 15 2017, 5:11 PM.

Details

Summary

Order doesn't need to be preserved. A set is acceptable.

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

indygreg created this revision.Jul 15 2017, 5:11 PM
dsp accepted this revision.Jul 16 2017, 3:40 PM
dsp added a subscriber: dsp.

Looks good! Does it make sense to have a test that codifies that sorting doesn't matter? e.g. testing that two sparse profiles

a.sparse

[include]
[exclude]
x

b.sparse

[include]
x
[exclude]

yield the same result, no matter of the include order?

durin42 accepted this revision.Jul 17 2017, 1:52 PM
This revision is now accepted and ready to land.Jul 17 2017, 1:52 PM
martinvonz added inline comments.
mercurial/sparse.py
96

This can no longer happen. Will you or send a follow-up?

This revision was automatically updated to reflect the committed changes.
martinvonz added inline comments.Jul 17 2017, 6:26 PM
mercurial/sparse.py
96

Never mind, I didn't notice it expands the subprofiles and updated the profiles set in the loop, so the check is necessary.