mercurial/dirstateutils/v2.py
changeset 48264 bb240915f69f
parent 48263 83d0bd45b662
child 48392 434de12918fd
child 48741 46d12f7762e4
equal deleted inserted replaced
48263:83d0bd45b662 48264:bb240915f69f
    54 
    54 
    55 
    55 
    56 assert TREE_METADATA_SIZE == TREE_METADATA.size
    56 assert TREE_METADATA_SIZE == TREE_METADATA.size
    57 assert NODE_SIZE == NODE.size
    57 assert NODE_SIZE == NODE.size
    58 
    58 
       
    59 # match constant in mercurial/pure/parsers.py
       
    60 DIRSTATE_V2_DIRECTORY = 1 << 5
       
    61 
    59 
    62 
    60 def parse_dirstate(map, copy_map, data, tree_metadata):
    63 def parse_dirstate(map, copy_map, data, tree_metadata):
    61     """parse a full v2-dirstate from a binary data into dictionnaries:
    64     """parse a full v2-dirstate from a binary data into dictionnaries:
    62 
    65 
    63     - map: a {path: entry} mapping that will be filled
    66     - map: a {path: entry} mapping that will be filled
    81     """parse <len> nodes from <data> starting at offset <start>
    84     """parse <len> nodes from <data> starting at offset <start>
    82 
    85 
    83     This is used by parse_dirstate to recursively fill `map` and `copy_map`.
    86     This is used by parse_dirstate to recursively fill `map` and `copy_map`.
    84 
    87 
    85     All directory specific information is ignored and do not need any
    88     All directory specific information is ignored and do not need any
    86     processing (HAS_DIRECTORY_MTIME, ALL_UNKNOWN_RECORDED, ALL_IGNORED_RECORDED)
    89     processing (DIRECTORY, ALL_UNKNOWN_RECORDED, ALL_IGNORED_RECORDED)
    87     """
    90     """
    88     for i in range(len):
    91     for i in range(len):
    89         node_start = start + NODE_SIZE * i
    92         node_start = start + NODE_SIZE * i
    90         node_bytes = slice_with_len(data, node_start, NODE_SIZE)
    93         node_bytes = slice_with_len(data, node_start, NODE_SIZE)
    91         (
    94         (
   148             copy_source_len = 0
   151             copy_source_len = 0
   149         if entry is not None:
   152         if entry is not None:
   150             flags, size, mtime_s, mtime_ns = entry.v2_data()
   153             flags, size, mtime_s, mtime_ns = entry.v2_data()
   151         else:
   154         else:
   152             # There are no mtime-cached directories in the Python implementation
   155             # There are no mtime-cached directories in the Python implementation
   153             flags = 0
   156             flags = DIRSTATE_V2_DIRECTORY
   154             size = 0
   157             size = 0
   155             mtime_s = 0
   158             mtime_s = 0
   156             mtime_ns = 0
   159             mtime_ns = 0
   157         return NODE.pack(
   160         return NODE.pack(
   158             path_start,
   161             path_start,