Patchwork [02,of,13] mergestate: remove unrequired RECORD_RESOLVED_OTHER record

login
register
mail settings
Submitter Pulkit Goyal
Date July 17, 2020, 8:59 a.m.
Message ID <9e4a5e41f0ac3fa39a29.1594976363@workspace>
Download mbox | patch
Permalink /patch/46776/
State Accepted
Headers show

Comments

Pulkit Goyal - July 17, 2020, 8:59 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1594290002 -19800
#      Thu Jul 09 15:50:02 2020 +0530
# Node ID 9e4a5e41f0ac3fa39a29d5376a1d3922e9221318
# Parent  66fb1ff9343a4d73b44c4314d88176e283a7839d
# EXP-Topic mergestate-refactor
mergestate: remove unrequired RECORD_RESOLVED_OTHER record

This was introduced in last cycle however while working on refactoring
mergestate, I realized it's unncessary.

This will break users who did a merge using previous version, did this kind of
storage and before commiting updated the mercurial version.

Differential Revision: https://phab.mercurial-scm.org/D8716
Yuya Nishihara - July 19, 2020, 9:11 a.m.
On Fri, 17 Jul 2020 14:29:23 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1594290002 -19800
> #      Thu Jul 09 15:50:02 2020 +0530
> # Node ID 9e4a5e41f0ac3fa39a29d5376a1d3922e9221318
> # Parent  66fb1ff9343a4d73b44c4314d88176e283a7839d
> # EXP-Topic mergestate-refactor
> mergestate: remove unrequired RECORD_RESOLVED_OTHER record
> 
> This was introduced in last cycle however while working on refactoring
> mergestate, I realized it's unncessary.
> 
> This will break users who did a merge using previous version, did this kind of
> storage and before commiting updated the mercurial version.

Maybe better to document it and what error would be displayed in the release
notes.
Pierre-Yves David - July 31, 2020, 5:33 p.m.
On 7/19/20 11:11 AM, Yuya Nishihara wrote:
> On Fri, 17 Jul 2020 14:29:23 +0530, Pulkit Goyal wrote:
>> # HG changeset patch
>> # User Pulkit Goyal <7895pulkit@gmail.com>
>> # Date 1594290002 -19800
>> #      Thu Jul 09 15:50:02 2020 +0530
>> # Node ID 9e4a5e41f0ac3fa39a29d5376a1d3922e9221318
>> # Parent  66fb1ff9343a4d73b44c4314d88176e283a7839d
>> # EXP-Topic mergestate-refactor
>> mergestate: remove unrequired RECORD_RESOLVED_OTHER record
>>
>> This was introduced in last cycle however while working on refactoring
>> mergestate, I realized it's unncessary.
>>
>> This will break users who did a merge using previous version, did this kind of
>> storage and before commiting updated the mercurial version.
> 
> Maybe better to document it and what error would be displayed in the release
> notes.

It is probably not even worse breaking user of this. We could have a set 
of LEGACY record that we can safely ignore.

Patch

diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -51,7 +51,6 @@  RECORD_LABELS = b'l'
 RECORD_OVERRIDE = b't'
 RECORD_UNSUPPORTED_MANDATORY = b'X'
 RECORD_UNSUPPORTED_ADVISORY = b'x'
-RECORD_RESOLVED_OTHER = b'R'
 
 MERGE_DRIVER_STATE_UNMARKED = b'u'
 MERGE_DRIVER_STATE_MARKED = b'm'
@@ -220,7 +219,6 @@  class mergestate(object):
                 RECORD_CHANGEDELETE_CONFLICT,
                 RECORD_PATH_CONFLICT,
                 RECORD_MERGE_DRIVER_MERGE,
-                RECORD_RESOLVED_OTHER,
             ):
                 bits = record.split(b'\0')
                 self._state[bits[0]] = bits[1:]
@@ -448,9 +446,7 @@  class mergestate(object):
                     (RECORD_PATH_CONFLICT, b'\0'.join([filename] + v))
                 )
             elif v[0] == MERGE_RECORD_MERGED_OTHER:
-                records.append(
-                    (RECORD_RESOLVED_OTHER, b'\0'.join([filename] + v))
-                )
+                records.append((RECORD_MERGED, b'\0'.join([filename] + v)))
             elif v[1] == nullhex or v[6] == nullhex:
                 # Change/Delete or Delete/Change conflicts. These are stored in
                 # 'C' records. v[1] is the local file, and is nullhex when the