Show More
@@ -36,6 +36,7 b' class mergestate(object):' | |||||
36 | Currently known record: |
|
36 | Currently known record: | |
37 |
|
37 | |||
38 | L: the node of the "local" part of the merge (hexified version) |
|
38 | L: the node of the "local" part of the merge (hexified version) | |
|
39 | O: the node of the "other" part of the merge (hexified version) | |||
39 | F: a file to be merged entry |
|
40 | F: a file to be merged entry | |
40 | ''' |
|
41 | ''' | |
41 | statepathv1 = "merge/state" |
|
42 | statepathv1 = "merge/state" | |
@@ -44,10 +45,11 b' class mergestate(object):' | |||||
44 | self._repo = repo |
|
45 | self._repo = repo | |
45 | self._dirty = False |
|
46 | self._dirty = False | |
46 | self._read() |
|
47 | self._read() | |
47 | def reset(self, node=None): |
|
48 | def reset(self, node=None, other=None): | |
48 | self._state = {} |
|
49 | self._state = {} | |
49 | if node: |
|
50 | if node: | |
50 | self._local = node |
|
51 | self._local = node | |
|
52 | self._other = other | |||
51 | shutil.rmtree(self._repo.join("merge"), True) |
|
53 | shutil.rmtree(self._repo.join("merge"), True) | |
52 | self._dirty = False |
|
54 | self._dirty = False | |
53 | def _read(self): |
|
55 | def _read(self): | |
@@ -56,6 +58,8 b' class mergestate(object):' | |||||
56 | for rtype, record in records: |
|
58 | for rtype, record in records: | |
57 | if rtype == 'L': |
|
59 | if rtype == 'L': | |
58 | self._local = bin(record) |
|
60 | self._local = bin(record) | |
|
61 | elif rtype == 'O': | |||
|
62 | self._other = bin(record) | |||
59 | elif rtype == "F": |
|
63 | elif rtype == "F": | |
60 | bits = record.split("\0") |
|
64 | bits = record.split("\0") | |
61 | self._state[bits[0]] = bits[1:] |
|
65 | self._state[bits[0]] = bits[1:] | |
@@ -111,6 +115,7 b' class mergestate(object):' | |||||
111 | if self._dirty: |
|
115 | if self._dirty: | |
112 | records = [] |
|
116 | records = [] | |
113 | records.append(("L", hex(self._local))) |
|
117 | records.append(("L", hex(self._local))) | |
|
118 | records.append(("O", hex(self._other))) | |||
114 | for d, v in self._state.iteritems(): |
|
119 | for d, v in self._state.iteritems(): | |
115 | records.append(("F", "\0".join([d] + v))) |
|
120 | records.append(("F", "\0".join([d] + v))) | |
116 | self._writerecords(records) |
|
121 | self._writerecords(records) | |
@@ -529,7 +534,7 b' def applyupdates(repo, actions, wctx, mc' | |||||
529 |
|
534 | |||
530 | updated, merged, removed, unresolved = 0, 0, 0, 0 |
|
535 | updated, merged, removed, unresolved = 0, 0, 0, 0 | |
531 | ms = mergestate(repo) |
|
536 | ms = mergestate(repo) | |
532 | ms.reset(wctx.p1().node()) |
|
537 | ms.reset(wctx.p1().node(), mctx.node()) | |
533 | moves = [] |
|
538 | moves = [] | |
534 | actions.sort(key=actionkey) |
|
539 | actions.sort(key=actionkey) | |
535 |
|
540 |
General Comments 0
You need to be logged in to leave comments.
Login now