This is an archive of the discontinued Mercurial Phabricator instance.

context: only bother looking for broken dirstate for 20-byte changeid
ClosedPublic

Authored by martinvonz on May 6 2018, 12:50 AM.

Details

Summary

If we fail to look up a changeid in changectx.init, we check if it
exactly matches any of the dirstate parents, and if it does, we print
a more specific message ("working directory has unknown parent '...'!"
instead of "unknown revision '...'"). The dirstate parents are always
20 bytes, so there's no need to check for a match when the given
changeid is not 20 bytes. (And now that all the other allowed forms of
changeid have been moved out of the constructor, there's no risk that
a changeid that did match a dirstate parent was actually a valid
bookmark.)

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.