( )⚙ D10927 dirstate: introduce a symbolic constant for the NONNORMAL marker

This is an archive of the discontinued Mercurial Phabricator instance.

dirstate: introduce a symbolic constant for the NONNORMAL marker
ClosedPublic

Authored by marmoute on Jul 2 2021, 11:17 AM.

Details

Summary

This is going to be clearer and easier to track than -1. Ultimately I would
like to get ride of this special value everywhere but in the lower level,
however we need to clarify the API first. This changeset is part of such
clarification.

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 2 2021, 11:17 AM

+1 for having a named constant but I’m not sure about the NONNORMAL name. For example this size == -1 is also used together with state == 'r' (removed) where it means "was previously state == 'm' (merged)". The other use is in dirstate.normallookup "Mark a file normal, but possibly dirty" together with state == 'n', which does not match the constant’s doc-comment.

+1 for having a named constant but I’m not sure about the NONNORMAL name. For example this size == -1 is also used together with state == 'r' (removed) where it means "was previously state == 'm' (merged)". The other use is in dirstate.normallookup "Mark a file normal, but possibly dirty" together with state == 'n', which does not match the constant’s doc-comment.

The name is not great, but I don't have a much better idea and the ultimate goal of this series is make it disapear, so I am not too worried about bad name.

SimonSapin accepted this revision.Jul 2 2021, 6:24 PM

Sounds good

pulkit accepted this revision.Jul 3 2021, 7:39 AM
This revision is now accepted and ready to land.Jul 3 2021, 7:39 AM