This is an archive of the discontinued Mercurial Phabricator instance.

mergeresult: introduce getfile() and use it where required
ClosedPublic

Authored by pulkit on Aug 5 2020, 8:11 AM.

Details

Summary

We want to hide the underlying dictionary from the users and provide API for
valid and sane use cases.

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.Aug 5 2020, 8:11 AM
pulkit updated this revision to Diff 22307.Aug 6 2020, 7:16 AM
indygreg accepted this revision.Aug 8 2020, 12:30 PM
indygreg added a subscriber: indygreg.
indygreg added inline comments.
mercurial/merge.py
622

This pattern is better expressed as self._filemapping.get(filename, default_return) since it avoids an extra lookup.

Please submit a follow-up if you think this code is performance sensitive.

This revision is now accepted and ready to land.Aug 8 2020, 12:30 PM