changeset 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
files mercurial/merge.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Tue Feb 25 18:42:11 2014 -0800
+++ b/mercurial/merge.py	Thu Feb 27 14:14:57 2014 -0800
@@ -74,6 +74,10 @@
         for rev in v1records:
             if rev not in allv2:
                 # v1 file is newer than v2 file, use it
+                # we have to infer the "other" changeset of the merge
+                # we cannot do better than that with v1 of the format
+                mctx = self._repo[None].parents()[-1]
+                v1records.append(('O', mctx.hex()))
                 return v1records
         else:
             return v2records