comparison tests/test-histedit-non-commute-abort.t @ 27027:a01ecbcfaf84

mergestate: handle additional record types specially This works around a bug in older Mercurial versions' handling of the v2 merge state. We also add a bunch of tests that make sure that (1) we correctly abort when the merge state has an unsupported record type (2) aborting the merge, rebase or histedit continues to work and clears out the merge state.
author Siddharth Agarwal <sid0@fb.com>
date Wed, 18 Nov 2015 15:46:45 -0800
parents ef1eb6df7071
children cb5bdf65420f
comparison
equal deleted inserted replaced
27026:c93b44b79359 27027:a01ecbcfaf84
73 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 73 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 merging e 74 merging e
75 warning: conflicts while merging e! (edit, then use 'hg resolve --mark') 75 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
76 Fix up the change and run hg histedit --continue 76 Fix up the change and run hg histedit --continue
77 77
78 insert unsupported advisory merge record
79 $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x
80 $ hg debugmergestate
81 * version 2 records
82 local: 8f7551c7e4a2f2efe0bc8c741baf7f227d65d758
83 other: e860deea161a2f77de56603b340ebbb4536308ae
84 unrecognized entry: x advisory record
85 file: e (record type "F", state "u", hash 58e6b3a414a1e090dfc6029add0f3555ccba127f)
86 local path: e (flags "")
87 ancestor path: e (node 0000000000000000000000000000000000000000)
88 other path: e (node 6b67ccefd5ce6de77e7ead4f5292843a0255329f)
89 $ hg resolve -l
90 U e
78 91
79 abort the edit 92 insert unsupported mandatory merge record
93 $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X
94 $ hg debugmergestate
95 * version 2 records
96 local: 8f7551c7e4a2f2efe0bc8c741baf7f227d65d758
97 other: e860deea161a2f77de56603b340ebbb4536308ae
98 file: e (record type "F", state "u", hash 58e6b3a414a1e090dfc6029add0f3555ccba127f)
99 local path: e (flags "")
100 ancestor path: e (node 0000000000000000000000000000000000000000)
101 other path: e (node 6b67ccefd5ce6de77e7ead4f5292843a0255329f)
102 unrecognized entry: X mandatory record
103 $ hg resolve -l
104 abort: unsupported merge state records: X
105 (see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
106 [255]
107 $ hg resolve -ma
108 abort: unsupported merge state records: X
109 (see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
110 [255]
111
112 abort the edit (should clear out merge state)
80 $ hg histedit --abort 2>&1 | fixbundle 113 $ hg histedit --abort 2>&1 | fixbundle
81 2 files updated, 0 files merged, 0 files removed, 0 files unresolved 114 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
115 $ hg debugmergestate
116 no merge state found
82 117
83 log after abort 118 log after abort
84 $ hg resolve -l 119 $ hg resolve -l
85 $ hg log --graph 120 $ hg log --graph
86 @ changeset: 6:bfa474341cc9 121 @ changeset: 6:bfa474341cc9