This is an archive of the discontinued Mercurial Phabricator instance.

merge: rework iteration over mergeresult object in checkpathconflicts()
ClosedPublic

Authored by pulkit on Aug 5 2020, 4:53 AM.

Details

Summary

Instead of following pattern:

for f, (m, args, msg) in mresult.actions.items():

    if m == mergestatemod.ACTION_*:
        ...
    elif m == mergestatemod.ACTION_*:
        ...
    ....

We do:

for (f, args, msg) in mresult.getaction((mergestatemod.ACTION_*,)):
    ...

for (f, args, msg) in mresult.getaction((mergestatemod.ACTION_*,)):
    ...
....

This makes code bit easier to understand and prevent iterating over actions
which we don't need.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage