Show More
This diff has been collapsed as it changes many lines, (653 lines changed) Show them Hide them | |||||
@@ -1,857 +1,662 b'' | |||||
1 | $ cat >> $HGRCPATH <<EOF |
|
1 | $ cat >> $HGRCPATH <<EOF | |
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 | |
8 | > |
|
9 | > | |
9 | > [alias] |
|
10 | > [alias] | |
10 | > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n" |
|
11 | > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n" | |
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 |
|
28 | |||
45 | $ cd .. |
|
29 | $ hg phase --force --secret D | |
46 |
|
||||
47 |
|
||||
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" | |
58 | > cat \$1 |
|
33 | > cat \$1 | |
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 | |
69 | * C |
|
44 | * C | |
70 | * D |
|
45 | * D | |
71 |
|
46 | |||
72 |
|
47 | |||
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 | |||
157 | $ cat > $TESTTMP/checkeditform.sh <<EOF |
|
139 | $ cat > $TESTTMP/checkeditform.sh <<EOF | |
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 | |||
302 |
|
217 | |||
303 |
|
218 | |||
304 |
|
219 | |||
305 | Test that branchheads cache is updated correctly when doing a strip in which |
|
220 | Test that branchheads cache is updated correctly when doing a strip in which | |
306 | the parent of the ancestor node to be stripped does not become a head and also, |
|
221 | the parent of the ancestor node to be stripped does not become a head and also, | |
307 | the parent of a node that is a child of the node stripped becomes a head (node |
|
222 | the parent of a node that is a child of the node stripped becomes a head (node | |
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 | |||
454 | $ hg up tip -q |
|
321 | $ hg up tip -q | |
455 | $ cat E |
|
322 | $ cat E | |
456 | F |
|
323 | F | |
457 |
|
324 | |||
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 | |
535 | B |
|
363 | B | |
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 | |
545 | $ hg ci -Am 'A' |
|
373 | $ hg ci -Am 'A' | |
546 | adding a |
|
374 | adding a | |
547 |
|
375 | |||
548 | $ hg branch 'one' |
|
376 | $ hg branch 'one' | |
549 | marked working directory as branch one |
|
377 | marked working directory as branch one | |
550 | (branches are permanent and global, did you want a bookmark?) |
|
378 | (branches are permanent and global, did you want a bookmark?) | |
551 | $ echo 'b' > b |
|
379 | $ echo 'b' > b | |
552 | $ hg ci -Am 'B' |
|
380 | $ hg ci -Am 'B' | |
553 | adding b |
|
381 | adding b | |
554 |
|
382 | |||
555 | $ hg branch 'two' |
|
383 | $ hg branch 'two' | |
556 | marked working directory as branch two |
|
384 | marked working directory as branch two | |
557 | $ echo 'c' > c |
|
385 | $ echo 'c' > c | |
558 | $ hg ci -Am 'C' |
|
386 | $ hg ci -Am 'C' | |
559 | adding c |
|
387 | adding c | |
560 |
|
388 | |||
561 | $ hg up -q 0 |
|
389 | $ hg up -q 0 | |
562 | $ echo 'd' > d |
|
390 | $ echo 'd' > d | |
563 | $ hg ci -Am 'D' |
|
391 | $ hg ci -Am 'D' | |
564 | adding d |
|
392 | adding d | |
565 |
|
393 | |||
566 | $ hg tglog |
|
394 | $ hg tglog | |
567 | @ 3: 41acb9dca9eb 'D' |
|
395 | @ 3: 41acb9dca9eb 'D' | |
568 | | |
|
396 | | | |
569 | | o 2: 8ac4a08debf1 'C' two |
|
397 | | o 2: 8ac4a08debf1 'C' two | |
570 | | | |
|
398 | | | | |
571 | | o 1: 1ba175478953 'B' one |
|
399 | | o 1: 1ba175478953 'B' one | |
572 | |/ |
|
400 | |/ | |
573 | o 0: 1994f17a630e 'A' |
|
401 | o 0: 1994f17a630e 'A' | |
574 |
|
402 | |||
575 | $ hg rebase --keepbranches --collapse -s 1 -d 3 |
|
403 | $ hg rebase --keepbranches --collapse -s 1 -d 3 | |
576 | abort: cannot collapse multiple named branches |
|
404 | abort: cannot collapse multiple named branches | |
577 | [255] |
|
405 | [255] | |
578 |
|
406 | |||
579 | $ repeatchange() { |
|
407 | $ repeatchange() { | |
580 | > hg checkout $1 |
|
408 | > hg checkout $1 | |
581 | > hg cp d z |
|
409 | > hg cp d z | |
582 | > echo blah >> z |
|
410 | > echo blah >> z | |
583 | > hg commit -Am "$2" --user "$3" |
|
411 | > hg commit -Am "$2" --user "$3" | |
584 |
|
|
412 | > } | |
585 | $ repeatchange 3 "E" "user1" |
|
413 | $ repeatchange 3 "E" "user1" | |
586 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
414 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
587 | $ repeatchange 3 "E" "user2" |
|
415 | $ repeatchange 3 "E" "user2" | |
588 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
416 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
589 | created new head |
|
417 | created new head | |
590 | $ hg tglog |
|
418 | $ hg tglog | |
591 | @ 5: fbfb97b1089a 'E' |
|
419 | @ 5: fbfb97b1089a 'E' | |
592 | | |
|
420 | | | |
593 | | o 4: f338eb3c2c7c 'E' |
|
421 | | o 4: f338eb3c2c7c 'E' | |
594 | |/ |
|
422 | |/ | |
595 | o 3: 41acb9dca9eb 'D' |
|
423 | o 3: 41acb9dca9eb 'D' | |
596 | | |
|
424 | | | |
597 | | o 2: 8ac4a08debf1 'C' two |
|
425 | | o 2: 8ac4a08debf1 'C' two | |
598 | | | |
|
426 | | | | |
599 | | o 1: 1ba175478953 'B' one |
|
427 | | o 1: 1ba175478953 'B' one | |
600 | |/ |
|
428 | |/ | |
601 | o 0: 1994f17a630e 'A' |
|
429 | o 0: 1994f17a630e 'A' | |
602 |
|
430 | |||
603 | $ hg rebase -s 5 -d 4 |
|
431 | $ hg rebase -s 5 -d 4 | |
604 | rebasing 5:fbfb97b1089a "E" (tip) |
|
432 | rebasing 5:fbfb97b1089a "E" (tip) | |
605 | note: rebase of 5:fbfb97b1089a created no changes to commit |
|
433 | note: rebase of 5:fbfb97b1089a created no changes to commit | |
606 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/fbfb97b1089a-553e1d85-rebase.hg |
|
434 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/fbfb97b1089a-553e1d85-rebase.hg | |
607 | $ hg tglog |
|
435 | $ hg tglog | |
608 | @ 4: f338eb3c2c7c 'E' |
|
436 | @ 4: f338eb3c2c7c 'E' | |
609 | | |
|
437 | | | |
610 | o 3: 41acb9dca9eb 'D' |
|
438 | o 3: 41acb9dca9eb 'D' | |
611 | | |
|
439 | | | |
612 | | o 2: 8ac4a08debf1 'C' two |
|
440 | | o 2: 8ac4a08debf1 'C' two | |
613 | | | |
|
441 | | | | |
614 | | o 1: 1ba175478953 'B' one |
|
442 | | o 1: 1ba175478953 'B' one | |
615 | |/ |
|
443 | |/ | |
616 | o 0: 1994f17a630e 'A' |
|
444 | o 0: 1994f17a630e 'A' | |
617 |
|
445 | |||
618 | $ hg export tip |
|
446 | $ hg export tip | |
619 | # HG changeset patch |
|
447 | # HG changeset patch | |
620 | # User user1 |
|
448 | # User user1 | |
621 | # Date 0 0 |
|
449 | # Date 0 0 | |
622 | # Thu Jan 01 00:00:00 1970 +0000 |
|
450 | # Thu Jan 01 00:00:00 1970 +0000 | |
623 | # Node ID f338eb3c2c7cc5b5915676a2376ba7ac558c5213 |
|
451 | # Node ID f338eb3c2c7cc5b5915676a2376ba7ac558c5213 | |
624 | # Parent 41acb9dca9eb976e84cd21fcb756b4afa5a35c09 |
|
452 | # Parent 41acb9dca9eb976e84cd21fcb756b4afa5a35c09 | |
625 | E |
|
453 | E | |
626 |
|
454 | |||
627 | diff -r 41acb9dca9eb -r f338eb3c2c7c z |
|
455 | diff -r 41acb9dca9eb -r f338eb3c2c7c z | |
628 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
456 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
629 | +++ b/z Thu Jan 01 00:00:00 1970 +0000 |
|
457 | +++ b/z Thu Jan 01 00:00:00 1970 +0000 | |
630 | @@ -0,0 +1,2 @@ |
|
458 | @@ -0,0 +1,2 @@ | |
631 | +d |
|
459 | +d | |
632 | +blah |
|
460 | +blah | |
633 |
|
461 | |||
634 | $ cd .. |
|
462 | $ cd .. | |
635 |
|
463 | |||
636 | Rebase, collapse and copies |
|
464 | Rebase, collapse and copies | |
637 |
|
465 | |||
638 | $ hg init copies |
|
466 | $ hg init copies | |
639 | $ cd copies |
|
467 | $ cd copies | |
640 | $ hg unbundle "$TESTDIR/bundles/renames.hg" |
|
468 | $ hg unbundle "$TESTDIR/bundles/renames.hg" | |
641 | adding changesets |
|
469 | adding changesets | |
642 | adding manifests |
|
470 | adding manifests | |
643 | adding file changes |
|
471 | adding file changes | |
644 | added 4 changesets with 11 changes to 7 files (+1 heads) |
|
472 | added 4 changesets with 11 changes to 7 files (+1 heads) | |
645 | new changesets f447d5abf5ea:338e84e2e558 |
|
473 | new changesets f447d5abf5ea:338e84e2e558 | |
646 |
(run 'hg heads' |
|
474 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
647 | $ hg up -q tip |
|
475 | $ hg up -q tip | |
648 | $ hg tglog |
|
476 | $ hg tglog | |
649 | @ 3: 338e84e2e558 'move2' |
|
477 | @ 3: 338e84e2e558 'move2' | |
650 | | |
|
478 | | | |
651 | o 2: 6e7340ee38c0 'move1' |
|
479 | o 2: 6e7340ee38c0 'move1' | |
652 | | |
|
480 | | | |
653 | | o 1: 1352765a01d4 'change' |
|
481 | | o 1: 1352765a01d4 'change' | |
654 | |/ |
|
482 | |/ | |
655 | o 0: f447d5abf5ea 'add' |
|
483 | o 0: f447d5abf5ea 'add' | |
656 |
|
484 | |||
657 | $ hg rebase --collapse -d 1 |
|
485 | $ hg rebase --collapse -d 1 | |
658 | rebasing 2:6e7340ee38c0 "move1" |
|
486 | rebasing 2:6e7340ee38c0 "move1" | |
659 | merging a and d to d |
|
487 | merging a and d to d | |
660 | merging b and e to e |
|
488 | merging b and e to e | |
661 | merging c and f to f |
|
489 | merging c and f to f | |
662 | rebasing 3:338e84e2e558 "move2" (tip) |
|
490 | rebasing 3:338e84e2e558 "move2" (tip) | |
663 | merging f and c to c |
|
491 | merging f and c to c | |
664 | merging e and g to g |
|
492 | merging e and g to g | |
665 | saved backup bundle to $TESTTMP/copies/.hg/strip-backup/6e7340ee38c0-ef8ef003-rebase.hg |
|
493 | saved backup bundle to $TESTTMP/copies/.hg/strip-backup/6e7340ee38c0-ef8ef003-rebase.hg | |
666 | $ hg st |
|
494 | $ hg st | |
667 | $ hg st --copies --change tip |
|
495 | $ hg st --copies --change tip | |
668 | A d |
|
496 | A d | |
669 | a |
|
497 | a | |
670 | A g |
|
498 | A g | |
671 | b |
|
499 | b | |
672 | R b |
|
500 | R b | |
673 | $ hg up tip -q |
|
501 | $ hg up tip -q | |
674 | $ cat c |
|
502 | $ cat c | |
675 | c |
|
503 | c | |
676 | c |
|
504 | c | |
677 | $ cat d |
|
505 | $ cat d | |
678 | a |
|
506 | a | |
679 | a |
|
507 | a | |
680 | $ cat g |
|
508 | $ cat g | |
681 | b |
|
509 | b | |
682 | b |
|
510 | b | |
683 | $ hg log -r . --template "{file_copies}\n" |
|
511 | $ hg log -r . --template "{file_copies}\n" | |
684 | d (a)g (b) |
|
512 | d (a)g (b) | |
685 |
|
513 | |||
686 | Test collapsing a middle revision in-place |
|
514 | Test collapsing a middle revision in-place | |
687 |
|
515 | |||
688 | $ hg tglog |
|
516 | $ hg tglog | |
689 | @ 2: 64b456429f67 'Collapsed revision |
|
517 | @ 2: 64b456429f67 'Collapsed revision | |
690 | | * move1 |
|
518 | | * move1 | |
691 | | * move2' |
|
519 | | * move2' | |
692 | o 1: 1352765a01d4 'change' |
|
520 | o 1: 1352765a01d4 'change' | |
693 | | |
|
521 | | | |
694 | o 0: f447d5abf5ea 'add' |
|
522 | o 0: f447d5abf5ea 'add' | |
695 |
|
523 | |||
696 | $ hg rebase --collapse -r 1 -d 0 |
|
524 | $ hg rebase --collapse -r 1 -d 0 | |
697 | abort: can't remove original changesets with unrebased descendants |
|
525 | abort: can't remove original changesets with unrebased descendants | |
698 | (use --keep to keep original changesets) |
|
526 | (use --keep to keep original changesets) | |
699 | [255] |
|
527 | [255] | |
700 |
|
528 | |||
701 | Test collapsing in place |
|
529 | Test collapsing in place | |
702 |
|
530 | |||
703 | $ hg rebase --collapse -b . -d 0 |
|
531 | $ hg rebase --collapse -b . -d 0 | |
704 | rebasing 1:1352765a01d4 "change" |
|
532 | rebasing 1:1352765a01d4 "change" | |
705 | rebasing 2:64b456429f67 "Collapsed revision" (tip) |
|
533 | rebasing 2:64b456429f67 "Collapsed revision" (tip) | |
706 | saved backup bundle to $TESTTMP/copies/.hg/strip-backup/1352765a01d4-45a352ea-rebase.hg |
|
534 | saved backup bundle to $TESTTMP/copies/.hg/strip-backup/1352765a01d4-45a352ea-rebase.hg | |
707 | $ hg st --change tip --copies |
|
535 | $ hg st --change tip --copies | |
708 | M a |
|
536 | M a | |
709 | M c |
|
537 | M c | |
710 | A d |
|
538 | A d | |
711 | a |
|
539 | a | |
712 | A g |
|
540 | A g | |
713 | b |
|
541 | b | |
714 | R b |
|
542 | R b | |
715 | $ hg up tip -q |
|
543 | $ hg up tip -q | |
716 | $ cat a |
|
544 | $ cat a | |
717 | a |
|
545 | a | |
718 | a |
|
546 | a | |
719 | $ cat c |
|
547 | $ cat c | |
720 | c |
|
548 | c | |
721 | c |
|
549 | c | |
722 | $ cat d |
|
550 | $ cat d | |
723 | a |
|
551 | a | |
724 | a |
|
552 | a | |
725 | $ cat g |
|
553 | $ cat g | |
726 | b |
|
554 | b | |
727 | b |
|
555 | b | |
728 | $ cd .. |
|
556 | $ cd .. | |
729 |
|
557 | |||
730 |
|
558 | |||
731 | Test stripping a revision with another child |
|
559 | Test stripping a revision with another child | |
732 |
|
560 | |||
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 | |||
779 | Test collapsing changes that add then remove a file |
|
589 | Test collapsing changes that add then remove a file | |
780 |
|
590 | |||
781 | $ hg init collapseaddremove |
|
591 | $ hg init collapseaddremove | |
782 | $ cd collapseaddremove |
|
592 | $ cd collapseaddremove | |
783 |
|
593 | |||
784 | $ touch base |
|
594 | $ touch base | |
785 | $ hg commit -Am base |
|
595 | $ hg commit -Am base | |
786 | adding base |
|
596 | adding base | |
787 | $ touch a |
|
597 | $ touch a | |
788 | $ hg commit -Am a |
|
598 | $ hg commit -Am a | |
789 | adding a |
|
599 | adding a | |
790 | $ hg rm a |
|
600 | $ hg rm a | |
791 | $ touch b |
|
601 | $ touch b | |
792 | $ hg commit -Am b |
|
602 | $ hg commit -Am b | |
793 | adding b |
|
603 | adding b | |
794 | $ hg book foo |
|
604 | $ hg book foo | |
795 | $ hg rebase -d 0 -r "1::2" --collapse -m collapsed |
|
605 | $ hg rebase -d 0 -r "1::2" --collapse -m collapsed | |
796 | rebasing 1:6d8d9f24eec3 "a" |
|
606 | rebasing 1:6d8d9f24eec3 "a" | |
797 | rebasing 2:1cc73eca5ecc "b" (foo tip) |
|
607 | rebasing 2:1cc73eca5ecc "b" (foo tip) | |
798 | saved backup bundle to $TESTTMP/collapseaddremove/.hg/strip-backup/6d8d9f24eec3-77d3b6e2-rebase.hg |
|
608 | saved backup bundle to $TESTTMP/collapseaddremove/.hg/strip-backup/6d8d9f24eec3-77d3b6e2-rebase.hg | |
799 | $ hg log -G --template "{rev}: '{desc}' {bookmarks}" |
|
609 | $ hg log -G --template "{rev}: '{desc}' {bookmarks}" | |
800 | @ 1: 'collapsed' foo |
|
610 | @ 1: 'collapsed' foo | |
801 | | |
|
611 | | | |
802 | o 0: 'base' |
|
612 | o 0: 'base' | |
803 |
|
613 | |||
804 | $ hg manifest --rev tip |
|
614 | $ hg manifest --rev tip | |
805 | b |
|
615 | b | |
806 | base |
|
616 | base | |
807 |
|
617 | |||
808 | $ cd .. |
|
618 | $ cd .. | |
809 |
|
619 | |||
810 | Test that rebase --collapse will remember message after |
|
620 | Test that rebase --collapse will remember message after | |
811 | running into merge conflict and invoking rebase --continue. |
|
621 | running into merge conflict and invoking rebase --continue. | |
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