Page MenuHomePhabricator

commitctx: return "touched" status from _filecommit
ClosedPublic

Authored by marmoute on Wed, Jul 8, 4:36 AM.

Details

Summary

Instead of mutating a list passed in argument, we simply return the information
from the _filecommit function. This make for a cleaner API and allow for
richer information to be returned. That richer information will be used in the
next commit to avoid duplicated computation.

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. We start with
easy and small cleanup.

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.Wed, Jul 8, 4:36 AM
pulkit accepted this revision.Tue, Jul 21, 10:28 AM
This revision is now accepted and ready to land.Tue, Jul 21, 10:28 AM
pulkit added inline comments.Tue, Jul 21, 10:39 AM
mercurial/localrepo.py
2794

Can you followup with documenting what None value for touched means?

2802

A nice followup will be to have some constants for these couple of strings.

marmoute added inline comments.Tue, Jul 21, 11:35 AM
mercurial/localrepo.py
2794

None means the file is not affected by the commit.

2802

I considered that, but since the value are not going anywhere (simple single producer, simple single consumer) I considered overkill. Do you think we should get some constant anyway ?

This revision was automatically updated to reflect the committed changes.