# HG changeset patch # User Raphaël Gomès # Date 2022-11-04 18:52:16 # Node ID 5743e19bb8b0636f6458e92df9ea9f9282454022 # Parent 3556f039280882232ed3800ff09806c1ca3e0794 dirstate-v2: update constant that wasn't kept in sync Despite the best efforts of the comment, this constant wasn't kept in sync when the flags were being rewritten. The fact that this doesn't actually break anything in the Rust implementation too much (which does use directories) relies on the fact that all nodes can have children and that dirstate traversal is not based on that flag, but for metadata in optimizations. However the bug could become more serious should we start encoding stronger guarantees using a combination of flags including this one. diff --git a/mercurial/dirstateutils/v2.py b/mercurial/dirstateutils/v2.py --- a/mercurial/dirstateutils/v2.py +++ b/mercurial/dirstateutils/v2.py @@ -56,7 +56,7 @@ assert TREE_METADATA_SIZE == TREE_METADA assert NODE_SIZE == NODE.size # match constant in mercurial/pure/parsers.py -DIRSTATE_V2_DIRECTORY = 1 << 5 +DIRSTATE_V2_DIRECTORY = 1 << 13 def parse_dirstate(map, copy_map, data, tree_metadata):