Show More
This diff has been collapsed as it changes many lines, (653 lines changed) Show them Hide them | |||||
@@ -2,6 +2,7 b'' | |||||
2 | > [extensions] |
|
2 | > [extensions] | |
3 | > rebase= |
|
3 | > rebase= | |
4 | > mq= |
|
4 | > mq= | |
|
5 | > drawdag=$TESTDIR/drawdag.py | |||
5 | > |
|
6 | > | |
6 | > [phases] |
|
7 | > [phases] | |
7 | > publish=False |
|
8 | > publish=False | |
@@ -11,47 +12,21 b'' | |||||
11 | > tglogp = log -G --template "{rev}: {node|short} {phase} '{desc}' {branches}\n" |
|
12 | > tglogp = log -G --template "{rev}: {node|short} {phase} '{desc}' {branches}\n" | |
12 | > EOF |
|
13 | > EOF | |
13 |
|
14 | |||
14 | Create repo a: |
|
15 | Highest phase of source commits is used: | |
15 |
|
||||
16 | $ hg init a |
|
|||
17 | $ cd a |
|
|||
18 | $ hg unbundle "$TESTDIR/bundles/rebase.hg" |
|
|||
19 | adding changesets |
|
|||
20 | adding manifests |
|
|||
21 | adding file changes |
|
|||
22 | added 8 changesets with 7 changes to 7 files (+2 heads) |
|
|||
23 | new changesets cd010b8cd998:02de42196ebe |
|
|||
24 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
|||
25 | $ hg up tip |
|
|||
26 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
27 |
|
16 | |||
28 | $ hg tglog |
|
17 | $ hg init phase | |
29 | @ 7: 02de42196ebe 'H' |
|
18 | $ cd phase | |
30 | | |
|
19 | $ hg debugdrawdag << 'EOF' | |
31 | | o 6: eea13746799a 'G' |
|
20 | > D | |
32 | |/| |
|
21 | > | | |
33 | o | 5: 24b6387c8c8c 'F' |
|
22 | > F C | |
34 | | | |
|
23 | > | | | |
35 | | o 4: 9520eea781bc 'E' |
|
24 | > E B | |
36 | |/ |
|
25 | > |/ | |
37 | | o 3: 32af7686d403 'D' |
|
26 | > A | |
38 | | | |
|
27 | > EOF | |
39 | | o 2: 5fddd98957c8 'C' |
|
|||
40 | | | |
|
|||
41 | | o 1: 42ccdea3bb16 'B' |
|
|||
42 | |/ |
|
|||
43 | o 0: cd010b8cd998 'A' |
|
|||
44 |
|
||||
45 | $ cd .. |
|
|||
46 |
|
28 | |||
47 |
|
29 | $ hg phase --force --secret D | ||
48 | Rebasing B onto H and collapsing changesets with different phases: |
|
|||
49 |
|
||||
50 |
|
||||
51 | $ hg clone -q -u 3 a a1 |
|
|||
52 | $ cd a1 |
|
|||
53 |
|
||||
54 | $ hg phase --force --secret 3 |
|
|||
55 |
|
30 | |||
56 | $ cat > $TESTTMP/editor.sh <<EOF |
|
31 | $ cat > $TESTTMP/editor.sh <<EOF | |
57 | > echo "==== before editing" |
|
32 | > echo "==== before editing" | |
@@ -59,10 +34,10 b' Rebasing B onto H and collapsing changes' | |||||
59 | > echo "====" |
|
34 | > echo "====" | |
60 | > echo "edited manually" >> \$1 |
|
35 | > echo "edited manually" >> \$1 | |
61 | > EOF |
|
36 | > EOF | |
62 |
$ HGEDITOR="sh $TESTTMP/editor.sh" hg rebase --collapse --keepbranches -e --dest |
|
37 | $ HGEDITOR="sh $TESTTMP/editor.sh" hg rebase --collapse --keepbranches -e --dest F | |
63 |
rebasing 1:42 |
|
38 | rebasing 1:112478962961 "B" (B) | |
64 | rebasing 2:5fddd98957c8 "C" |
|
39 | rebasing 3:26805aba1e60 "C" (C) | |
65 | rebasing 3:32af7686d403 "D" |
|
40 | rebasing 5:f585351a92f8 "D" (D tip) | |
66 | ==== before editing |
|
41 | ==== before editing | |
67 | Collapsed revision |
|
42 | Collapsed revision | |
68 | * B |
|
43 | * B | |
@@ -73,84 +48,91 b' Rebasing B onto H and collapsing changes' | |||||
73 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
48 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
74 | HG: Leave message empty to abort commit. |
|
49 | HG: Leave message empty to abort commit. | |
75 | HG: -- |
|
50 | HG: -- | |
76 | HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com> |
|
51 | HG: user: test | |
77 | HG: branch 'default' |
|
52 | HG: branch 'default' | |
78 | HG: added B |
|
53 | HG: added B | |
79 | HG: added C |
|
54 | HG: added C | |
80 | HG: added D |
|
55 | HG: added D | |
81 | ==== |
|
56 | ==== | |
82 |
saved backup bundle to $TESTTMP/ |
|
57 | saved backup bundle to $TESTTMP/phase/.hg/strip-backup/112478962961-cb2a9b47-rebase.hg | |
83 |
|
58 | |||
84 | $ hg tglogp |
|
59 | $ hg tglogp | |
85 |
|
|
60 | o 3: 92fa5f5fe108 secret 'Collapsed revision | |
86 | | * B |
|
61 | | * B | |
87 | | * C |
|
62 | | * C | |
88 | | * D |
|
63 | | * D | |
89 | | |
|
64 | | | |
90 | | |
|
65 | | | |
91 | | edited manually' |
|
66 | | edited manually' | |
92 |
o |
|
67 | o 2: 64a8289d2492 draft 'F' | |
93 | | |
|
68 | | | |
94 |
|
|
69 | o 1: 7fb047a69f22 draft 'E' | |
95 |
| |
|
70 | | | |
96 |
o |
|
71 | o 0: 426bada5c675 draft 'A' | |
97 | | | |
|
|||
98 | | o 1: 9520eea781bc draft 'E' |
|
|||
99 | |/ |
|
|||
100 | o 0: cd010b8cd998 draft 'A' |
|
|||
101 |
|
72 | |||
102 | $ hg manifest --rev tip |
|
73 | $ hg manifest --rev tip | |
103 | A |
|
74 | A | |
104 | B |
|
75 | B | |
105 | C |
|
76 | C | |
106 | D |
|
77 | D | |
|
78 | E | |||
107 | F |
|
79 | F | |
108 | H |
|
|||
109 |
|
80 | |||
110 | $ cd .. |
|
81 | $ cd .. | |
111 |
|
82 | |||
112 |
|
83 | |||
113 | Rebasing E onto H: |
|
84 | Merge gets linearized: | |
114 |
|
85 | |||
115 | $ hg clone -q -u . a a2 |
|
86 | $ hg init linearized-merge | |
116 | $ cd a2 |
|
87 | $ cd linearized-merge | |
117 |
|
88 | |||
118 | $ hg phase --force --secret 6 |
|
89 | $ hg debugdrawdag << 'EOF' | |
119 | $ hg rebase --source 4 --collapse --dest 7 |
|
90 | > F D | |
120 | rebasing 4:9520eea781bc "E" |
|
91 | > |/| | |
121 | rebasing 6:eea13746799a "G" |
|
92 | > C B | |
122 | saved backup bundle to $TESTTMP/a2/.hg/strip-backup/9520eea781bc-fcd8edd4-rebase.hg |
|
93 | > |/ | |
|
94 | > A | |||
|
95 | > EOF | |||
|
96 | ||||
|
97 | $ hg phase --force --secret D | |||
|
98 | $ hg rebase --source B --collapse --dest F | |||
|
99 | rebasing 1:112478962961 "B" (B) | |||
|
100 | rebasing 3:4e4f9194f9f1 "D" (D) | |||
|
101 | saved backup bundle to $TESTTMP/linearized-merge/.hg/strip-backup/112478962961-e389075b-rebase.hg | |||
123 |
|
102 | |||
124 | $ hg tglog |
|
103 | $ hg tglog | |
125 |
o |
|
104 | o 3: 5bdc08b7da2b 'Collapsed revision | |
126 |
| * |
|
105 | | * B | |
127 |
| * |
|
106 | | * D' | |
128 | @ 5: 02de42196ebe 'H' |
|
107 | o 2: afc707c82df0 'F' | |
129 | | |
|
|||
130 | o 4: 24b6387c8c8c 'F' |
|
|||
131 | | |
|
108 | | | |
132 | | o 3: 32af7686d403 'D' |
|
109 | o 1: dc0947a82db8 'C' | |
133 |
| |
|
110 | | | |
134 | | o 2: 5fddd98957c8 'C' |
|
111 | o 0: 426bada5c675 'A' | |
135 | | | |
|
|||
136 | | o 1: 42ccdea3bb16 'B' |
|
|||
137 | |/ |
|
|||
138 | o 0: cd010b8cd998 'A' |
|
|||
139 |
|
112 | |||
140 | $ hg manifest --rev tip |
|
113 | $ hg manifest --rev tip | |
141 | A |
|
114 | A | |
142 |
|
|
115 | B | |
|
116 | C | |||
143 | F |
|
117 | F | |
144 | H |
|
|||
145 |
|
118 | |||
146 | $ cd .. |
|
119 | $ cd .. | |
147 |
|
120 | |||
148 | Rebasing G onto H with custom message: |
|
121 | Custom message: | |
|
122 | ||||
|
123 | $ hg init message | |||
|
124 | $ cd message | |||
149 |
|
125 | |||
150 | $ hg clone -q -u . a a3 |
|
126 | $ hg debugdrawdag << 'EOF' | |
151 | $ cd a3 |
|
127 | > C | |
|
128 | > | | |||
|
129 | > D B | |||
|
130 | > |/ | |||
|
131 | > A | |||
|
132 | > EOF | |||
152 |
|
133 | |||
153 | $ hg rebase --base 6 -m 'custom message' |
|
134 | ||
|
135 | $ hg rebase --base B -m 'custom message' | |||
154 | abort: message can only be specified with collapse |
|
136 | abort: message can only be specified with collapse | |
155 | [255] |
|
137 | [255] | |
156 |
|
138 | |||
@@ -158,144 +140,77 b' Rebasing G onto H with custom message:' | |||||
158 | > env | grep HGEDITFORM |
|
140 | > env | grep HGEDITFORM | |
159 | > true |
|
141 | > true | |
160 | > EOF |
|
142 | > EOF | |
161 |
$ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg rebase --source |
|
143 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg rebase --source B --collapse -m 'custom message' -e --dest D | |
162 | rebasing 4:9520eea781bc "E" |
|
144 | rebasing 1:112478962961 "B" (B) | |
163 | rebasing 6:eea13746799a "G" |
|
145 | rebasing 3:26805aba1e60 "C" (C tip) | |
164 | HGEDITFORM=rebase.collapse |
|
146 | HGEDITFORM=rebase.collapse | |
165 |
saved backup bundle to $TESTTMP/ |
|
147 | saved backup bundle to $TESTTMP/message/.hg/strip-backup/112478962961-f4131707-rebase.hg | |
166 |
|
148 | |||
167 | $ hg tglog |
|
149 | $ hg tglog | |
168 |
o |
|
150 | o 2: 2f197b9a08f3 'custom message' | |
169 | | |
|
|||
170 | @ 5: 02de42196ebe 'H' |
|
|||
171 | | |
|
|||
172 | o 4: 24b6387c8c8c 'F' |
|
|||
173 | | |
|
151 | | | |
174 | | o 3: 32af7686d403 'D' |
|
152 | o 1: b18e25de2cf5 'D' | |
175 |
| |
|
153 | | | |
176 | | o 2: 5fddd98957c8 'C' |
|
154 | o 0: 426bada5c675 'A' | |
177 | | | |
|
|||
178 | | o 1: 42ccdea3bb16 'B' |
|
|||
179 | |/ |
|
|||
180 | o 0: cd010b8cd998 'A' |
|
|||
181 |
|
155 | |||
182 | $ hg manifest --rev tip |
|
156 | $ hg manifest --rev tip | |
183 | A |
|
157 | A | |
184 |
|
|
158 | B | |
185 |
|
|
159 | C | |
186 |
|
|
160 | D | |
187 |
|
161 | |||
188 | $ cd .. |
|
162 | $ cd .. | |
189 |
|
163 | |||
190 | Create repo b: |
|
|||
191 |
|
||||
192 | $ hg init b |
|
|||
193 | $ cd b |
|
|||
194 |
|
||||
195 | $ echo A > A |
|
|||
196 | $ hg ci -Am A |
|
|||
197 | adding A |
|
|||
198 | $ echo B > B |
|
|||
199 | $ hg ci -Am B |
|
|||
200 | adding B |
|
|||
201 |
|
||||
202 | $ hg up -q 0 |
|
|||
203 |
|
||||
204 | $ echo C > C |
|
|||
205 | $ hg ci -Am C |
|
|||
206 | adding C |
|
|||
207 | created new head |
|
|||
208 |
|
||||
209 | $ hg merge |
|
|||
210 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
211 | (branch merge, don't forget to commit) |
|
|||
212 |
|
||||
213 | $ echo D > D |
|
|||
214 | $ hg ci -Am D |
|
|||
215 | adding D |
|
|||
216 |
|
||||
217 | $ hg up -q 1 |
|
|||
218 |
|
||||
219 | $ echo E > E |
|
|||
220 | $ hg ci -Am E |
|
|||
221 | adding E |
|
|||
222 | created new head |
|
|||
223 |
|
||||
224 | $ echo F > F |
|
|||
225 | $ hg ci -Am F |
|
|||
226 | adding F |
|
|||
227 |
|
||||
228 | $ hg merge |
|
|||
229 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
230 | (branch merge, don't forget to commit) |
|
|||
231 | $ hg ci -m G |
|
|||
232 |
|
||||
233 | $ hg up -q 0 |
|
|||
234 |
|
||||
235 | $ echo H > H |
|
|||
236 | $ hg ci -Am H |
|
|||
237 | adding H |
|
|||
238 | created new head |
|
|||
239 |
|
||||
240 | $ hg tglog |
|
|||
241 | @ 7: c65502d41787 'H' |
|
|||
242 | | |
|
|||
243 | | o 6: c772a8b2dc17 'G' |
|
|||
244 | | |\ |
|
|||
245 | | | o 5: 7f219660301f 'F' |
|
|||
246 | | | | |
|
|||
247 | | | o 4: 8a5212ebc852 'E' |
|
|||
248 | | | | |
|
|||
249 | | o | 3: 2870ad076e54 'D' |
|
|||
250 | | |\| |
|
|||
251 | | o | 2: c5cefa58fd55 'C' |
|
|||
252 | |/ / |
|
|||
253 | | o 1: 27547f69f254 'B' |
|
|||
254 | |/ |
|
|||
255 | o 0: 4a2df7238c3b 'A' |
|
|||
256 |
|
||||
257 | $ cd .. |
|
|||
258 |
|
||||
259 |
|
||||
260 | Rebase and collapse - more than one external (fail): |
|
164 | Rebase and collapse - more than one external (fail): | |
261 |
|
165 | |||
262 | $ hg clone -q -u . b b1 |
|
166 | $ hg init multiple-external-parents | |
263 | $ cd b1 |
|
167 | $ cd multiple-external-parents | |
264 |
|
168 | |||
265 | $ hg rebase -s 2 --dest 7 --collapse |
|
169 | $ hg debugdrawdag << 'EOF' | |
266 | abort: unable to collapse on top of 7, there is more than one external parent: 1, 5 |
|
170 | > G | |
|
171 | > |\ | |||
|
172 | > | F | |||
|
173 | > | | | |||
|
174 | > D E | |||
|
175 | > |\| | |||
|
176 | > H C B | |||
|
177 | > \|/ | |||
|
178 | > A | |||
|
179 | > EOF | |||
|
180 | ||||
|
181 | $ hg rebase -s C --dest H --collapse | |||
|
182 | abort: unable to collapse on top of 3, there is more than one external parent: 1, 6 | |||
267 | [255] |
|
183 | [255] | |
268 |
|
184 | |||
269 | Rebase and collapse - E onto H: |
|
185 | Rebase and collapse - E onto H: | |
270 |
|
186 | |||
271 |
$ hg rebase -s |
|
187 | $ hg rebase -s E --dest I --collapse # root (E) is not a merge | |
272 | rebasing 4:8a5212ebc852 "E" |
|
188 | abort: unknown revision 'I'! | |
273 | rebasing 5:7f219660301f "F" |
|
189 | [255] | |
274 | rebasing 6:c772a8b2dc17 "G" |
|
|||
275 | saved backup bundle to $TESTTMP/b1/.hg/strip-backup/8a5212ebc852-75046b61-rebase.hg |
|
|||
276 |
|
190 | |||
277 | $ hg tglog |
|
191 | $ hg tglog | |
278 | o 5: f97c4725bd99 'Collapsed revision |
|
192 | o 7: 64e264db77f0 'G' | |
279 | |\ * E |
|
193 | |\ | |
280 | | | * F |
|
194 | | o 6: 11abe3fb10b8 'F' | |
281 |
|
|
195 | | | | |
282 | | @ 4: c65502d41787 'H' |
|
196 | | o 5: 49cb92066bfd 'E' | |
283 | | | |
|
197 | | | | |
284 | o | 3: 2870ad076e54 'D' |
|
198 | o | 4: 4e4f9194f9f1 'D' | |
285 |
|\ |
|
199 | |\| | |
286 | | o | 2: c5cefa58fd55 'C' |
|
200 | | | o 3: 575c4b5ec114 'H' | |
287 |
| | |
|
201 | | | | | |
288 | o / 1: 27547f69f254 'B' |
|
202 | o---+ 2: dc0947a82db8 'C' | |
|
203 | / / | |||
|
204 | o / 1: 112478962961 'B' | |||
289 | |/ |
|
205 | |/ | |
290 |
o 0: 4 |
|
206 | o 0: 426bada5c675 'A' | |
291 |
|
207 | |||
292 | $ hg manifest --rev tip |
|
208 | $ hg manifest --rev tip | |
293 | A |
|
209 | A | |
|
210 | B | |||
294 | C |
|
211 | C | |
295 | D |
|
|||
296 | E |
|
212 | E | |
297 | F |
|
213 | F | |
298 | H |
|
|||
299 |
|
214 | |||
300 | $ cd .. |
|
215 | $ cd .. | |
301 |
|
216 | |||
@@ -308,146 +223,98 b' the parent of a node that is a child of ' | |||||
308 | 3). The code is now much simpler and we could just test a simpler scenario |
|
223 | 3). The code is now much simpler and we could just test a simpler scenario | |
309 | We keep it the test this way in case new complexity is injected. |
|
224 | We keep it the test this way in case new complexity is injected. | |
310 |
|
225 | |||
311 | $ hg clone -q -u . b b2 |
|
226 | Create repo b: | |
312 | $ cd b2 |
|
227 | ||
|
228 | $ hg init branch-heads | |||
|
229 | $ cd branch-heads | |||
|
230 | ||||
|
231 | $ hg debugdrawdag << 'EOF' | |||
|
232 | > G | |||
|
233 | > |\ | |||
|
234 | > | F | |||
|
235 | > | | | |||
|
236 | > D E | |||
|
237 | > |\| | |||
|
238 | > H C B | |||
|
239 | > \|/ | |||
|
240 | > A | |||
|
241 | > EOF | |||
313 |
|
242 | |||
314 | $ hg heads --template="{rev}:{node} {branch}\n" |
|
243 | $ hg heads --template="{rev}:{node} {branch}\n" | |
315 | 7:c65502d4178782309ce0574c5ae6ee9485a9bafa default |
|
244 | 7:64e264db77f061f16d9132b70c5a58e2461fb630 default | |
316 | 6:c772a8b2dc17629cec88a19d09c926c4814b12c7 default |
|
245 | 3:575c4b5ec114d64b681d33f8792853568bfb2b2c default | |
317 |
|
246 | |||
318 |
$ cat $TESTTMP/b |
|
247 | $ cat $TESTTMP/branch-heads/.hg/cache/branch2-served | |
319 | c65502d4178782309ce0574c5ae6ee9485a9bafa 7 |
|
248 | 64e264db77f061f16d9132b70c5a58e2461fb630 7 | |
320 | c772a8b2dc17629cec88a19d09c926c4814b12c7 o default |
|
249 | 575c4b5ec114d64b681d33f8792853568bfb2b2c o default | |
321 | c65502d4178782309ce0574c5ae6ee9485a9bafa o default |
|
250 | 64e264db77f061f16d9132b70c5a58e2461fb630 o default | |
322 |
|
251 | |||
323 | $ hg strip 4 |
|
252 | $ hg strip 4 | |
324 |
saved backup bundle to $TESTTMP/b |
|
253 | saved backup bundle to $TESTTMP/branch-heads/.hg/strip-backup/4e4f9194f9f1-5ec4b5e6-backup.hg | |
325 |
|
254 | |||
326 |
$ cat $TESTTMP/b |
|
255 | $ cat $TESTTMP/branch-heads/.hg/cache/branch2-served | |
327 | c65502d4178782309ce0574c5ae6ee9485a9bafa 4 |
|
256 | 11abe3fb10b8689b560681094b17fe161871d043 5 | |
328 | 2870ad076e541e714f3c2bc32826b5c6a6e5b040 o default |
|
257 | dc0947a82db884575bb76ea10ac97b08536bfa03 o default | |
329 | c65502d4178782309ce0574c5ae6ee9485a9bafa o default |
|
258 | 575c4b5ec114d64b681d33f8792853568bfb2b2c o default | |
|
259 | 11abe3fb10b8689b560681094b17fe161871d043 o default | |||
330 |
|
260 | |||
331 | $ hg heads --template="{rev}:{node} {branch}\n" |
|
261 | $ hg heads --template="{rev}:{node} {branch}\n" | |
332 | 4:c65502d4178782309ce0574c5ae6ee9485a9bafa default |
|
262 | 5:11abe3fb10b8689b560681094b17fe161871d043 default | |
333 | 3:2870ad076e541e714f3c2bc32826b5c6a6e5b040 default |
|
263 | 3:575c4b5ec114d64b681d33f8792853568bfb2b2c default | |
|
264 | 2:dc0947a82db884575bb76ea10ac97b08536bfa03 default | |||
334 |
|
265 | |||
335 | $ cd .. |
|
266 | $ cd .. | |
336 |
|
267 | |||
337 |
|
268 | |||
338 |
|
269 | |||
339 |
|
270 | Preserves external parent | ||
340 |
|
||||
341 |
|
||||
342 | Create repo c: |
|
|||
343 |
|
||||
344 | $ hg init c |
|
|||
345 | $ cd c |
|
|||
346 |
|
271 | |||
347 | $ echo A > A |
|
272 | $ hg init external-parent | |
348 | $ hg ci -Am A |
|
273 | $ cd external-parent | |
349 | adding A |
|
|||
350 | $ echo B > B |
|
|||
351 | $ hg ci -Am B |
|
|||
352 | adding B |
|
|||
353 |
|
||||
354 | $ hg up -q 0 |
|
|||
355 |
|
||||
356 | $ echo C > C |
|
|||
357 | $ hg ci -Am C |
|
|||
358 | adding C |
|
|||
359 | created new head |
|
|||
360 |
|
||||
361 | $ hg merge |
|
|||
362 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
363 | (branch merge, don't forget to commit) |
|
|||
364 |
|
274 | |||
365 | $ echo D > D |
|
275 | $ hg debugdrawdag << 'EOF' | |
366 | $ hg ci -Am D |
|
276 | > H | |
367 | adding D |
|
277 | > |\ | |
368 |
|
278 | > | G | ||
369 | $ hg up -q 1 |
|
279 | > | | | |
370 |
|
280 | > | F # F/E = F\n | ||
371 | $ echo E > E |
|
281 | > | | | |
372 | $ hg ci -Am E |
|
282 | > D E # D/D = D\n | |
373 | adding E |
|
283 | > |\| | |
374 | created new head |
|
284 | > I C B | |
375 | $ echo F > E |
|
285 | > \|/ | |
376 | $ hg ci -m 'F' |
|
286 | > A | |
|
287 | > EOF | |||
377 |
|
288 | |||
378 | $ echo G > G |
|
289 | $ hg rebase -s F --dest I --collapse # root (F) is not a merge | |
379 | $ hg ci -Am G |
|
290 | rebasing 6:c82b08f646f1 "F" (F) | |
380 | adding G |
|
291 | rebasing 7:a6db7fa104e1 "G" (G) | |
381 |
|
292 | rebasing 8:e1d201b72d91 "H" (H tip) | ||
382 | $ hg merge |
|
293 | saved backup bundle to $TESTTMP/external-parent/.hg/strip-backup/c82b08f646f1-f2721fbf-rebase.hg | |
383 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
384 | (branch merge, don't forget to commit) |
|
|||
385 |
|
||||
386 | $ hg ci -m H |
|
|||
387 |
|
||||
388 | $ hg up -q 0 |
|
|||
389 |
|
||||
390 | $ echo I > I |
|
|||
391 | $ hg ci -Am I |
|
|||
392 | adding I |
|
|||
393 | created new head |
|
|||
394 |
|
294 | |||
395 | $ hg tglog |
|
295 | $ hg tglog | |
396 | @ 8: 46d6f0e29c20 'I' |
|
296 | o 6: 681daa3e686d 'Collapsed revision | |
397 | | |
|
297 | |\ * F | |
398 | | o 7: 417d3b648079 'H' |
|
|||
399 | | |\ |
|
|||
400 | | | o 6: 55a44ad28289 'G' |
|
|||
401 | | | | |
|
|||
402 | | | o 5: dca5924bb570 'F' |
|
|||
403 | | | | |
|
|||
404 | | | o 4: 8a5212ebc852 'E' |
|
|||
405 | | | | |
|
|||
406 | | o | 3: 2870ad076e54 'D' |
|
|||
407 | | |\| |
|
|||
408 | | o | 2: c5cefa58fd55 'C' |
|
|||
409 | |/ / |
|
|||
410 | | o 1: 27547f69f254 'B' |
|
|||
411 | |/ |
|
|||
412 | o 0: 4a2df7238c3b 'A' |
|
|||
413 |
|
||||
414 | $ cd .. |
|
|||
415 |
|
||||
416 |
|
||||
417 | Rebase and collapse - E onto I: |
|
|||
418 |
|
||||
419 | $ hg clone -q -u . c c1 |
|
|||
420 | $ cd c1 |
|
|||
421 |
|
||||
422 | $ hg rebase -s 4 --dest 8 --collapse # root (4) is not a merge |
|
|||
423 | rebasing 4:8a5212ebc852 "E" |
|
|||
424 | rebasing 5:dca5924bb570 "F" |
|
|||
425 | merging E |
|
|||
426 | rebasing 6:55a44ad28289 "G" |
|
|||
427 | rebasing 7:417d3b648079 "H" |
|
|||
428 | saved backup bundle to $TESTTMP/c1/.hg/strip-backup/8a5212ebc852-f95d0879-rebase.hg |
|
|||
429 |
|
||||
430 | $ hg tglog |
|
|||
431 | o 5: 340b34a63b39 'Collapsed revision |
|
|||
432 | |\ * E |
|
|||
433 | | | * F |
|
|||
434 | | | * G |
|
298 | | | * G | |
435 | | | * H' |
|
299 | | | * H' | |
436 | | @ 4: 46d6f0e29c20 'I' |
|
300 | | | o 5: 49cb92066bfd 'E' | |
437 | | | |
|
301 | | | | | |
438 | o | 3: 2870ad076e54 'D' |
|
302 | | o | 4: 09143c0bf13e 'D' | |
439 |
| |
|
303 | | |\| | |
440 | | o | 2: c5cefa58fd55 'C' |
|
304 | o | | 3: 08ebfeb61bac 'I' | |
441 |
| | |
|
305 | | | | | |
442 | o / 1: 27547f69f254 'B' |
|
306 | | o | 2: dc0947a82db8 'C' | |
|
307 | |/ / | |||
|
308 | | o 1: 112478962961 'B' | |||
443 | |/ |
|
309 | |/ | |
444 |
o 0: 4 |
|
310 | o 0: 426bada5c675 'A' | |
445 |
|
311 | |||
446 | $ hg manifest --rev tip |
|
312 | $ hg manifest --rev tip | |
447 | A |
|
313 | A | |
448 | C |
|
314 | C | |
449 | D |
|
315 | D | |
450 | E |
|
316 | E | |
|
317 | F | |||
451 | G |
|
318 | G | |
452 | I |
|
319 | I | |
453 |
|
320 | |||
@@ -458,77 +325,38 b' Rebase and collapse - E onto I:' | |||||
458 | $ cd .. |
|
325 | $ cd .. | |
459 |
|
326 | |||
460 |
|
327 | |||
461 | Create repo d: |
|
328 | With internal merge: | |
462 |
|
||||
463 | $ hg init d |
|
|||
464 | $ cd d |
|
|||
465 |
|
329 | |||
466 | $ echo A > A |
|
330 | $ hg init internal-merge | |
467 | $ hg ci -Am A |
|
331 | $ cd internal-merge | |
468 | adding A |
|
|||
469 | $ echo B > B |
|
|||
470 | $ hg ci -Am B |
|
|||
471 | adding B |
|
|||
472 | $ echo C > C |
|
|||
473 | $ hg ci -Am C |
|
|||
474 | adding C |
|
|||
475 |
|
||||
476 | $ hg up -q 1 |
|
|||
477 |
|
332 | |||
478 | $ echo D > D |
|
333 | $ hg debugdrawdag << 'EOF' | |
479 | $ hg ci -Am D |
|
334 | > E | |
480 | adding D |
|
335 | > |\ | |
481 | created new head |
|
336 | > C D | |
482 | $ hg merge |
|
337 | > |/ | |
483 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
338 | > F B | |
484 | (branch merge, don't forget to commit) |
|
339 | > |/ | |
|
340 | > A | |||
|
341 | > EOF | |||
485 |
|
342 | |||
486 | $ hg ci -m E |
|
|||
487 |
|
343 | |||
488 | $ hg up -q 0 |
|
344 | $ hg rebase -s B --collapse --dest F | |
489 |
|
345 | rebasing 1:112478962961 "B" (B) | ||
490 | $ echo F > F |
|
346 | rebasing 3:26805aba1e60 "C" (C) | |
491 | $ hg ci -Am F |
|
347 | rebasing 4:be0ef73c17ad "D" (D) | |
492 | adding F |
|
348 | rebasing 5:02c4367d6973 "E" (E tip) | |
493 | created new head |
|
349 | saved backup bundle to $TESTTMP/internal-merge/.hg/strip-backup/112478962961-1dfb057b-rebase.hg | |
494 |
|
350 | |||
495 | $ hg tglog |
|
351 | $ hg tglog | |
496 | @ 5: c137c2b8081f 'F' |
|
352 | o 2: c0512a1797b0 'Collapsed revision | |
497 | | |
|
|||
498 | | o 4: 0a42590ed746 'E' |
|
|||
499 | | |\ |
|
|||
500 | | | o 3: 7bbcd6078bcc 'D' |
|
|||
501 | | | | |
|
|||
502 | | o | 2: f838bfaca5c7 'C' |
|
|||
503 | | |/ |
|
|||
504 | | o 1: 27547f69f254 'B' |
|
|||
505 | |/ |
|
|||
506 | o 0: 4a2df7238c3b 'A' |
|
|||
507 |
|
||||
508 | $ cd .. |
|
|||
509 |
|
||||
510 |
|
||||
511 | Rebase and collapse - B onto F: |
|
|||
512 |
|
||||
513 | $ hg clone -q -u . d d1 |
|
|||
514 | $ cd d1 |
|
|||
515 |
|
||||
516 | $ hg rebase -s 1 --collapse --dest 5 |
|
|||
517 | rebasing 1:27547f69f254 "B" |
|
|||
518 | rebasing 2:f838bfaca5c7 "C" |
|
|||
519 | rebasing 3:7bbcd6078bcc "D" |
|
|||
520 | rebasing 4:0a42590ed746 "E" |
|
|||
521 | saved backup bundle to $TESTTMP/d1/.hg/strip-backup/27547f69f254-9a3f7d92-rebase.hg |
|
|||
522 |
|
||||
523 | $ hg tglog |
|
|||
524 | o 2: b72eaccb283f 'Collapsed revision |
|
|||
525 | | * B |
|
353 | | * B | |
526 | | * C |
|
354 | | * C | |
527 | | * D |
|
355 | | * D | |
528 | | * E' |
|
356 | | * E' | |
529 | @ 1: c137c2b8081f 'F' |
|
357 | o 1: 8908a377a434 'F' | |
530 | | |
|
358 | | | |
531 |
o 0: 4 |
|
359 | o 0: 426bada5c675 'A' | |
532 |
|
360 | |||
533 | $ hg manifest --rev tip |
|
361 | $ hg manifest --rev tip | |
534 | A |
|
362 | A | |
@@ -536,9 +364,9 b' Rebase and collapse - B onto F:' | |||||
536 | C |
|
364 | C | |
537 | D |
|
365 | D | |
538 | F |
|
366 | F | |
|
367 | $ cd .. | |||
539 |
|
368 | |||
540 | Interactions between collapse and keepbranches |
|
369 | Interactions between collapse and keepbranches | |
541 | $ cd .. |
|
|||
542 | $ hg init e |
|
370 | $ hg init e | |
543 | $ cd e |
|
371 | $ cd e | |
544 | $ echo 'a' > a |
|
372 | $ echo 'a' > a | |
@@ -733,46 +561,28 b' Test stripping a revision with another c' | |||||
733 | $ hg init f |
|
561 | $ hg init f | |
734 | $ cd f |
|
562 | $ cd f | |
735 |
|
563 | |||
736 | $ echo A > A |
|
564 | $ hg debugdrawdag << 'EOF' | |
737 | $ hg ci -Am A |
|
565 | > C B | |
738 | adding A |
|
566 | > |/ | |
739 | $ echo B > B |
|
567 | > A | |
740 | $ hg ci -Am B |
|
568 | > EOF | |
741 | adding B |
|
|||
742 |
|
569 | |||
743 | $ hg up -q 0 |
|
570 | $ hg heads --template="{rev}:{node} {branch}: {desc}\n" | |
|
571 | 2:dc0947a82db884575bb76ea10ac97b08536bfa03 default: C | |||
|
572 | 1:112478962961147124edd43549aedd1a335e44bf default: B | |||
744 |
|
573 | |||
745 | $ echo C > C |
|
574 | $ hg strip C | |
746 | $ hg ci -Am C |
|
575 | saved backup bundle to $TESTTMP/f/.hg/strip-backup/dc0947a82db8-d21b92a4-backup.hg | |
747 | adding C |
|
|||
748 | created new head |
|
|||
749 |
|
576 | |||
750 | $ hg tglog |
|
577 | $ hg tglog | |
751 | @ 2: c5cefa58fd55 'C' |
|
578 | o 1: 112478962961 'B' | |
752 | | |
|
579 | | | |
753 | | o 1: 27547f69f254 'B' |
|
580 | o 0: 426bada5c675 'A' | |
754 | |/ |
|
|||
755 | o 0: 4a2df7238c3b 'A' |
|
|||
756 |
|
581 | |||
757 |
|
582 | |||
758 |
|
583 | |||
759 | $ hg heads --template="{rev}:{node} {branch}: {desc}\n" |
|
584 | $ hg heads --template="{rev}:{node} {branch}: {desc}\n" | |
760 | 2:c5cefa58fd557f84b72b87f970135984337acbc5 default: C |
|
585 | 1:112478962961147124edd43549aedd1a335e44bf default: B | |
761 | 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B |
|
|||
762 |
|
||||
763 | $ hg strip 2 |
|
|||
764 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
765 | saved backup bundle to $TESTTMP/f/.hg/strip-backup/c5cefa58fd55-629429f4-backup.hg |
|
|||
766 |
|
||||
767 | $ hg tglog |
|
|||
768 | o 1: 27547f69f254 'B' |
|
|||
769 | | |
|
|||
770 | @ 0: 4a2df7238c3b 'A' |
|
|||
771 |
|
||||
772 |
|
||||
773 |
|
||||
774 | $ hg heads --template="{rev}:{node} {branch}: {desc}\n" |
|
|||
775 | 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B |
|
|||
776 |
|
586 | |||
777 | $ cd .. |
|
587 | $ cd .. | |
778 |
|
588 | |||
@@ -812,46 +622,41 b' running into merge conflict and invoking' | |||||
812 |
|
622 | |||
813 | $ hg init collapse_remember_message |
|
623 | $ hg init collapse_remember_message | |
814 | $ cd collapse_remember_message |
|
624 | $ cd collapse_remember_message | |
815 | $ touch a |
|
625 | $ hg debugdrawdag << 'EOF' | |
816 | $ hg add a |
|
626 | > C B # B/A = B\n | |
817 | $ hg commit -m "a" |
|
627 | > |/ # C/A = C\n | |
818 | $ echo "a-default" > a |
|
628 | > A | |
819 | $ hg commit -m "a-default" |
|
629 | > EOF | |
820 | $ hg update -r 0 |
|
630 | $ hg rebase --collapse -m "new message" -b B -d C | |
821 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
631 | rebasing 1:81e5401e4d37 "B" (B) | |
822 | $ hg branch dev |
|
632 | merging A | |
823 | marked working directory as branch dev |
|
633 | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') | |
824 | (branches are permanent and global, did you want a bookmark?) |
|
|||
825 | $ echo "a-dev" > a |
|
|||
826 | $ hg commit -m "a-dev" |
|
|||
827 | $ hg rebase --collapse -m "a-default-dev" -d 1 |
|
|||
828 | rebasing 2:b8d8db2b242d "a-dev" (tip) |
|
|||
829 | merging a |
|
|||
830 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
|||
831 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
634 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
832 | [1] |
|
635 | [1] | |
833 |
$ rm |
|
636 | $ rm A.orig | |
834 |
$ hg resolve --mark |
|
637 | $ hg resolve --mark A | |
835 | (no more unresolved files) |
|
638 | (no more unresolved files) | |
836 | continue: hg rebase --continue |
|
639 | continue: hg rebase --continue | |
837 | $ hg rebase --continue |
|
640 | $ hg rebase --continue | |
838 | rebasing 2:b8d8db2b242d "a-dev" (tip) |
|
641 | rebasing 1:81e5401e4d37 "B" (B) | |
839 |
saved backup bundle to $TESTTMP/collapse_remember_message/.hg/strip-backup/ |
|
642 | saved backup bundle to $TESTTMP/collapse_remember_message/.hg/strip-backup/81e5401e4d37-96c3dd30-rebase.hg | |
840 | $ hg log |
|
643 | $ hg log | |
841 |
changeset: 2: |
|
644 | changeset: 2:17186933e123 | |
842 | tag: tip |
|
645 | tag: tip | |
843 | user: test |
|
646 | user: test | |
844 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
647 | date: Thu Jan 01 00:00:00 1970 +0000 | |
845 |
summary: |
|
648 | summary: new message | |
846 |
|
649 | |||
847 |
changeset: 1:3 |
|
650 | changeset: 1:043039e9df84 | |
|
651 | tag: C | |||
848 | user: test |
|
652 | user: test | |
849 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
653 | date: Thu Jan 01 00:00:00 1970 +0000 | |
850 |
summary: |
|
654 | summary: C | |
851 |
|
655 | |||
852 |
changeset: 0: |
|
656 | changeset: 0:426bada5c675 | |
|
657 | tag: A | |||
853 | user: test |
|
658 | user: test | |
854 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
659 | date: Thu Jan 01 00:00:00 1970 +0000 | |
855 |
summary: |
|
660 | summary: A | |
856 |
|
661 | |||
857 | $ cd .. |
|
662 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now