##// END OF EJS Templates
tests: test divergence created during interrupted rebase...
Martin von Zweigbergk -
r47586:6648307d default
parent child Browse files
Show More
@@ -1,626 +1,669 b''
1 ==========================
1 ==========================
2 Test rebase with obsolete
2 Test rebase with obsolete
3 ==========================
3 ==========================
4
4
5 Enable obsolete
5 Enable obsolete
6
6
7 $ cat >> $HGRCPATH << EOF
7 $ cat >> $HGRCPATH << EOF
8 > [command-templates]
8 > [command-templates]
9 > log= {rev}:{node|short} {desc|firstline}{if(obsolete,' ({obsfate})')}
9 > log= {rev}:{node|short} {desc|firstline}{if(obsolete,' ({obsfate})')}
10 > [experimental]
10 > [experimental]
11 > evolution.createmarkers=True
11 > evolution.createmarkers=True
12 > evolution.allowunstable=True
12 > evolution.allowunstable=True
13 > [phases]
13 > [phases]
14 > publish=False
14 > publish=False
15 > [extensions]
15 > [extensions]
16 > rebase=
16 > rebase=
17 > drawdag=$TESTDIR/drawdag.py
17 > drawdag=$TESTDIR/drawdag.py
18 > strip=
18 > strip=
19 > EOF
19 > EOF
20
20
21 Divergence cases due to obsolete changesets
21 Divergence cases due to obsolete changesets
22 -------------------------------------------
22 -------------------------------------------
23
23
24 We should ignore branches with unstable changesets when they are based on an
24 We should ignore branches with unstable changesets when they are based on an
25 obsolete changeset which successor is in rebase set.
25 obsolete changeset which successor is in rebase set.
26
26
27 $ hg init divergence
27 $ hg init divergence
28 $ cd divergence
28 $ cd divergence
29 $ cat >> .hg/hgrc << EOF
29 $ cat >> .hg/hgrc << EOF
30 > [extensions]
30 > [extensions]
31 > strip =
31 > strip =
32 > [alias]
32 > [alias]
33 > strip = strip --no-backup --quiet
33 > strip = strip --no-backup --quiet
34 > [templates]
34 > [templates]
35 > instabilities = '{rev}:{node|short} {desc|firstline}{if(instabilities," ({instabilities})")}\n'
35 > instabilities = '{rev}:{node|short} {desc|firstline}{if(instabilities," ({instabilities})")}\n'
36 > EOF
36 > EOF
37
37
38 $ hg debugdrawdag <<EOF
38 $ hg debugdrawdag <<EOF
39 > e f
39 > e f
40 > | |
40 > | |
41 > d' d # replace: d -> d'
41 > d' d # replace: d -> d'
42 > \ /
42 > \ /
43 > c
43 > c
44 > |
44 > |
45 > x b
45 > x b
46 > \|
46 > \|
47 > a
47 > a
48 > EOF
48 > EOF
49 1 new orphan changesets
49 1 new orphan changesets
50 $ hg log -G -r 'a'::
50 $ hg log -G -r 'a'::
51 * 7:1143e9adc121 f
51 * 7:1143e9adc121 f
52 |
52 |
53 | o 6:d60ebfa0f1cb e
53 | o 6:d60ebfa0f1cb e
54 | |
54 | |
55 | o 5:027ad6c5830d d'
55 | o 5:027ad6c5830d d'
56 | |
56 | |
57 x | 4:76be324c128b d (rewritten using replace as 5:027ad6c5830d)
57 x | 4:76be324c128b d (rewritten using replace as 5:027ad6c5830d)
58 |/
58 |/
59 o 3:a82ac2b38757 c
59 o 3:a82ac2b38757 c
60 |
60 |
61 | o 2:630d7c95eff7 x
61 | o 2:630d7c95eff7 x
62 | |
62 | |
63 o | 1:488e1b7e7341 b
63 o | 1:488e1b7e7341 b
64 |/
64 |/
65 o 0:b173517d0057 a
65 o 0:b173517d0057 a
66
66
67
67
68 Changeset d and its descendants are excluded to avoid divergence of d, which
68 Changeset d and its descendants are excluded to avoid divergence of d, which
69 would occur because the successor of d (d') is also in rebaseset. As a
69 would occur because the successor of d (d') is also in rebaseset. As a
70 consequence f (descendant of d) is left behind.
70 consequence f (descendant of d) is left behind.
71
71
72 $ hg rebase -b 'e' -d 'x'
72 $ hg rebase -b 'e' -d 'x'
73 rebasing 1:488e1b7e7341 b "b"
73 rebasing 1:488e1b7e7341 b "b"
74 rebasing 3:a82ac2b38757 c "c"
74 rebasing 3:a82ac2b38757 c "c"
75 rebasing 5:027ad6c5830d d' "d'"
75 rebasing 5:027ad6c5830d d' "d'"
76 rebasing 6:d60ebfa0f1cb e "e"
76 rebasing 6:d60ebfa0f1cb e "e"
77 note: not rebasing 4:76be324c128b d "d" and its descendants as this would cause divergence
77 note: not rebasing 4:76be324c128b d "d" and its descendants as this would cause divergence
78 $ hg log -G -r 'a'::
78 $ hg log -G -r 'a'::
79 o 11:eb6d63fc4ed5 e
79 o 11:eb6d63fc4ed5 e
80 |
80 |
81 o 10:44d8c724a70c d'
81 o 10:44d8c724a70c d'
82 |
82 |
83 o 9:d008e6b4d3fd c
83 o 9:d008e6b4d3fd c
84 |
84 |
85 o 8:67e8f4a16c49 b
85 o 8:67e8f4a16c49 b
86 |
86 |
87 | * 7:1143e9adc121 f
87 | * 7:1143e9adc121 f
88 | |
88 | |
89 | | x 6:d60ebfa0f1cb e (rewritten using rebase as 11:eb6d63fc4ed5)
89 | | x 6:d60ebfa0f1cb e (rewritten using rebase as 11:eb6d63fc4ed5)
90 | | |
90 | | |
91 | | x 5:027ad6c5830d d' (rewritten using rebase as 10:44d8c724a70c)
91 | | x 5:027ad6c5830d d' (rewritten using rebase as 10:44d8c724a70c)
92 | | |
92 | | |
93 | x | 4:76be324c128b d (rewritten using replace as 5:027ad6c5830d)
93 | x | 4:76be324c128b d (rewritten using replace as 5:027ad6c5830d)
94 | |/
94 | |/
95 | x 3:a82ac2b38757 c (rewritten using rebase as 9:d008e6b4d3fd)
95 | x 3:a82ac2b38757 c (rewritten using rebase as 9:d008e6b4d3fd)
96 | |
96 | |
97 o | 2:630d7c95eff7 x
97 o | 2:630d7c95eff7 x
98 | |
98 | |
99 | x 1:488e1b7e7341 b (rewritten using rebase as 8:67e8f4a16c49)
99 | x 1:488e1b7e7341 b (rewritten using rebase as 8:67e8f4a16c49)
100 |/
100 |/
101 o 0:b173517d0057 a
101 o 0:b173517d0057 a
102
102
103 $ hg strip -r 8:
103 $ hg strip -r 8:
104 $ hg log -G -r 'a'::
104 $ hg log -G -r 'a'::
105 * 7:1143e9adc121 f
105 * 7:1143e9adc121 f
106 |
106 |
107 | o 6:d60ebfa0f1cb e
107 | o 6:d60ebfa0f1cb e
108 | |
108 | |
109 | o 5:027ad6c5830d d'
109 | o 5:027ad6c5830d d'
110 | |
110 | |
111 x | 4:76be324c128b d (rewritten using replace as 5:027ad6c5830d)
111 x | 4:76be324c128b d (rewritten using replace as 5:027ad6c5830d)
112 |/
112 |/
113 o 3:a82ac2b38757 c
113 o 3:a82ac2b38757 c
114 |
114 |
115 | o 2:630d7c95eff7 x
115 | o 2:630d7c95eff7 x
116 | |
116 | |
117 o | 1:488e1b7e7341 b
117 o | 1:488e1b7e7341 b
118 |/
118 |/
119 o 0:b173517d0057 a
119 o 0:b173517d0057 a
120
120
121
121
122 If the rebase set has an obsolete (d) with a successor (d') outside the rebase
122 If the rebase set has an obsolete (d) with a successor (d') outside the rebase
123 set and none in destination, we still get the divergence warning.
123 set and none in destination, we still get the divergence warning.
124 By allowing divergence, we can perform the rebase.
124 By allowing divergence, we can perform the rebase.
125
125
126 $ hg rebase -r 'c'::'f' -d 'x'
126 $ hg rebase -r 'c'::'f' -d 'x'
127 abort: this rebase will cause divergences from: 76be324c128b
127 abort: this rebase will cause divergences from: 76be324c128b
128 (to force the rebase please set experimental.evolution.allowdivergence=True)
128 (to force the rebase please set experimental.evolution.allowdivergence=True)
129 [20]
129 [20]
130 $ hg rebase --config experimental.evolution.allowdivergence=true -r 'c'::'f' -d 'x'
130 $ hg rebase --config experimental.evolution.allowdivergence=true -r 'c'::'f' -d 'x'
131 rebasing 3:a82ac2b38757 c "c"
131 rebasing 3:a82ac2b38757 c "c"
132 rebasing 4:76be324c128b d "d"
132 rebasing 4:76be324c128b d "d"
133 rebasing 7:1143e9adc121 f tip "f"
133 rebasing 7:1143e9adc121 f tip "f"
134 1 new orphan changesets
134 1 new orphan changesets
135 2 new content-divergent changesets
135 2 new content-divergent changesets
136 $ hg log -G -r 'a':: -T instabilities
136 $ hg log -G -r 'a':: -T instabilities
137 o 10:e1744ea07510 f
137 o 10:e1744ea07510 f
138 |
138 |
139 * 9:e2b36ea9a0a0 d (content-divergent)
139 * 9:e2b36ea9a0a0 d (content-divergent)
140 |
140 |
141 o 8:6a0376de376e c
141 o 8:6a0376de376e c
142 |
142 |
143 | x 7:1143e9adc121 f
143 | x 7:1143e9adc121 f
144 | |
144 | |
145 | | * 6:d60ebfa0f1cb e (orphan)
145 | | * 6:d60ebfa0f1cb e (orphan)
146 | | |
146 | | |
147 | | * 5:027ad6c5830d d' (orphan content-divergent)
147 | | * 5:027ad6c5830d d' (orphan content-divergent)
148 | | |
148 | | |
149 | x | 4:76be324c128b d
149 | x | 4:76be324c128b d
150 | |/
150 | |/
151 | x 3:a82ac2b38757 c
151 | x 3:a82ac2b38757 c
152 | |
152 | |
153 o | 2:630d7c95eff7 x
153 o | 2:630d7c95eff7 x
154 | |
154 | |
155 | o 1:488e1b7e7341 b
155 | o 1:488e1b7e7341 b
156 |/
156 |/
157 o 0:b173517d0057 a
157 o 0:b173517d0057 a
158
158
159 $ hg strip -r 8:
159 $ hg strip -r 8:
160
160
161 (Not skipping obsoletes means that divergence is allowed.)
161 (Not skipping obsoletes means that divergence is allowed.)
162
162
163 $ hg rebase --config experimental.rebaseskipobsolete=false -r 'c'::'f' -d 'x'
163 $ hg rebase --config experimental.rebaseskipobsolete=false -r 'c'::'f' -d 'x'
164 rebasing 3:a82ac2b38757 c "c"
164 rebasing 3:a82ac2b38757 c "c"
165 rebasing 4:76be324c128b d "d"
165 rebasing 4:76be324c128b d "d"
166 rebasing 7:1143e9adc121 f tip "f"
166 rebasing 7:1143e9adc121 f tip "f"
167 1 new orphan changesets
167 1 new orphan changesets
168 2 new content-divergent changesets
168 2 new content-divergent changesets
169
169
170 $ hg strip -r 0:
170 $ hg strip -r 0:
171
171
172 Similar test on a more complex graph
172 Similar test on a more complex graph
173
173
174 $ hg debugdrawdag <<EOF
174 $ hg debugdrawdag <<EOF
175 > g
175 > g
176 > |
176 > |
177 > f e
177 > f e
178 > | |
178 > | |
179 > e' d # replace: e -> e'
179 > e' d # replace: e -> e'
180 > \ /
180 > \ /
181 > c
181 > c
182 > |
182 > |
183 > x b
183 > x b
184 > \|
184 > \|
185 > a
185 > a
186 > EOF
186 > EOF
187 1 new orphan changesets
187 1 new orphan changesets
188 $ hg log -G -r 'a':
188 $ hg log -G -r 'a':
189 * 8:2876ce66c6eb g
189 * 8:2876ce66c6eb g
190 |
190 |
191 | o 7:3ffec603ab53 f
191 | o 7:3ffec603ab53 f
192 | |
192 | |
193 x | 6:e36fae928aec e (rewritten using replace as 5:63324dc512ea)
193 x | 6:e36fae928aec e (rewritten using replace as 5:63324dc512ea)
194 | |
194 | |
195 | o 5:63324dc512ea e'
195 | o 5:63324dc512ea e'
196 | |
196 | |
197 o | 4:76be324c128b d
197 o | 4:76be324c128b d
198 |/
198 |/
199 o 3:a82ac2b38757 c
199 o 3:a82ac2b38757 c
200 |
200 |
201 | o 2:630d7c95eff7 x
201 | o 2:630d7c95eff7 x
202 | |
202 | |
203 o | 1:488e1b7e7341 b
203 o | 1:488e1b7e7341 b
204 |/
204 |/
205 o 0:b173517d0057 a
205 o 0:b173517d0057 a
206
206
207 $ hg rebase -b 'f' -d 'x'
207 $ hg rebase -b 'f' -d 'x'
208 rebasing 1:488e1b7e7341 b "b"
208 rebasing 1:488e1b7e7341 b "b"
209 rebasing 3:a82ac2b38757 c "c"
209 rebasing 3:a82ac2b38757 c "c"
210 rebasing 5:63324dc512ea e' "e'"
210 rebasing 5:63324dc512ea e' "e'"
211 rebasing 7:3ffec603ab53 f "f"
211 rebasing 7:3ffec603ab53 f "f"
212 rebasing 4:76be324c128b d "d"
212 rebasing 4:76be324c128b d "d"
213 note: not rebasing 6:e36fae928aec e "e" and its descendants as this would cause divergence
213 note: not rebasing 6:e36fae928aec e "e" and its descendants as this would cause divergence
214 $ hg log -G -r 'a':
214 $ hg log -G -r 'a':
215 o 13:a1707a5b7c2c d
215 o 13:a1707a5b7c2c d
216 |
216 |
217 | o 12:ef6251596616 f
217 | o 12:ef6251596616 f
218 | |
218 | |
219 | o 11:b6f172e64af9 e'
219 | o 11:b6f172e64af9 e'
220 |/
220 |/
221 o 10:d008e6b4d3fd c
221 o 10:d008e6b4d3fd c
222 |
222 |
223 o 9:67e8f4a16c49 b
223 o 9:67e8f4a16c49 b
224 |
224 |
225 | * 8:2876ce66c6eb g
225 | * 8:2876ce66c6eb g
226 | |
226 | |
227 | | x 7:3ffec603ab53 f (rewritten using rebase as 12:ef6251596616)
227 | | x 7:3ffec603ab53 f (rewritten using rebase as 12:ef6251596616)
228 | | |
228 | | |
229 | x | 6:e36fae928aec e (rewritten using replace as 5:63324dc512ea)
229 | x | 6:e36fae928aec e (rewritten using replace as 5:63324dc512ea)
230 | | |
230 | | |
231 | | x 5:63324dc512ea e' (rewritten using rebase as 11:b6f172e64af9)
231 | | x 5:63324dc512ea e' (rewritten using rebase as 11:b6f172e64af9)
232 | | |
232 | | |
233 | x | 4:76be324c128b d (rewritten using rebase as 13:a1707a5b7c2c)
233 | x | 4:76be324c128b d (rewritten using rebase as 13:a1707a5b7c2c)
234 | |/
234 | |/
235 | x 3:a82ac2b38757 c (rewritten using rebase as 10:d008e6b4d3fd)
235 | x 3:a82ac2b38757 c (rewritten using rebase as 10:d008e6b4d3fd)
236 | |
236 | |
237 o | 2:630d7c95eff7 x
237 o | 2:630d7c95eff7 x
238 | |
238 | |
239 | x 1:488e1b7e7341 b (rewritten using rebase as 9:67e8f4a16c49)
239 | x 1:488e1b7e7341 b (rewritten using rebase as 9:67e8f4a16c49)
240 |/
240 |/
241 o 0:b173517d0057 a
241 o 0:b173517d0057 a
242
242
243
243
244 issue5782
244 issue5782
245 $ hg strip -r 0:
245 $ hg strip -r 0:
246 $ hg debugdrawdag <<EOF
246 $ hg debugdrawdag <<EOF
247 > d
247 > d
248 > |
248 > |
249 > c1 c # replace: c -> c1
249 > c1 c # replace: c -> c1
250 > \ /
250 > \ /
251 > b
251 > b
252 > |
252 > |
253 > a
253 > a
254 > EOF
254 > EOF
255 1 new orphan changesets
255 1 new orphan changesets
256 $ hg debugobsolete `hg log -T "{node}" --hidden -r 'desc("c1")'`
256 $ hg debugobsolete `hg log -T "{node}" --hidden -r 'desc("c1")'`
257 1 new obsolescence markers
257 1 new obsolescence markers
258 obsoleted 1 changesets
258 obsoleted 1 changesets
259 $ hg log -G -r 'a': --hidden
259 $ hg log -G -r 'a': --hidden
260 * 4:76be324c128b d
260 * 4:76be324c128b d
261 |
261 |
262 | x 3:ef8a456de8fa c1 (pruned)
262 | x 3:ef8a456de8fa c1 (pruned)
263 | |
263 | |
264 x | 2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa)
264 x | 2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa)
265 |/
265 |/
266 o 1:488e1b7e7341 b
266 o 1:488e1b7e7341 b
267 |
267 |
268 o 0:b173517d0057 a
268 o 0:b173517d0057 a
269
269
270 $ hg rebase -d 0 -r 2
270 $ hg rebase -d 0 -r 2
271 note: not rebasing 2:a82ac2b38757 c "c", it has no successor
271 note: not rebasing 2:a82ac2b38757 c "c", it has no successor
272 $ hg log -G -r 'a': --hidden
272 $ hg log -G -r 'a': --hidden
273 * 4:76be324c128b d
273 * 4:76be324c128b d
274 |
274 |
275 | x 3:ef8a456de8fa c1 (pruned)
275 | x 3:ef8a456de8fa c1 (pruned)
276 | |
276 | |
277 x | 2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa)
277 x | 2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa)
278 |/
278 |/
279 o 1:488e1b7e7341 b
279 o 1:488e1b7e7341 b
280 |
280 |
281 o 0:b173517d0057 a
281 o 0:b173517d0057 a
282
282
283 $ cd ..
283 $ cd ..
284
284
285 Start a normal rebase. When it runs into conflicts, rewrite one of the
286 commits in the rebase set, causing divergence when the rebase continues.
287
288 $ hg init $TESTTMP/new-divergence-after-conflict
289 $ cd $TESTTMP/new-divergence-after-conflict
290 $ hg debugdrawdag <<'EOS'
291 > C2
292 > | C1
293 > |/
294 > B # B/D=B
295 > | D
296 > |/
297 > A
298 > EOS
299 $ hg rebase -r B::C1 -d D
300 rebasing 1:2ec65233581b B "B"
301 merging D
302 warning: conflicts while merging D! (edit, then use 'hg resolve --mark')
303 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
304 [240]
305 $ hg debugobsolete $(hg log -r C1 -T '{node}') $(hg log -r C2 -T '{node}')
306 1 new obsolescence markers
307 obsoleted 1 changesets
308 $ hg log -G
309 o 4:fdb9df6b130c C2
310 |
311 | x 3:7e5bfd3c08f0 C1 (rewritten as 4:fdb9df6b130c)
312 |/
313 | @ 2:b18e25de2cf5 D
314 | |
315 % | 1:2ec65233581b B
316 |/
317 o 0:426bada5c675 A
318
319 $ echo resolved > D
320 $ hg resolve -m D
321 (no more unresolved files)
322 continue: hg rebase --continue
323 $ hg rebase -c
324 rebasing 1:2ec65233581b B "B"
325 note: not rebasing 3:7e5bfd3c08f0 C1 "C1" and its descendants as this would cause divergence
326 1 new orphan changesets
327
285 Rebase merge where successor of one parent is equal to destination (issue5198)
328 Rebase merge where successor of one parent is equal to destination (issue5198)
286
329
287 $ hg init p1-succ-is-dest
330 $ hg init p1-succ-is-dest
288 $ cd p1-succ-is-dest
331 $ cd p1-succ-is-dest
289
332
290 $ hg debugdrawdag <<EOF
333 $ hg debugdrawdag <<EOF
291 > F
334 > F
292 > /|
335 > /|
293 > E D B # replace: D -> B
336 > E D B # replace: D -> B
294 > \|/
337 > \|/
295 > A
338 > A
296 > EOF
339 > EOF
297 1 new orphan changesets
340 1 new orphan changesets
298
341
299 $ hg rebase -d B -s D
342 $ hg rebase -d B -s D
300 note: not rebasing 2:b18e25de2cf5 D "D", already in destination as 1:112478962961 B "B"
343 note: not rebasing 2:b18e25de2cf5 D "D", already in destination as 1:112478962961 B "B"
301 rebasing 4:66f1a38021c9 F tip "F"
344 rebasing 4:66f1a38021c9 F tip "F"
302 $ hg log -G
345 $ hg log -G
303 o 5:50e9d60b99c6 F
346 o 5:50e9d60b99c6 F
304 |\
347 |\
305 | | x 4:66f1a38021c9 F (rewritten using rebase as 5:50e9d60b99c6)
348 | | x 4:66f1a38021c9 F (rewritten using rebase as 5:50e9d60b99c6)
306 | |/|
349 | |/|
307 | o | 3:7fb047a69f22 E
350 | o | 3:7fb047a69f22 E
308 | | |
351 | | |
309 | | x 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961)
352 | | x 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961)
310 | |/
353 | |/
311 o | 1:112478962961 B
354 o | 1:112478962961 B
312 |/
355 |/
313 o 0:426bada5c675 A
356 o 0:426bada5c675 A
314
357
315 $ cd ..
358 $ cd ..
316
359
317 Rebase merge where successor of other parent is equal to destination
360 Rebase merge where successor of other parent is equal to destination
318
361
319 $ hg init p2-succ-is-dest
362 $ hg init p2-succ-is-dest
320 $ cd p2-succ-is-dest
363 $ cd p2-succ-is-dest
321
364
322 $ hg debugdrawdag <<EOF
365 $ hg debugdrawdag <<EOF
323 > F
366 > F
324 > /|
367 > /|
325 > E D B # replace: E -> B
368 > E D B # replace: E -> B
326 > \|/
369 > \|/
327 > A
370 > A
328 > EOF
371 > EOF
329 1 new orphan changesets
372 1 new orphan changesets
330
373
331 $ hg rebase -d B -s E
374 $ hg rebase -d B -s E
332 note: not rebasing 3:7fb047a69f22 E "E", already in destination as 1:112478962961 B "B"
375 note: not rebasing 3:7fb047a69f22 E "E", already in destination as 1:112478962961 B "B"
333 rebasing 4:66f1a38021c9 F tip "F"
376 rebasing 4:66f1a38021c9 F tip "F"
334 $ hg log -G
377 $ hg log -G
335 o 5:aae1787dacee F
378 o 5:aae1787dacee F
336 |\
379 |\
337 | | x 4:66f1a38021c9 F (rewritten using rebase as 5:aae1787dacee)
380 | | x 4:66f1a38021c9 F (rewritten using rebase as 5:aae1787dacee)
338 | |/|
381 | |/|
339 | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961)
382 | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961)
340 | | |
383 | | |
341 | o | 2:b18e25de2cf5 D
384 | o | 2:b18e25de2cf5 D
342 | |/
385 | |/
343 o / 1:112478962961 B
386 o / 1:112478962961 B
344 |/
387 |/
345 o 0:426bada5c675 A
388 o 0:426bada5c675 A
346
389
347 $ cd ..
390 $ cd ..
348
391
349 Rebase merge where successor of one parent is ancestor of destination
392 Rebase merge where successor of one parent is ancestor of destination
350
393
351 $ hg init p1-succ-in-dest
394 $ hg init p1-succ-in-dest
352 $ cd p1-succ-in-dest
395 $ cd p1-succ-in-dest
353
396
354 $ hg debugdrawdag <<EOF
397 $ hg debugdrawdag <<EOF
355 > F C
398 > F C
356 > /| |
399 > /| |
357 > E D B # replace: D -> B
400 > E D B # replace: D -> B
358 > \|/
401 > \|/
359 > A
402 > A
360 > EOF
403 > EOF
361 1 new orphan changesets
404 1 new orphan changesets
362
405
363 $ hg rebase -d C -s D
406 $ hg rebase -d C -s D
364 note: not rebasing 2:b18e25de2cf5 D "D", already in destination as 1:112478962961 B "B"
407 note: not rebasing 2:b18e25de2cf5 D "D", already in destination as 1:112478962961 B "B"
365 rebasing 5:66f1a38021c9 F tip "F"
408 rebasing 5:66f1a38021c9 F tip "F"
366
409
367 $ hg log -G
410 $ hg log -G
368 o 6:0913febf6439 F
411 o 6:0913febf6439 F
369 |\
412 |\
370 +---x 5:66f1a38021c9 F (rewritten using rebase as 6:0913febf6439)
413 +---x 5:66f1a38021c9 F (rewritten using rebase as 6:0913febf6439)
371 | | |
414 | | |
372 | o | 4:26805aba1e60 C
415 | o | 4:26805aba1e60 C
373 | | |
416 | | |
374 o | | 3:7fb047a69f22 E
417 o | | 3:7fb047a69f22 E
375 | | |
418 | | |
376 +---x 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961)
419 +---x 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961)
377 | |
420 | |
378 | o 1:112478962961 B
421 | o 1:112478962961 B
379 |/
422 |/
380 o 0:426bada5c675 A
423 o 0:426bada5c675 A
381
424
382 $ cd ..
425 $ cd ..
383
426
384 Rebase merge where successor of other parent is ancestor of destination
427 Rebase merge where successor of other parent is ancestor of destination
385
428
386 $ hg init p2-succ-in-dest
429 $ hg init p2-succ-in-dest
387 $ cd p2-succ-in-dest
430 $ cd p2-succ-in-dest
388
431
389 $ hg debugdrawdag <<EOF
432 $ hg debugdrawdag <<EOF
390 > F C
433 > F C
391 > /| |
434 > /| |
392 > E D B # replace: E -> B
435 > E D B # replace: E -> B
393 > \|/
436 > \|/
394 > A
437 > A
395 > EOF
438 > EOF
396 1 new orphan changesets
439 1 new orphan changesets
397
440
398 $ hg rebase -d C -s E
441 $ hg rebase -d C -s E
399 note: not rebasing 3:7fb047a69f22 E "E", already in destination as 1:112478962961 B "B"
442 note: not rebasing 3:7fb047a69f22 E "E", already in destination as 1:112478962961 B "B"
400 rebasing 5:66f1a38021c9 F tip "F"
443 rebasing 5:66f1a38021c9 F tip "F"
401 $ hg log -G
444 $ hg log -G
402 o 6:c6ab0cc6d220 F
445 o 6:c6ab0cc6d220 F
403 |\
446 |\
404 +---x 5:66f1a38021c9 F (rewritten using rebase as 6:c6ab0cc6d220)
447 +---x 5:66f1a38021c9 F (rewritten using rebase as 6:c6ab0cc6d220)
405 | | |
448 | | |
406 | o | 4:26805aba1e60 C
449 | o | 4:26805aba1e60 C
407 | | |
450 | | |
408 | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961)
451 | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961)
409 | | |
452 | | |
410 o---+ 2:b18e25de2cf5 D
453 o---+ 2:b18e25de2cf5 D
411 / /
454 / /
412 o / 1:112478962961 B
455 o / 1:112478962961 B
413 |/
456 |/
414 o 0:426bada5c675 A
457 o 0:426bada5c675 A
415
458
416 $ cd ..
459 $ cd ..
417
460
418 Rebase merge where successor of one parent is ancestor of destination
461 Rebase merge where successor of one parent is ancestor of destination
419
462
420 $ hg init p1-succ-in-dest-b
463 $ hg init p1-succ-in-dest-b
421 $ cd p1-succ-in-dest-b
464 $ cd p1-succ-in-dest-b
422
465
423 $ hg debugdrawdag <<EOF
466 $ hg debugdrawdag <<EOF
424 > F C
467 > F C
425 > /| |
468 > /| |
426 > E D B # replace: E -> B
469 > E D B # replace: E -> B
427 > \|/
470 > \|/
428 > A
471 > A
429 > EOF
472 > EOF
430 1 new orphan changesets
473 1 new orphan changesets
431
474
432 $ hg rebase -d C -b F
475 $ hg rebase -d C -b F
433 rebasing 2:b18e25de2cf5 D "D"
476 rebasing 2:b18e25de2cf5 D "D"
434 note: not rebasing 3:7fb047a69f22 E "E", already in destination as 1:112478962961 B "B"
477 note: not rebasing 3:7fb047a69f22 E "E", already in destination as 1:112478962961 B "B"
435 rebasing 5:66f1a38021c9 F tip "F"
478 rebasing 5:66f1a38021c9 F tip "F"
436 note: not rebasing 5:66f1a38021c9 F tip "F", its destination already has all its changes
479 note: not rebasing 5:66f1a38021c9 F tip "F", its destination already has all its changes
437 $ hg log -G
480 $ hg log -G
438 o 6:8f47515dda15 D
481 o 6:8f47515dda15 D
439 |
482 |
440 | x 5:66f1a38021c9 F (pruned using rebase)
483 | x 5:66f1a38021c9 F (pruned using rebase)
441 | |\
484 | |\
442 o | | 4:26805aba1e60 C
485 o | | 4:26805aba1e60 C
443 | | |
486 | | |
444 | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961)
487 | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961)
445 | | |
488 | | |
446 | x | 2:b18e25de2cf5 D (rewritten using rebase as 6:8f47515dda15)
489 | x | 2:b18e25de2cf5 D (rewritten using rebase as 6:8f47515dda15)
447 | |/
490 | |/
448 o / 1:112478962961 B
491 o / 1:112478962961 B
449 |/
492 |/
450 o 0:426bada5c675 A
493 o 0:426bada5c675 A
451
494
452 $ cd ..
495 $ cd ..
453
496
454 Rebase merge where successor of other parent is ancestor of destination
497 Rebase merge where successor of other parent is ancestor of destination
455
498
456 $ hg init p2-succ-in-dest-b
499 $ hg init p2-succ-in-dest-b
457 $ cd p2-succ-in-dest-b
500 $ cd p2-succ-in-dest-b
458
501
459 $ hg debugdrawdag <<EOF
502 $ hg debugdrawdag <<EOF
460 > F C
503 > F C
461 > /| |
504 > /| |
462 > E D B # replace: D -> B
505 > E D B # replace: D -> B
463 > \|/
506 > \|/
464 > A
507 > A
465 > EOF
508 > EOF
466 1 new orphan changesets
509 1 new orphan changesets
467
510
468 $ hg rebase -d C -b F
511 $ hg rebase -d C -b F
469 note: not rebasing 2:b18e25de2cf5 D "D", already in destination as 1:112478962961 B "B"
512 note: not rebasing 2:b18e25de2cf5 D "D", already in destination as 1:112478962961 B "B"
470 rebasing 3:7fb047a69f22 E "E"
513 rebasing 3:7fb047a69f22 E "E"
471 rebasing 5:66f1a38021c9 F tip "F"
514 rebasing 5:66f1a38021c9 F tip "F"
472 note: not rebasing 5:66f1a38021c9 F tip "F", its destination already has all its changes
515 note: not rebasing 5:66f1a38021c9 F tip "F", its destination already has all its changes
473
516
474 $ hg log -G
517 $ hg log -G
475 o 6:533690786a86 E
518 o 6:533690786a86 E
476 |
519 |
477 | x 5:66f1a38021c9 F (pruned using rebase)
520 | x 5:66f1a38021c9 F (pruned using rebase)
478 | |\
521 | |\
479 o | | 4:26805aba1e60 C
522 o | | 4:26805aba1e60 C
480 | | |
523 | | |
481 | | x 3:7fb047a69f22 E (rewritten using rebase as 6:533690786a86)
524 | | x 3:7fb047a69f22 E (rewritten using rebase as 6:533690786a86)
482 | | |
525 | | |
483 | x | 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961)
526 | x | 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961)
484 | |/
527 | |/
485 o / 1:112478962961 B
528 o / 1:112478962961 B
486 |/
529 |/
487 o 0:426bada5c675 A
530 o 0:426bada5c675 A
488
531
489 $ cd ..
532 $ cd ..
490
533
491 Rebase merge where extinct node has successor that is not an ancestor of
534 Rebase merge where extinct node has successor that is not an ancestor of
492 destination
535 destination
493
536
494 $ hg init extinct-with-succ-not-in-dest
537 $ hg init extinct-with-succ-not-in-dest
495 $ cd extinct-with-succ-not-in-dest
538 $ cd extinct-with-succ-not-in-dest
496
539
497 $ hg debugdrawdag <<EOF
540 $ hg debugdrawdag <<EOF
498 > E C # replace: C -> E
541 > E C # replace: C -> E
499 > | |
542 > | |
500 > D B
543 > D B
501 > |/
544 > |/
502 > A
545 > A
503 > EOF
546 > EOF
504
547
505 $ hg rebase -d D -s B
548 $ hg rebase -d D -s B
506 rebasing 1:112478962961 B "B"
549 rebasing 1:112478962961 B "B"
507 note: not rebasing 3:26805aba1e60 C "C" and its descendants as this would cause divergence
550 note: not rebasing 3:26805aba1e60 C "C" and its descendants as this would cause divergence
508
551
509 $ cd ..
552 $ cd ..
510
553
511 $ hg init p2-succ-in-dest-c
554 $ hg init p2-succ-in-dest-c
512 $ cd p2-succ-in-dest-c
555 $ cd p2-succ-in-dest-c
513
556
514 The scenario here was that B::D were developed on default. B was queued on
557 The scenario here was that B::D were developed on default. B was queued on
515 stable, but amended before being push to hg-committed. C was queued on default,
558 stable, but amended before being push to hg-committed. C was queued on default,
516 along with unrelated J.
559 along with unrelated J.
517
560
518 $ hg debugdrawdag <<EOF
561 $ hg debugdrawdag <<EOF
519 > J
562 > J
520 > |
563 > |
521 > F
564 > F
522 > |
565 > |
523 > E
566 > E
524 > | D
567 > | D
525 > | |
568 > | |
526 > | C # replace: C -> F
569 > | C # replace: C -> F
527 > | | H I # replace: B -> H -> I
570 > | | H I # replace: B -> H -> I
528 > | B |/
571 > | B |/
529 > |/ G
572 > |/ G
530 > A
573 > A
531 > EOF
574 > EOF
532 1 new orphan changesets
575 1 new orphan changesets
533
576
534 This strip seems to be the key to avoid an early divergence warning.
577 This strip seems to be the key to avoid an early divergence warning.
535 $ hg --config extensions.strip= --hidden strip -qr H
578 $ hg --config extensions.strip= --hidden strip -qr H
536 1 new orphan changesets
579 1 new orphan changesets
537
580
538 $ hg rebase -b 'desc("D")' -d 'desc("J")'
581 $ hg rebase -b 'desc("D")' -d 'desc("J")'
539 abort: this rebase will cause divergences from: 112478962961
582 abort: this rebase will cause divergences from: 112478962961
540 (to force the rebase please set experimental.evolution.allowdivergence=True)
583 (to force the rebase please set experimental.evolution.allowdivergence=True)
541 [20]
584 [20]
542
585
543 Rebase merge where both parents have successors in destination
586 Rebase merge where both parents have successors in destination
544
587
545 $ hg init p12-succ-in-dest
588 $ hg init p12-succ-in-dest
546 $ cd p12-succ-in-dest
589 $ cd p12-succ-in-dest
547 $ hg debugdrawdag <<'EOS'
590 $ hg debugdrawdag <<'EOS'
548 > E F
591 > E F
549 > /| /| # replace: A -> C
592 > /| /| # replace: A -> C
550 > A B C D # replace: B -> D
593 > A B C D # replace: B -> D
551 > | |
594 > | |
552 > X Y
595 > X Y
553 > EOS
596 > EOS
554 1 new orphan changesets
597 1 new orphan changesets
555 $ hg rebase -r A+B+E -d F
598 $ hg rebase -r A+B+E -d F
556 note: not rebasing 4:a3d17304151f A "A", already in destination as 0:96cc3511f894 C "C"
599 note: not rebasing 4:a3d17304151f A "A", already in destination as 0:96cc3511f894 C "C"
557 note: not rebasing 5:b23a2cc00842 B "B", already in destination as 1:058c1e1fb10a D "D"
600 note: not rebasing 5:b23a2cc00842 B "B", already in destination as 1:058c1e1fb10a D "D"
558 rebasing 7:dac5d11c5a7d E tip "E"
601 rebasing 7:dac5d11c5a7d E tip "E"
559 abort: rebasing 7:dac5d11c5a7d will include unwanted changes from 3:59c792af609c, 5:b23a2cc00842 or 2:ba2b7fa7166d, 4:a3d17304151f
602 abort: rebasing 7:dac5d11c5a7d will include unwanted changes from 3:59c792af609c, 5:b23a2cc00842 or 2:ba2b7fa7166d, 4:a3d17304151f
560 [10]
603 [10]
561 $ cd ..
604 $ cd ..
562
605
563 Rebase a non-clean merge. One parent has successor in destination, the other
606 Rebase a non-clean merge. One parent has successor in destination, the other
564 parent moves as requested.
607 parent moves as requested.
565
608
566 $ hg init p1-succ-p2-move
609 $ hg init p1-succ-p2-move
567 $ cd p1-succ-p2-move
610 $ cd p1-succ-p2-move
568 $ hg debugdrawdag <<'EOS'
611 $ hg debugdrawdag <<'EOS'
569 > D Z
612 > D Z
570 > /| | # replace: A -> C
613 > /| | # replace: A -> C
571 > A B C # D/D = D
614 > A B C # D/D = D
572 > EOS
615 > EOS
573 1 new orphan changesets
616 1 new orphan changesets
574 $ hg rebase -r A+B+D -d Z
617 $ hg rebase -r A+B+D -d Z
575 note: not rebasing 0:426bada5c675 A "A", already in destination as 2:96cc3511f894 C "C"
618 note: not rebasing 0:426bada5c675 A "A", already in destination as 2:96cc3511f894 C "C"
576 rebasing 1:fc2b737bb2e5 B "B"
619 rebasing 1:fc2b737bb2e5 B "B"
577 rebasing 3:b8ed089c80ad D "D"
620 rebasing 3:b8ed089c80ad D "D"
578
621
579 $ rm .hg/localtags
622 $ rm .hg/localtags
580 $ hg log -G
623 $ hg log -G
581 o 6:e4f78693cc88 D
624 o 6:e4f78693cc88 D
582 |
625 |
583 o 5:76840d832e98 B
626 o 5:76840d832e98 B
584 |
627 |
585 o 4:50e41c1f3950 Z
628 o 4:50e41c1f3950 Z
586 |
629 |
587 o 2:96cc3511f894 C
630 o 2:96cc3511f894 C
588
631
589 $ hg files -r tip
632 $ hg files -r tip
590 B
633 B
591 C
634 C
592 D
635 D
593 Z
636 Z
594
637
595 $ cd ..
638 $ cd ..
596
639
597 $ hg init p1-move-p2-succ
640 $ hg init p1-move-p2-succ
598 $ cd p1-move-p2-succ
641 $ cd p1-move-p2-succ
599 $ hg debugdrawdag <<'EOS'
642 $ hg debugdrawdag <<'EOS'
600 > D Z
643 > D Z
601 > /| | # replace: B -> C
644 > /| | # replace: B -> C
602 > A B C # D/D = D
645 > A B C # D/D = D
603 > EOS
646 > EOS
604 1 new orphan changesets
647 1 new orphan changesets
605 $ hg rebase -r B+A+D -d Z
648 $ hg rebase -r B+A+D -d Z
606 rebasing 0:426bada5c675 A "A"
649 rebasing 0:426bada5c675 A "A"
607 note: not rebasing 1:fc2b737bb2e5 B "B", already in destination as 2:96cc3511f894 C "C"
650 note: not rebasing 1:fc2b737bb2e5 B "B", already in destination as 2:96cc3511f894 C "C"
608 rebasing 3:b8ed089c80ad D "D"
651 rebasing 3:b8ed089c80ad D "D"
609
652
610 $ rm .hg/localtags
653 $ rm .hg/localtags
611 $ hg log -G
654 $ hg log -G
612 o 6:1b355ed94d82 D
655 o 6:1b355ed94d82 D
613 |
656 |
614 o 5:a81a74d764a6 A
657 o 5:a81a74d764a6 A
615 |
658 |
616 o 4:50e41c1f3950 Z
659 o 4:50e41c1f3950 Z
617 |
660 |
618 o 2:96cc3511f894 C
661 o 2:96cc3511f894 C
619
662
620 $ hg files -r tip
663 $ hg files -r tip
621 A
664 A
622 C
665 C
623 D
666 D
624 Z
667 Z
625
668
626 $ cd ..
669 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now