[PATCH] mergestate: fix BC breakage introduced because of removal of a merge record

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] mergestate: fix BC breakage introduced because of removal of a merge record

Pulkit Goyal
# HG changeset patch
# User Pulkit Goyal <[hidden email]>
# Date 1596287368 -19800
#      Sat Aug 01 18:39:28 2020 +0530
# Branch stable
# Node ID 7fc3c5fbc65f6fe85d70ea63923b8767dda4f2e0
# Parent  9b5723784aac9013471ca273ebdfa401e8bb443e
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.

diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -96,6 +96,12 @@ MERGE_DRIVER_STATE_UNMARKED = b'u'
 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 @@ class mergestate(object):
                 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:]

_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] mergestate: fix BC breakage introduced because of removal of a merge record

Pulkit Goyal
On Sat, Aug 1, 2020 at 6:39 PM Pulkit Goyal <[hidden email]> wrote:

>
> # HG changeset patch
> # User Pulkit Goyal <[hidden email]>
> # Date 1596287368 -19800
> #      Sat Aug 01 18:39:28 2020 +0530
> # Branch stable
> # Node ID 7fc3c5fbc65f6fe85d70ea63923b8767dda4f2e0
> # Parent  9b5723784aac9013471ca273ebdfa401e8bb443e
> 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.

I missed the `--flag stable`. This is meant for stable branch.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] mergestate: fix BC breakage introduced because of removal of a merge record

Augie Fackler-2
In reply to this post by Pulkit Goyal
queued for stable, thanks

> On Aug 1, 2020, at 09:09, Pulkit Goyal <[hidden email]> wrote:
>
> # HG changeset patch
> # User Pulkit Goyal <[hidden email]>
> # Date 1596287368 -19800
> #      Sat Aug 01 18:39:28 2020 +0530
> # Branch stable
> # Node ID 7fc3c5fbc65f6fe85d70ea63923b8767dda4f2e0
> # Parent  9b5723784aac9013471ca273ebdfa401e8bb443e
> 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.
>
> diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
> --- a/mercurial/mergestate.py
> +++ b/mercurial/mergestate.py
> @@ -96,6 +96,12 @@ MERGE_DRIVER_STATE_UNMARKED = b'u'
> 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 @@ class mergestate(object):
>                 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:]
>
> _______________________________________________
> Mercurial-devel mailing list
> [hidden email]
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel