This is an archive of the discontinued Mercurial Phabricator instance.

commitctx: extract the function in a dedicated module
ClosedPublic

Authored by marmoute on Jul 8 2020, 4:37 AM.

Details

Summary

the function have few callers (< 15) is quite long a mostly independent from the
repository itself. It seems like a good candidate to reduce the bloatness of the
localrepository class. Extracting it will help us cleaning the code up and
splitting it into more reasonable-size function.

We don't use a copy trick because the amount of code extract is quite small
(<5%) and the de-indent means every single line change anyway. So this is not
deemed valuable to do so.

This is part of a larger refactoring/cleanup of the commitctx code to clarify
and augment the logic gathering metadata useful for copy tracing. The current
code is a tad too long and entangled to make such update easy.

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

marmoute created this revision.Jul 8 2020, 4:37 AM
pulkit added a subscriber: pulkit.Jul 9 2020, 4:42 AM
pulkit added inline comments.
mercurial/commit.py
2

Seems like you wanted to make the filename commitutils.py.

(reply written ages ago)

mercurial/commit.py
2

nah, I want to update the comment to same commit.py ;-)

marmoute updated this revision to Diff 21991.Jul 20 2020, 12:50 PM
pulkit accepted this revision.Jul 22 2020, 7:37 AM
This revision is now accepted and ready to land.Jul 22 2020, 7:37 AM
This revision was automatically updated to reflect the committed changes.