mergestate: fix BC breakage introduced because of removal of a merge record stable 5.5
authorPulkit Goyal <7895pulkit@gmail.com>
Sat, 01 Aug 2020 18:39:28 +0530
branchstable
changeset 45271 7fc3c5fbc65f
parent 45253 9b5723784aac
child 45272 3c2591a435d9
mergestate: fix BC breakage introduced because of removal of a merge record In fcd0cff3400a I removed the usage of RECORD_RESOLVED_OTHER. However I also removed the reading support, hence if there is any user who runs into merge conflict with older version of hg, upgrades hg and then tries to read mergestate, they will end up with an MergeRecordUnsupportedError.
mercurial/mergestate.py
--- a/mercurial/mergestate.py	Sat Jul 25 22:51:26 2020 +0900
+++ b/mercurial/mergestate.py	Sat Aug 01 18:39:28 2020 +0530
@@ -96,6 +96,12 @@
 MERGE_DRIVER_STATE_MARKED = b'm'
 MERGE_DRIVER_STATE_SUCCESS = b's'
 
+#####
+# legacy records which are no longer used but kept to prevent breaking BC
+#####
+# This record was release in 5.4 and usage was removed in 5.5
+LEGACY_RECORD_RESOLVED_OTHER = b'R'
+
 
 ACTION_FORGET = b'f'
 ACTION_REMOVE = b'r'
@@ -249,6 +255,7 @@
                 RECORD_CHANGEDELETE_CONFLICT,
                 RECORD_PATH_CONFLICT,
                 RECORD_MERGE_DRIVER_MERGE,
+                LEGACY_RECORD_RESOLVED_OTHER,
             ):
                 bits = record.split(b'\0')
                 self._state[bits[0]] = bits[1:]