Page MenuHomePhabricator

mergestate: split up reset() for its two use cases
ClosedPublic

Authored by martinvonz on Sep 17 2020, 4:10 PM.

Details

Summary

We only have one place that calls ms.reset() with any
arguments. That place is mergestate.clean(). The callers that call
the function with no arguments seem to all just want delete the
mergestate -- none of them look at the instance after calling
reset(). Let's separate out the two different use cases to make the
code clearer. I'll clean up further soon.

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

martinvonz created this revision.Sep 17 2020, 4:10 PM
indygreg accepted this revision.Sep 17 2020, 10:16 PM
indygreg added a subscriber: indygreg.
indygreg added inline comments.
mercurial/mergestate.py
205

It is slightly weird to me that reset() doesn't wipe out these attributes after this change. Shouldn't a reset... reset to default state (None)?

This revision is now accepted and ready to land.Sep 17 2020, 10:16 PM
This revision was automatically updated to reflect the committed changes.