This is an archive of the discontinued Mercurial Phabricator instance.

merge: use the new action based mapping introduced in mergeresult obj
ClosedPublic

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

Details

Summary

Before this patch, we have good number of instances of following types:

for f, (m, args, msg) in mresult.actions:
    if m == ACTION_X:
        do_something

We iterate over the whole list and then filter for a certain action. Previous
patch introduced a action based mapping in mergeresult object. The above code
now looks like:

for f, args, msg in mresult.getactions([ACTION_X, ...]):
    do_something

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:02 AM
indygreg accepted this revision.Aug 2 2020, 1:22 PM
indygreg added a subscriber: indygreg.

This is a nice cleanup and improves readability!

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