Page MenuHomePhabricator

uncommit: unify functions _uncommitdirstate and _unamenddirstate to one
ClosedPublic

Authored by pulkit on Oct 5 2017, 6:59 PM.

Details

Summary

The _unamenddirstate() function was inspired by _uncommitdirstate() function as
the logic was same but we were unable to use the latter function directly. So
previous patch introduced the _unamenddirstate() function and now this patch
unifies both the function and we have a _fixdirstate() function.

Adding function in previous patch and unifying in a later patch makes the
reasoning easier and also leaves the last patch dedicated to what it is meant to
be.

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.Oct 5 2017, 6:59 PM
mbthomas accepted this revision.Nov 7 2017, 10:12 AM
pulkit updated this revision to Diff 3422.Nov 11 2017, 9:11 AM
durin42 accepted this revision as: durin42.

(Marking accepted, but consider just moving this to scmutil or rewriteutil (I made that second one up, but it might be a sensible thing to have?) in parallel with the inevitable bikeshedding over on D821.

hgext/uncommit.py
101–103

This looks like it should be a utility method in core. I think @martinvonz or @hooper ran into a case where this would have been helpful.

In D971#22932, @durin42 wrote:

(Marking accepted, but consider just moving this to scmutil or rewriteutil (I made that second one up, but it might be a sensible thing to have?) in parallel with the inevitable bikeshedding over on D821.

rewriteutil sounds good. This aligns with our plans of moving evolve to core and I will do that.

pulkit updated this revision to Diff 3672.Nov 20 2017, 3:04 PM
This revision was automatically updated to reflect the committed changes.
This comment was removed by taapas1128.