##// END OF EJS Templates
mergestate: move binary format documentation into _readrecordsv2...
Siddharth Agarwal -
r27022:35102876 default
parent child Browse files
Show More
@@ -42,21 +42,18 b' def _droponode(data):'
42 class mergestate(object):
42 class mergestate(object):
43 '''track 3-way merge state of individual files
43 '''track 3-way merge state of individual files
44
44
45 it is stored on disk when needed. Two file are used, one with an old
45 The merge state is stored on disk when needed. Two files are used: one with
46 format, one with a new format. Both contains similar data, but the new
46 an old format (version 1), and one with a new format (version 2). Version 2
47 format can store new kinds of field.
47 stores a superset of the data in version 1, including new kinds of records
48
48 in the future. For more about the new format, see the documentation for
49 Current new format is a list of arbitrary record of the form:
49 `_readrecordsv2`.
50
51 [type][length][content]
52
50
53 Type is a single character, length is a 4 bytes integer, content is an
51 Each record can contain arbitrary content, and has an associated type. This
54 arbitrary suites of bytes of length `length`.
52 `type` should be a letter. If `type` is uppercase, the record is mandatory:
53 versions of Mercurial that don't support it should abort. If `type` is
54 lowercase, the record can be safely ignored.
55
55
56 Type should be a letter. Capital letter are mandatory record, Mercurial
56 Currently known records:
57 should abort if they are unknown. lower case record can be safely ignored.
58
59 Currently known record:
60
57
61 L: the node of the "local" part of the merge (hexified version)
58 L: the node of the "local" part of the merge (hexified version)
62 O: the node of the "other" part of the merge (hexified version)
59 O: the node of the "other" part of the merge (hexified version)
@@ -71,6 +68,7 b' class mergestate(object):'
71 to resolve or commit
68 to resolve or commit
72 m: driver-resolved files marked -- only needs to be run before commit
69 m: driver-resolved files marked -- only needs to be run before commit
73 s: success/skipped -- does not need to be run any more
70 s: success/skipped -- does not need to be run any more
71
74 '''
72 '''
75 statepathv1 = 'merge/state'
73 statepathv1 = 'merge/state'
76 statepathv2 = 'merge/state2'
74 statepathv2 = 'merge/state2'
@@ -226,8 +224,14 b' class mergestate(object):'
226 def _readrecordsv2(self):
224 def _readrecordsv2(self):
227 """read on disk merge state for version 2 file
225 """read on disk merge state for version 2 file
228
226
229 returns list of record [(TYPE, data), ...]
227 This format is a list of arbitrary records of the form:
230 """
228
229 [type][length][content]
230
231 `type` is a single character, `length` is a 4 byte integer, and
232 `content` is an arbitrary byte sequence of length `length`.
233
234 Returns list of records [(TYPE, data), ...]."""
231 records = []
235 records = []
232 try:
236 try:
233 f = self._repo.vfs(self.statepathv2)
237 f = self._repo.vfs(self.statepathv2)
General Comments 0
You need to be logged in to leave comments. Login now