comparison tests/test-rebase-abort.t @ 44396:acbfa31cfaf2

debugmergestate: make templated Our IntelliJ team wants to be able to read the merge state in order to help the user resolve merge conflicts. They had so far been reading file contents from p1() and p2() and their merge base. That is not ideal for several reasons (merge base is not necessarily the "graft base", renames are not handled, commands like `hg update -m` is not handled). It will get especially bad as of my D7827. This patch makes the output s a templated. I haven't bothered to make it complete (e.g. merge driver states are not handled), but it's probably good enough as a start. I've done a web search for "debugmergestate" and I can't find any indication that any tools currently rely on its output. If it turns out that we get bug reports for it once this is released, I won't object to backing this patch out on the stable branch (and then perhaps replace it by a separate command, or put it behind a new flag). The changes in test-backout.t are interesting, in particular this: ``` - other path: foo (node not stored in v1 format) + other path: (node foo) ``` I wonder if that means that we actually read v1 format incorrectly. That seems to be an old format that was switched away from in 2014, so it doesn't matter now anyway. Differential Revision: https://phab.mercurial-scm.org/D8120
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 13 Feb 2020 21:14:20 -0800
parents 9c9cfecd4600
children dc5e5577af39
comparison
equal deleted inserted replaced
44395:382f4f09f0bd 44396:acbfa31cfaf2
86 86
87 Insert unsupported advisory merge record: 87 Insert unsupported advisory merge record:
88 88
89 $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x 89 $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x
90 $ hg debugmergestate 90 $ hg debugmergestate
91 * version 2 records 91 local (dest): 3e046f2ecedb793b97ed32108086edd1a162f8bc
92 local: 3e046f2ecedb793b97ed32108086edd1a162f8bc 92 other (source): 46f0b057b5c061d276b91491c22151f78698abd2
93 other: 46f0b057b5c061d276b91491c22151f78698abd2 93 file: common (state "u")
94 labels: 94 local path: common (hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1, flags "")
95 local: dest
96 other: source
97 unrecognized entry: x advisory record
98 file extras: common (ancestorlinknode = 3163e20567cc93074fbb7a53c8b93312e59dbf2c)
99 file: common (record type "F", state "u", hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1)
100 local path: common (flags "")
101 ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6) 95 ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6)
102 other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5) 96 other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5)
97 extra: ancestorlinknode = 3163e20567cc93074fbb7a53c8b93312e59dbf2c
103 $ hg resolve -l 98 $ hg resolve -l
104 U common 99 U common
105 100
106 Insert unsupported mandatory merge record: 101 Insert unsupported mandatory merge record:
107 102
108 $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X 103 $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X
109 $ hg debugmergestate 104 $ hg debugmergestate
110 * version 2 records 105 abort: unsupported merge state records: X
111 local: 3e046f2ecedb793b97ed32108086edd1a162f8bc 106 (see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
112 other: 46f0b057b5c061d276b91491c22151f78698abd2 107 [255]
113 labels:
114 local: dest
115 other: source
116 file extras: common (ancestorlinknode = 3163e20567cc93074fbb7a53c8b93312e59dbf2c)
117 file: common (record type "F", state "u", hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1)
118 local path: common (flags "")
119 ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6)
120 other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5)
121 unrecognized entry: X mandatory record
122 $ hg resolve -l 108 $ hg resolve -l
123 abort: unsupported merge state records: X 109 abort: unsupported merge state records: X
124 (see https://mercurial-scm.org/wiki/MergeStateRecords for more information) 110 (see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
125 [255] 111 [255]
126 $ hg resolve -ma 112 $ hg resolve -ma