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