This is an archive of the discontinued Mercurial Phabricator instance.

commitctx: return "touched" status from _filecommit
ClosedPublic

Authored by marmoute on Jul 8 2020, 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
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

marmoute created this revision.Jul 8 2020, 4:36 AM
pulkit accepted this revision.Jul 21 2020, 10:28 AM
This revision is now accepted and ready to land.Jul 21 2020, 10:28 AM
pulkit added inline comments.Jul 21 2020, 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.Jul 21 2020, 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.