Mercurial > evolve
comparison tests/test-evolve-inmemory.t @ 5820:5341d7c30e68 stable
branching: merge into stable in preparation for release
# no-check-commit
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 11 Mar 2021 11:49:34 +0800 |
parents | 84affb254cdf |
children | fd039a7f0c3c c1094cce56ed |
comparison
equal
deleted
inserted
replaced
5798:87006dcf2bb7 | 5820:5341d7c30e68 |
---|---|
1 Tests running `hg evolve` with in-memory merge. | |
2 | |
3 $ . $TESTDIR/testlib/common.sh | |
4 | |
5 $ cat >> $HGRCPATH <<EOF | |
6 > [extensions] | |
7 > evolve = | |
8 > drawdag=$RUNTESTDIR/drawdag.py | |
9 > [alias] | |
10 > glog = log -G -T '{rev}:{node|short} {separate(" ", phase, tags)}\n{desc|firstline}' | |
11 > [experimental] | |
12 > evolution.in-memory = yes | |
13 > EOF | |
14 | |
15 Test evolving a single orphan | |
16 | |
17 $ hg init single-orphan | |
18 $ cd single-orphan | |
19 $ hg debugdrawdag <<'EOS' | |
20 > C # C/c = c\n | |
21 > B2 | # B2/b = b2\n | |
22 > | B # B/b = b\n | |
23 > \ / # replace: B -> B2 | |
24 > A | |
25 > EOS | |
26 1 new orphan changesets | |
27 $ hg evolve | |
28 move:[3] C | |
29 atop:[2] B2 | |
30 $ hg glog | |
31 o 4:52da76e91abb draft tip | |
32 | C | |
33 | x 3:bc77848cde3a draft C | |
34 | | C | |
35 o | 2:377a194b9b8a draft B2 | |
36 | | B2 | |
37 | x 1:830b6315076c draft B | |
38 |/ B | |
39 o 0:426bada5c675 draft A | |
40 A | |
41 $ hg cat -r tip b c | |
42 b2 | |
43 c | |
44 $ cd .. | |
45 | |
46 Test that in-memory evolve works when there are conflicts | |
47 and after continuing. | |
48 | |
49 $ hg init conflicts | |
50 $ cd conflicts | |
51 $ hg debugdrawdag <<'EOS' | |
52 > E # E/e = e\n | |
53 > | | |
54 > D # D/b = d\n | |
55 > | | |
56 > C # C/c = c\n | |
57 > B2 | # B2/b = b2\n | |
58 > | B # B/b = b\n | |
59 > \ / # replace: B -> B2 | |
60 > A | |
61 > EOS | |
62 3 new orphan changesets | |
63 $ hg evolve | |
64 move:[3] C | |
65 atop:[2] B2 | |
66 move:[4] D | |
67 merging b | |
68 hit merge conflicts; retrying merge in working copy | |
69 merging b | |
70 warning: conflicts while merging b! (edit, then use 'hg resolve --mark') | |
71 unresolved merge conflicts | |
72 (see 'hg help evolve.interrupted') | |
73 [240] | |
74 $ hg glog | |
75 @ 6:52da76e91abb draft tip | |
76 | C | |
77 | * 5:eae7899dd92b draft E | |
78 | | E | |
79 | % 4:57e51f6a6d36 draft D | |
80 | | D | |
81 | x 3:bc77848cde3a draft C | |
82 | | C | |
83 o | 2:377a194b9b8a draft B2 | |
84 | | B2 | |
85 | x 1:830b6315076c draft B | |
86 |/ B | |
87 o 0:426bada5c675 draft A | |
88 A | |
89 $ cat c | |
90 c | |
91 $ cat b | |
92 <<<<<<< destination: 52da76e91abb - test: C | |
93 b2 | |
94 ======= | |
95 d | |
96 >>>>>>> evolving: 57e51f6a6d36 D - test: D | |
97 $ echo d2 > b | |
98 $ hg resolve -m | |
99 (no more unresolved files) | |
100 continue: hg evolve --continue | |
101 $ hg evolve --continue | |
102 evolving 4:57e51f6a6d36 "D" | |
103 move:[5] E | |
104 atop:[7] D | |
105 $ hg glog | |
106 o 8:3c658574f8ed draft tip | |
107 | E | |
108 o 7:16e609b952e8 draft | |
109 | D | |
110 o 6:52da76e91abb draft | |
111 | C | |
112 | x 5:eae7899dd92b draft E | |
113 | | E | |
114 | x 4:57e51f6a6d36 draft D | |
115 | | D | |
116 | x 3:bc77848cde3a draft C | |
117 | | C | |
118 o | 2:377a194b9b8a draft B2 | |
119 | | B2 | |
120 | x 1:830b6315076c draft B | |
121 |/ B | |
122 o 0:426bada5c675 draft A | |
123 A | |
124 $ hg cat -r tip b c e | |
125 d2 | |
126 c | |
127 e | |
128 $ cd .. | |
129 | |
130 Test that in-memory merge is disabled if there's a precommit hook | |
131 | |
132 $ hg init precommit-hook | |
133 $ cd precommit-hook | |
134 $ hg debugdrawdag <<'EOS' | |
135 > C # C/c = c\n | |
136 > B2 | # B2/b = b2\n | |
137 > | B # B/b = b\n | |
138 > \ / # replace: B -> B2 | |
139 > A | |
140 > EOS | |
141 1 new orphan changesets | |
142 $ cat >> .hg/hgrc <<EOF | |
143 > [hooks] | |
144 > precommit = echo "running precommit hook" | |
145 > EOF | |
146 The hook is not run with in-memory=force | |
147 $ hg co B2 | |
148 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
149 $ hg evolve --config experimental.evolution.in-memory=force --update | |
150 move:[3] C | |
151 atop:[2] B2 | |
152 working directory is now at 52da76e91abb | |
153 $ hg glog | |
154 @ 4:52da76e91abb draft tip | |
155 | C | |
156 | x 3:bc77848cde3a draft C | |
157 | | C | |
158 o | 2:377a194b9b8a draft B2 | |
159 | | B2 | |
160 | x 1:830b6315076c draft B | |
161 |/ B | |
162 o 0:426bada5c675 draft A | |
163 A | |
164 $ hg co tip^ | |
165 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
166 $ hg amend -m B3 | |
167 1 new orphan changesets | |
168 The hook is run with in-memory=yes | |
169 $ hg next --config experimental.evolution.in-memory=yes | |
170 move:[4] C | |
171 atop:[5] B3 | |
172 running precommit hook | |
173 working directory is now at aeee7323c054 | |
174 $ hg glog | |
175 @ 6:aeee7323c054 draft tip | |
176 | C | |
177 o 5:908ce5f9d7eb draft | |
178 | B3 | |
179 | x 3:bc77848cde3a draft C | |
180 | | C | |
181 +---x 2:377a194b9b8a draft B2 | |
182 | | B2 | |
183 | x 1:830b6315076c draft B | |
184 |/ B | |
185 o 0:426bada5c675 draft A | |
186 A |