comparison mercurial/helptext/internals/dirstate-v2.txt @ 48183:eb8092f9304f

dirstate-v2: Use "byte sequence" in docs The patch originally sent as https://phab.mercurial-scm.org/D11546 used "byte string" but that was changed during review to avoid suggesting Unicode or character encodings. However "byte range" sounds to be like a range of *indices* within a byte string/sequence elsewhere. This changes to "byte sequence". Python docs use "sequence" a lot when discussing the `bytes` type: https://docs.python.org/3/library/stdtypes.html Differential Revision: https://phab.mercurial-scm.org/D11623
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 11 Oct 2021 17:31:27 +0200
parents e8a576de703f
children 77fc340acad7
comparison
equal deleted inserted replaced
48182:01c3dd208c75 48183:eb8092f9304f
283 in inclusion order. This definition is recursive, as included files can 283 in inclusion order. This definition is recursive, as included files can
284 themselves include more files. 284 themselves include more files.
285 285
286 This hash is defined as the SHA-1 of the concatenation (in sorted 286 This hash is defined as the SHA-1 of the concatenation (in sorted
287 order) of the "expanded contents" of each "root" ignore file. 287 order) of the "expanded contents" of each "root" ignore file.
288 (Note that computing this does not require actually concatenating byte ranges into 288 (Note that computing this does not require actually concatenating
289 contiguous memory. 289 into a single contiguous byte sequence.
290 Instead a SHA-1 hasher object can be created and fed separate byte ranges one by 290 Instead a SHA-1 hasher object can be created
291 one.) 291 and fed separate chunks one by one.)
292 292
293 The data file format 293 The data file format
294 -------------------- 294 --------------------
295 295
296 This is implemented in `rust/hg-core/src/dirstate_tree/on_disk.rs` 296 This is implemented in `rust/hg-core/src/dirstate_tree/on_disk.rs`
297 and `mercurial/dirstateutils/v2.py`. 297 and `mercurial/dirstateutils/v2.py`.
298 298
299 The data file contains two types of data: paths and nodes. 299 The data file contains two types of data: paths and nodes.
300 300
301 Paths and nodes can be organized in any order in the file, except that sibling 301 Paths and nodes can be organized in any order in the file, except that sibling
302 nodes must be next to each other and sorted by their path. Contiguity lets 302 nodes must be next to each other and sorted by their path.
303 the parent refer to them all by their count with a single pseudo-pointer, 303 Contiguity lets the parent refer to them all
304 instead of storing one pseudo-pointer per child node. Sorting allows using 304 by their count and a single pseudo-pointer,
305 binary seach to find a child node with a given name in `O(log(n))` byte ranges 305 instead of storing one pseudo-pointer per child node.
306 comparisons. 306 Sorting allows using binary seach to find a child node with a given name
307 in `O(log(n))` byte sequence comparisons.
307 308
308 The current implemention writes paths and child node before a given node 309 The current implemention writes paths and child node before a given node
309 for ease of figuring out the value of pseudo-pointers by the time the are to be 310 for ease of figuring out the value of pseudo-pointers by the time the are to be
310 written, but this is not an obligation and readers must not rely on it. 311 written, but this is not an obligation and readers must not rely on it.
311 312