Show More
@@ -0,0 +1,80 b'' | |||
|
1 | The active mergestate is stored in ``.hg/merge`` when a merge is triggered | |
|
2 | by commands like ``hg merge``, ``hg rebase``, etc. until the merge is | |
|
3 | completed or aborted to track the 3-way merge state of individual files. | |
|
4 | ||
|
5 | The contents of the directory are: | |
|
6 | ||
|
7 | Conflicting files | |
|
8 | ----------------- | |
|
9 | ||
|
10 | The local version of the conflicting files are stored with their | |
|
11 | filenames as the hash of their paths. | |
|
12 | ||
|
13 | state | |
|
14 | ----- | |
|
15 | ||
|
16 | This mergestate file record is used by hg version prior to 2.9.1 | |
|
17 | and contains less data than ``state2``. If there is no contradiction | |
|
18 | with ``state2``, we can assume that both are written at the same time. | |
|
19 | In this case, data from ``state2`` is used. Otherwise, we use ``state``. | |
|
20 | We read/write both ``state`` and ``state2`` records to ensure backward | |
|
21 | compatibility. | |
|
22 | ||
|
23 | state2 | |
|
24 | ------ | |
|
25 | ||
|
26 | This record stores a superset of data in ``state``, including new kinds | |
|
27 | of records in the future. | |
|
28 | ||
|
29 | Each record can contain arbitrary content and has an associated type. This | |
|
30 | `type` should be a letter. If `type` is uppercase, the record is mandatory: | |
|
31 | versions of Mercurial that don't support it should abort. If `type` is | |
|
32 | lowercase, the record can be safely ignored. | |
|
33 | ||
|
34 | Currently known records: | |
|
35 | ||
|
36 | | * L: the node of the "local" part of the merge (hexified version) | |
|
37 | | * O: the node of the "other" part of the merge (hexified version) | |
|
38 | | * F: a file to be merged entry | |
|
39 | | * C: a change/delete or delete/change conflict | |
|
40 | | * D: a file that the external merge driver will merge internally | |
|
41 | | (experimental) | |
|
42 | | * P: a path conflict (file vs directory) | |
|
43 | | * m: the external merge driver defined for this merge plus its run state | |
|
44 | | (experimental) | |
|
45 | | * f: a (filename, dictionary) tuple of optional values for a given file | |
|
46 | | * X: unsupported mandatory record type (used in tests) | |
|
47 | | * x: unsupported advisory record type (used in tests) | |
|
48 | | * l: the labels for the parts of the merge. | |
|
49 | ||
|
50 | Merge driver run states (experimental): | |
|
51 | ||
|
52 | | * u: driver-resolved files unmarked -- needs to be run next time we're | |
|
53 | | about to resolve or commit | |
|
54 | | * m: driver-resolved files marked -- only needs to be run before commit | |
|
55 | | * s: success/skipped -- does not need to be run any more | |
|
56 | ||
|
57 | Merge record states (indexed by filename): | |
|
58 | ||
|
59 | | * u: unresolved conflict | |
|
60 | | * r: resolved conflict | |
|
61 | | * pu: unresolved path conflict (file conflicts with directory) | |
|
62 | | * pr: resolved path conflict | |
|
63 | | * d: driver-resolved conflict | |
|
64 | ||
|
65 | The resolve command transitions between 'u' and 'r' for conflicts and | |
|
66 | 'pu' and 'pr' for path conflicts. | |
|
67 | ||
|
68 | This format is a list of arbitrary records of the form: | |
|
69 | ||
|
70 | [type][length][content] | |
|
71 | ||
|
72 | `type` is a single character, `length` is a 4 byte integer, and | |
|
73 | `content` is an arbitrary byte sequence of length `length`. | |
|
74 | ||
|
75 | Mercurial versions prior to 3.7 have a bug where if there are | |
|
76 | unsupported mandatory merge records, attempting to clear out the merge | |
|
77 | state with hg update --clean or similar aborts. The 't' record type | |
|
78 | works around that by writing out what those versions treat as an | |
|
79 | advisory record, but later versions interpret as special: the first | |
|
80 | character is the 'real' record type and everything onwards is the data. |
@@ -49,6 +49,7 b'' | |||
|
49 | 49 | <File Id="internals.config.txt" Name="config.txt" /> |
|
50 | 50 | <File Id="internals.extensions.txt" Name="extensions.txt" /> |
|
51 | 51 | <File Id="internals.linelog.txt" Name="linelog.txt" /> |
|
52 | <File Id="internals.mergestate.txt" Name="mergestate.txt" /> | |
|
52 | 53 | <File Id="internals.requirements.txt" Name="requirements.txt" /> |
|
53 | 54 | <File Id="internals.revlogs.txt" Name="revlogs.txt" /> |
|
54 | 55 | <File Id="internals.wireprotocol.txt" Name="wireprotocol.txt" /> |
@@ -320,6 +320,8 b' internalstable = sorted([' | |||
|
320 | 320 | loaddoc('config', subdir='internals')), |
|
321 | 321 | (['extensions', 'extension'], _('Extension API'), |
|
322 | 322 | loaddoc('extensions', subdir='internals')), |
|
323 | (['mergestate'], _('Mergestate'), | |
|
324 | loaddoc('mergestate', subdir='internals')), | |
|
323 | 325 | (['requirements'], _('Repository Requirements'), |
|
324 | 326 | loaddoc('requirements', subdir='internals')), |
|
325 | 327 | (['revlogs'], _('Revision Logs'), |
@@ -1082,6 +1082,7 b' internals topic renders index of availab' | |||
|
1082 | 1082 | changegroups Changegroups |
|
1083 | 1083 | config Config Registrar |
|
1084 | 1084 | extensions Extension API |
|
1085 | mergestate Mergestate | |
|
1085 | 1086 | requirements Repository Requirements |
|
1086 | 1087 | revlogs Revision Logs |
|
1087 | 1088 | wireprotocol Wire Protocol |
@@ -3440,6 +3441,13 b' Sub-topic indexes rendered properly' | |||
|
3440 | 3441 | Extension API |
|
3441 | 3442 | </td></tr> |
|
3442 | 3443 | <tr><td> |
|
3444 | <a href="/help/internals.mergestate"> | |
|
3445 | mergestate | |
|
3446 | </a> | |
|
3447 | </td><td> | |
|
3448 | Mergestate | |
|
3449 | </td></tr> | |
|
3450 | <tr><td> | |
|
3443 | 3451 | <a href="/help/internals.requirements"> |
|
3444 | 3452 | requirements |
|
3445 | 3453 | </a> |
General Comments 0
You need to be logged in to leave comments.
Login now