comparison mercurial/merge.py @ 20592:303cbfe3dcc8 stable

merge: infer the "other" changeset when falling back to v1 format When we have to fallback to the old version of the file, we infer the "other" from current working directory parent. The same way it is currently done in the resolve command. This is know to have shortcoming… but we cannot do better from the data contained in the old file format. This is actually the motivation to add this new file format.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 27 Feb 2014 14:14:57 -0800
parents 02c60e380fd0
children 3678707e4017
comparison
equal deleted inserted replaced
20591:02c60e380fd0 20592:303cbfe3dcc8
72 v2records = self._readrecordsv2() 72 v2records = self._readrecordsv2()
73 allv2 = set(v2records) 73 allv2 = set(v2records)
74 for rev in v1records: 74 for rev in v1records:
75 if rev not in allv2: 75 if rev not in allv2:
76 # v1 file is newer than v2 file, use it 76 # v1 file is newer than v2 file, use it
77 # we have to infer the "other" changeset of the merge
78 # we cannot do better than that with v1 of the format
79 mctx = self._repo[None].parents()[-1]
80 v1records.append(('O', mctx.hex()))
77 return v1records 81 return v1records
78 else: 82 else:
79 return v2records 83 return v2records
80 def _readrecordsv1(self): 84 def _readrecordsv1(self):
81 records = [] 85 records = []