This is an archive of the discontinued Mercurial Phabricator instance.

merge: remove emptyactions() and use collections.defaultdict(list) instead
ClosedPublic

Authored by pulkit on Aug 6 2020, 7:17 AM.

Details

Summary

emptyactions() used to return a dict which was populated and passed into
applyupdates(). However, with recent changes, we no longer pass a plain dict,
instead we pass the mergeresult object.

There was only one usage of emptyactions and that too inside mergeresult object.
That usage is replaced with collections.defaultdict(list) instead.

Not sure why we were not using collections.defaultdict(list) from the beginning.

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 6 2020, 7:17 AM
indygreg accepted this revision.Aug 8 2020, 12:36 PM
indygreg added a subscriber: indygreg.

I guess we lose some typing as part of this change. But that only guards against unknown actions, which I suppose shouldn't happen.

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