This is an archive of the discontinued Mercurial Phabricator instance.

mergeresult: make actionmapping a dict of dict instead of dict of lists
ClosedPublic

Authored by pulkit on Jul 25 2020, 6:03 AM.

Details

Summary

This makes deleting a specific filename entry faster and easier.

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

pulkit created this revision.Jul 25 2020, 6:03 AM
indygreg accepted this revision.Aug 2 2020, 1:35 PM
indygreg added a subscriber: indygreg.
indygreg added inline comments.
mercurial/merge.py
597

Having the separate index is useful and I think the new refactored data structure in this patch is better. But I still don't like having the (data, message) stored redundantly, as it introduces a synchronization problem.

What do you think about changing self._actionmapping to be a dict of sets of filenames. The main reason not to do this would be if the extra dict lookup in self._filemapping to retrieve (data, message) adds overhead. The many callers of getactions() could be performance sensitive, I'm not sure...

This revision is now accepted and ready to land.Aug 2 2020, 1:35 PM