##// END OF EJS Templates
mergestate: use _stateextras instead of merge records for commit related info...
Pulkit Goyal -
r45942:0652a533 default
parent child Browse files
Show More
@@ -5969,8 +5969,6 b' def resolve(ui, repo, *pats, **opts):'
5969 5969 if not m(f):
5970 5970 continue
5971 5971
5972 if ms[f] == mergestatemod.MERGE_RECORD_MERGED_OTHER:
5973 continue
5974 5972 label, key = mergestateinfo[ms[f]]
5975 5973 fm.startitem()
5976 5974 fm.context(ctx=wctx)
@@ -6018,9 +6016,6 b' def resolve(ui, repo, *pats, **opts):'
6018 6016
6019 6017 didwork = True
6020 6018
6021 if ms[f] == mergestatemod.MERGE_RECORD_MERGED_OTHER:
6022 continue
6023
6024 6019 # don't let driver-resolved files be marked, and run the conclude
6025 6020 # step if asked to resolve
6026 6021 if ms[f] == mergestatemod.MERGE_RECORD_DRIVER_RESOLVED:
@@ -325,10 +325,7 b' def _filecommit('
325 325 elif not fparentancestors:
326 326 # TODO: this whole if-else might be simplified much more
327 327 ms = mergestate.mergestate.read(repo)
328 if (
329 fname in ms
330 and ms[fname] == mergestate.MERGE_RECORD_MERGED_OTHER
331 ):
328 if ms.extras(fname).get(b'filenode-source') == b'other':
332 329 fparent1, fparent2 = fparent2, nullid
333 330
334 331 # is the file changed?
@@ -81,6 +81,8 b" MERGE_RECORD_RESOLVED_PATH = b'pr'"
81 81 MERGE_RECORD_DRIVER_RESOLVED = b'd'
82 82 # represents that the file was automatically merged in favor
83 83 # of other version. This info is used on commit.
84 # This is now deprecated and commit related information is now
85 # stored in RECORD_FILE_VALUES
84 86 MERGE_RECORD_MERGED_OTHER = b'o'
85 87
86 88 #####
@@ -257,7 +259,13 b' class mergestate(object):'
257 259 LEGACY_RECORD_RESOLVED_OTHER,
258 260 ):
259 261 bits = record.split(b'\0')
260 self._state[bits[0]] = bits[1:]
262 # merge entry type MERGE_RECORD_MERGED_OTHER is deprecated
263 # and we now store related information in _stateextras, so
264 # lets write to _stateextras directly
265 if bits[1] == MERGE_RECORD_MERGED_OTHER:
266 self._stateextras[bits[0]][b'filenode-source'] = b'other'
267 else:
268 self._state[bits[0]] = bits[1:]
261 269 elif rtype == RECORD_FILE_VALUES:
262 270 filename, rawextras = record.split(b'\0', 1)
263 271 extraparts = rawextras.split(b'\0')
@@ -486,8 +494,6 b' class mergestate(object):'
486 494 records.append(
487 495 (RECORD_PATH_CONFLICT, b'\0'.join([filename] + v))
488 496 )
489 elif v[0] == MERGE_RECORD_MERGED_OTHER:
490 records.append((RECORD_MERGED, b'\0'.join([filename] + v)))
491 497 elif v[1] == nullhex or v[6] == nullhex:
492 498 # Change/Delete or Delete/Change conflicts. These are stored in
493 499 # 'C' records. v[1] is the local file, and is nullhex when the
@@ -587,7 +593,7 b' class mergestate(object):'
587 593 self._dirty = True
588 594
589 595 def addmergedother(self, path):
590 self._state[path] = [MERGE_RECORD_MERGED_OTHER, nullhex, nullhex]
596 self._stateextras[path] = {b'filenode-source': b'other'}
591 597 self._dirty = True
592 598
593 599 def __contains__(self, dfile):
@@ -636,8 +642,6 b' class mergestate(object):'
636 642 """
637 643 if self[dfile] in (MERGE_RECORD_RESOLVED, MERGE_RECORD_DRIVER_RESOLVED):
638 644 return True, 0
639 if self._state[dfile][0] == MERGE_RECORD_MERGED_OTHER:
640 return True, 0
641 645 stateentry = self._state[dfile]
642 646 state, localkey, lfile, afile, anode, ofile, onode, flags = stateentry
643 647 octx = self._repo[self._other]
General Comments 0
You need to be logged in to leave comments. Login now