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.
--- 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:]