annotate mercurial/helptext/internals/mergestate.txt @ 43833:19da643dc10c

tests: finally fix up test-fuzz-targets.t It's been failing on my workstation for a while, since I have a new enough LLVM that I had the fuzzer goo, but not so new that I actually had FuzzedDataProvider. This is a better solution all around in my opinion. I _believe_ this should let us run these tests on most systems, even those using GCC instead of clang. That said, my one attempt to test this on my macOS laptop failed miserably, and I don't feel like doing more work on this right now. Differential Revision: https://phab.mercurial-scm.org/D7566
author Augie Fackler <augie@google.com>
date Fri, 06 Dec 2019 15:08:37 -0500
parents 2e017696181f
children 32ce4cbaec4b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
42466
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
1 The active mergestate is stored in ``.hg/merge`` when a merge is triggered
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
2 by commands like ``hg merge``, ``hg rebase``, etc. until the merge is
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
3 completed or aborted to track the 3-way merge state of individual files.
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
4
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
5 The contents of the directory are:
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
6
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
7 Conflicting files
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
8 -----------------
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
9
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
10 The local version of the conflicting files are stored with their
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
11 filenames as the hash of their paths.
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
12
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
13 state
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
14 -----
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
15
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
16 This mergestate file record is used by hg version prior to 2.9.1
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
17 and contains less data than ``state2``. If there is no contradiction
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
18 with ``state2``, we can assume that both are written at the same time.
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
19 In this case, data from ``state2`` is used. Otherwise, we use ``state``.
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
20 We read/write both ``state`` and ``state2`` records to ensure backward
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
21 compatibility.
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
22
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
23 state2
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
24 ------
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
25
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
26 This record stores a superset of data in ``state``, including new kinds
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
27 of records in the future.
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
28
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
29 Each record can contain arbitrary content and has an associated type. This
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
30 `type` should be a letter. If `type` is uppercase, the record is mandatory:
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
31 versions of Mercurial that don't support it should abort. If `type` is
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
32 lowercase, the record can be safely ignored.
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
33
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
34 Currently known records:
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
35
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
36 | * L: the node of the "local" part of the merge (hexified version)
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
37 | * O: the node of the "other" part of the merge (hexified version)
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
38 | * F: a file to be merged entry
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
39 | * C: a change/delete or delete/change conflict
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
40 | * D: a file that the external merge driver will merge internally
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
41 | (experimental)
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
42 | * P: a path conflict (file vs directory)
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
43 | * m: the external merge driver defined for this merge plus its run state
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
44 | (experimental)
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
45 | * f: a (filename, dictionary) tuple of optional values for a given file
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
46 | * X: unsupported mandatory record type (used in tests)
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
47 | * x: unsupported advisory record type (used in tests)
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
48 | * l: the labels for the parts of the merge.
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
49
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
50 Merge driver run states (experimental):
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
51
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
52 | * u: driver-resolved files unmarked -- needs to be run next time we're
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
53 | about to resolve or commit
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
54 | * m: driver-resolved files marked -- only needs to be run before commit
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
55 | * s: success/skipped -- does not need to be run any more
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
56
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
57 Merge record states (indexed by filename):
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
58
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
59 | * u: unresolved conflict
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
60 | * r: resolved conflict
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
61 | * pu: unresolved path conflict (file conflicts with directory)
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
62 | * pr: resolved path conflict
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
63 | * d: driver-resolved conflict
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
64
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
65 The resolve command transitions between 'u' and 'r' for conflicts and
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
66 'pu' and 'pr' for path conflicts.
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
67
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
68 This format is a list of arbitrary records of the form:
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
69
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
70 [type][length][content]
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
71
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
72 `type` is a single character, `length` is a 4 byte integer, and
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
73 `content` is an arbitrary byte sequence of length `length`.
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
74
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
75 Mercurial versions prior to 3.7 have a bug where if there are
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
76 unsupported mandatory merge records, attempting to clear out the merge
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
77 state with hg update --clean or similar aborts. The 't' record type
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
78 works around that by writing out what those versions treat as an
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
79 advisory record, but later versions interpret as special: the first
9d31581cc44e help: add help entry for internals.mergestate
Navaneeth Suresh <navaneeths1998@gmail.com>
parents:
diff changeset
80 character is the 'real' record type and everything onwards is the data.