Show More
@@ -1,831 +1,776 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 | > drawdag=$TESTDIR/drawdag.py | |
6 | > |
|
6 | > | |
7 | > [phases] |
|
7 | > [phases] | |
8 | > publish=False |
|
8 | > publish=False | |
9 | > |
|
9 | > | |
10 | > [alias] |
|
10 | > [alias] | |
11 | > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n" |
|
11 | > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n" | |
12 | > tglogp = log -G --template "{rev}: {node|short} {phase} '{desc}' {branches}\n" |
|
12 | > tglogp = log -G --template "{rev}: {node|short} {phase} '{desc}' {branches}\n" | |
13 | > EOF |
|
13 | > EOF | |
14 |
|
14 | |||
15 | Highest phase of source commits is used: |
|
15 | Highest phase of source commits is used: | |
16 |
|
16 | |||
17 | $ hg init phase |
|
17 | $ hg init phase | |
18 | $ cd phase |
|
18 | $ cd phase | |
19 | $ hg debugdrawdag << 'EOF' |
|
19 | $ hg debugdrawdag << 'EOF' | |
20 | > D |
|
20 | > D | |
21 | > | |
|
21 | > | | |
22 | > F C |
|
22 | > F C | |
23 | > | | |
|
23 | > | | | |
24 | > E B |
|
24 | > E B | |
25 | > |/ |
|
25 | > |/ | |
26 | > A |
|
26 | > A | |
27 | > EOF |
|
27 | > EOF | |
28 |
|
28 | |||
29 | $ hg phase --force --secret D |
|
29 | $ hg phase --force --secret D | |
30 |
|
30 | |||
31 | $ cat > $TESTTMP/editor.sh <<EOF |
|
31 | $ cat > $TESTTMP/editor.sh <<EOF | |
32 | > echo "==== before editing" |
|
32 | > echo "==== before editing" | |
33 | > cat \$1 |
|
33 | > cat \$1 | |
34 | > echo "====" |
|
34 | > echo "====" | |
35 | > echo "edited manually" >> \$1 |
|
35 | > echo "edited manually" >> \$1 | |
36 | > EOF |
|
36 | > EOF | |
37 | $ HGEDITOR="sh $TESTTMP/editor.sh" hg rebase --collapse --keepbranches -e --source B --dest F |
|
37 | $ HGEDITOR="sh $TESTTMP/editor.sh" hg rebase --collapse --keepbranches -e --source B --dest F | |
38 | rebasing 1:112478962961 "B" (B) |
|
38 | rebasing 1:112478962961 "B" (B) | |
39 | rebasing 3:26805aba1e60 "C" (C) |
|
39 | rebasing 3:26805aba1e60 "C" (C) | |
40 | rebasing 5:f585351a92f8 "D" (D tip) |
|
40 | rebasing 5:f585351a92f8 "D" (D tip) | |
41 | ==== before editing |
|
41 | ==== before editing | |
42 | Collapsed revision |
|
42 | Collapsed revision | |
43 | * B |
|
43 | * B | |
44 | * C |
|
44 | * C | |
45 | * D |
|
45 | * D | |
46 |
|
46 | |||
47 |
|
47 | |||
48 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
48 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
49 | HG: Leave message empty to abort commit. |
|
49 | HG: Leave message empty to abort commit. | |
50 | HG: -- |
|
50 | HG: -- | |
51 | HG: user: test |
|
51 | HG: user: test | |
52 | HG: branch 'default' |
|
52 | HG: branch 'default' | |
53 | HG: added B |
|
53 | HG: added B | |
54 | HG: added C |
|
54 | HG: added C | |
55 | HG: added D |
|
55 | HG: added D | |
56 | ==== |
|
56 | ==== | |
57 | saved backup bundle to $TESTTMP/phase/.hg/strip-backup/112478962961-cb2a9b47-rebase.hg |
|
57 | saved backup bundle to $TESTTMP/phase/.hg/strip-backup/112478962961-cb2a9b47-rebase.hg | |
58 |
|
58 | |||
59 | $ hg tglogp |
|
59 | $ hg tglogp | |
60 | o 3: 92fa5f5fe108 secret 'Collapsed revision |
|
60 | o 3: 92fa5f5fe108 secret 'Collapsed revision | |
61 | | * B |
|
61 | | * B | |
62 | | * C |
|
62 | | * C | |
63 | | * D |
|
63 | | * D | |
64 | | |
|
64 | | | |
65 | | |
|
65 | | | |
66 | | edited manually' |
|
66 | | edited manually' | |
67 | o 2: 64a8289d2492 draft 'F' |
|
67 | o 2: 64a8289d2492 draft 'F' | |
68 | | |
|
68 | | | |
69 | o 1: 7fb047a69f22 draft 'E' |
|
69 | o 1: 7fb047a69f22 draft 'E' | |
70 | | |
|
70 | | | |
71 | o 0: 426bada5c675 draft 'A' |
|
71 | o 0: 426bada5c675 draft 'A' | |
72 |
|
72 | |||
73 | $ hg manifest --rev tip |
|
73 | $ hg manifest --rev tip | |
74 | A |
|
74 | A | |
75 | B |
|
75 | B | |
76 | C |
|
76 | C | |
77 | D |
|
77 | D | |
78 | E |
|
78 | E | |
79 | F |
|
79 | F | |
80 |
|
80 | |||
81 | $ cd .. |
|
81 | $ cd .. | |
82 |
|
82 | |||
83 |
|
83 | |||
84 | Merge gets linearized: |
|
84 | Merge gets linearized: | |
85 |
|
85 | |||
86 | $ hg init linearized-merge |
|
86 | $ hg init linearized-merge | |
87 | $ cd linearized-merge |
|
87 | $ cd linearized-merge | |
88 |
|
88 | |||
89 | $ hg debugdrawdag << 'EOF' |
|
89 | $ hg debugdrawdag << 'EOF' | |
90 | > F D |
|
90 | > F D | |
91 | > |/| |
|
91 | > |/| | |
92 | > C B |
|
92 | > C B | |
93 | > |/ |
|
93 | > |/ | |
94 | > A |
|
94 | > A | |
95 | > EOF |
|
95 | > EOF | |
96 |
|
96 | |||
97 | $ hg phase --force --secret D |
|
97 | $ hg phase --force --secret D | |
98 | $ hg rebase --source B --collapse --dest F |
|
98 | $ hg rebase --source B --collapse --dest F | |
99 | rebasing 1:112478962961 "B" (B) |
|
99 | rebasing 1:112478962961 "B" (B) | |
100 | rebasing 3:4e4f9194f9f1 "D" (D) |
|
100 | rebasing 3:4e4f9194f9f1 "D" (D) | |
101 | saved backup bundle to $TESTTMP/linearized-merge/.hg/strip-backup/112478962961-e389075b-rebase.hg |
|
101 | saved backup bundle to $TESTTMP/linearized-merge/.hg/strip-backup/112478962961-e389075b-rebase.hg | |
102 |
|
102 | |||
103 | $ hg tglog |
|
103 | $ hg tglog | |
104 | o 3: 5bdc08b7da2b 'Collapsed revision |
|
104 | o 3: 5bdc08b7da2b 'Collapsed revision | |
105 | | * B |
|
105 | | * B | |
106 | | * D' |
|
106 | | * D' | |
107 | o 2: afc707c82df0 'F' |
|
107 | o 2: afc707c82df0 'F' | |
108 | | |
|
108 | | | |
109 | o 1: dc0947a82db8 'C' |
|
109 | o 1: dc0947a82db8 'C' | |
110 | | |
|
110 | | | |
111 | o 0: 426bada5c675 'A' |
|
111 | o 0: 426bada5c675 'A' | |
112 |
|
112 | |||
113 | $ hg manifest --rev tip |
|
113 | $ hg manifest --rev tip | |
114 | A |
|
114 | A | |
115 | B |
|
115 | B | |
116 | C |
|
116 | C | |
117 | F |
|
117 | F | |
118 |
|
118 | |||
119 | $ cd .. |
|
119 | $ cd .. | |
120 |
|
120 | |||
121 | Custom message: |
|
121 | Custom message: | |
122 |
|
122 | |||
123 | $ hg init message |
|
123 | $ hg init message | |
124 | $ cd message |
|
124 | $ cd message | |
125 |
|
125 | |||
126 | $ hg debugdrawdag << 'EOF' |
|
126 | $ hg debugdrawdag << 'EOF' | |
127 | > C |
|
127 | > C | |
128 | > | |
|
128 | > | | |
129 | > D B |
|
129 | > D B | |
130 | > |/ |
|
130 | > |/ | |
131 | > A |
|
131 | > A | |
132 | > EOF |
|
132 | > EOF | |
133 |
|
133 | |||
134 |
|
134 | |||
135 | $ hg rebase --base B -m 'custom message' |
|
135 | $ hg rebase --base B -m 'custom message' | |
136 | abort: message can only be specified with collapse |
|
136 | abort: message can only be specified with collapse | |
137 | [255] |
|
137 | [255] | |
138 |
|
138 | |||
139 | $ cat > $TESTTMP/checkeditform.sh <<EOF |
|
139 | $ cat > $TESTTMP/checkeditform.sh <<EOF | |
140 | > env | grep HGEDITFORM |
|
140 | > env | grep HGEDITFORM | |
141 | > true |
|
141 | > true | |
142 | > EOF |
|
142 | > EOF | |
143 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg rebase --source B --collapse -m 'custom message' -e --dest D |
|
143 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg rebase --source B --collapse -m 'custom message' -e --dest D | |
144 | rebasing 1:112478962961 "B" (B) |
|
144 | rebasing 1:112478962961 "B" (B) | |
145 | rebasing 3:26805aba1e60 "C" (C tip) |
|
145 | rebasing 3:26805aba1e60 "C" (C tip) | |
146 | HGEDITFORM=rebase.collapse |
|
146 | HGEDITFORM=rebase.collapse | |
147 | saved backup bundle to $TESTTMP/message/.hg/strip-backup/112478962961-f4131707-rebase.hg |
|
147 | saved backup bundle to $TESTTMP/message/.hg/strip-backup/112478962961-f4131707-rebase.hg | |
148 |
|
148 | |||
149 | $ hg tglog |
|
149 | $ hg tglog | |
150 | o 2: 2f197b9a08f3 'custom message' |
|
150 | o 2: 2f197b9a08f3 'custom message' | |
151 | | |
|
151 | | | |
152 | o 1: b18e25de2cf5 'D' |
|
152 | o 1: b18e25de2cf5 'D' | |
153 | | |
|
153 | | | |
154 | o 0: 426bada5c675 'A' |
|
154 | o 0: 426bada5c675 'A' | |
155 |
|
155 | |||
156 | $ hg manifest --rev tip |
|
156 | $ hg manifest --rev tip | |
157 | A |
|
157 | A | |
158 | B |
|
158 | B | |
159 | C |
|
159 | C | |
160 | D |
|
160 | D | |
161 |
|
161 | |||
162 | $ cd .. |
|
162 | $ cd .. | |
163 |
|
163 | |||
164 | Rebase and collapse - more than one external (fail): |
|
164 | Rebase and collapse - more than one external (fail): | |
165 |
|
165 | |||
166 | $ hg init multiple-external-parents |
|
166 | $ hg init multiple-external-parents | |
167 | $ cd multiple-external-parents |
|
167 | $ cd multiple-external-parents | |
168 |
|
168 | |||
169 | $ hg debugdrawdag << 'EOF' |
|
169 | $ hg debugdrawdag << 'EOF' | |
170 | > G |
|
170 | > G | |
171 | > |\ |
|
171 | > |\ | |
172 | > | F |
|
172 | > | F | |
173 | > | | |
|
173 | > | | | |
174 | > D E |
|
174 | > D E | |
175 | > |\| |
|
175 | > |\| | |
176 | > H C B |
|
176 | > H C B | |
177 | > \|/ |
|
177 | > \|/ | |
178 | > A |
|
178 | > A | |
179 | > EOF |
|
179 | > EOF | |
180 |
|
180 | |||
181 | $ hg rebase -s C --dest H --collapse |
|
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 |
|
182 | abort: unable to collapse on top of 3, there is more than one external parent: 1, 6 | |
183 | [255] |
|
183 | [255] | |
184 |
|
184 | |||
185 | Rebase and collapse - E onto H: |
|
185 | Rebase and collapse - E onto H: | |
186 |
|
186 | |||
187 | $ hg rebase -s E --dest I --collapse # root (E) is not a merge |
|
187 | $ hg rebase -s E --dest I --collapse # root (E) is not a merge | |
188 | abort: unknown revision 'I'! |
|
188 | abort: unknown revision 'I'! | |
189 | [255] |
|
189 | [255] | |
190 |
|
190 | |||
191 | $ hg tglog |
|
191 | $ hg tglog | |
192 | o 7: 64e264db77f0 'G' |
|
192 | o 7: 64e264db77f0 'G' | |
193 | |\ |
|
193 | |\ | |
194 | | o 6: 11abe3fb10b8 'F' |
|
194 | | o 6: 11abe3fb10b8 'F' | |
195 | | | |
|
195 | | | | |
196 | | o 5: 49cb92066bfd 'E' |
|
196 | | o 5: 49cb92066bfd 'E' | |
197 | | | |
|
197 | | | | |
198 | o | 4: 4e4f9194f9f1 'D' |
|
198 | o | 4: 4e4f9194f9f1 'D' | |
199 | |\| |
|
199 | |\| | |
200 | | | o 3: 575c4b5ec114 'H' |
|
200 | | | o 3: 575c4b5ec114 'H' | |
201 | | | | |
|
201 | | | | | |
202 | o---+ 2: dc0947a82db8 'C' |
|
202 | o---+ 2: dc0947a82db8 'C' | |
203 | / / |
|
203 | / / | |
204 | o / 1: 112478962961 'B' |
|
204 | o / 1: 112478962961 'B' | |
205 | |/ |
|
205 | |/ | |
206 | o 0: 426bada5c675 'A' |
|
206 | o 0: 426bada5c675 'A' | |
207 |
|
207 | |||
208 | $ hg manifest --rev tip |
|
208 | $ hg manifest --rev tip | |
209 | A |
|
209 | A | |
210 | B |
|
210 | B | |
211 | C |
|
211 | C | |
212 | E |
|
212 | E | |
213 | F |
|
213 | F | |
214 |
|
214 | |||
215 | $ cd .. |
|
215 | $ cd .. | |
216 |
|
216 | |||
217 |
|
217 | |||
218 |
|
218 | |||
219 |
|
219 | |||
220 | 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 | |
221 | 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, | |
222 | 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 | |
223 | 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 | |
224 | 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. | |
225 |
|
225 | |||
226 | Create repo b: |
|
226 | Create repo b: | |
227 |
|
227 | |||
228 | $ hg init branch-heads |
|
228 | $ hg init branch-heads | |
229 | $ cd branch-heads |
|
229 | $ cd branch-heads | |
230 |
|
230 | |||
231 | $ hg debugdrawdag << 'EOF' |
|
231 | $ hg debugdrawdag << 'EOF' | |
232 | > G |
|
232 | > G | |
233 | > |\ |
|
233 | > |\ | |
234 | > | F |
|
234 | > | F | |
235 | > | | |
|
235 | > | | | |
236 | > D E |
|
236 | > D E | |
237 | > |\| |
|
237 | > |\| | |
238 | > H C B |
|
238 | > H C B | |
239 | > \|/ |
|
239 | > \|/ | |
240 | > A |
|
240 | > A | |
241 | > EOF |
|
241 | > EOF | |
242 |
|
242 | |||
243 | $ hg heads --template="{rev}:{node} {branch}\n" |
|
243 | $ hg heads --template="{rev}:{node} {branch}\n" | |
244 | 7:64e264db77f061f16d9132b70c5a58e2461fb630 default |
|
244 | 7:64e264db77f061f16d9132b70c5a58e2461fb630 default | |
245 | 3:575c4b5ec114d64b681d33f8792853568bfb2b2c default |
|
245 | 3:575c4b5ec114d64b681d33f8792853568bfb2b2c default | |
246 |
|
246 | |||
247 | $ cat $TESTTMP/branch-heads/.hg/cache/branch2-served |
|
247 | $ cat $TESTTMP/branch-heads/.hg/cache/branch2-served | |
248 | 64e264db77f061f16d9132b70c5a58e2461fb630 7 |
|
248 | 64e264db77f061f16d9132b70c5a58e2461fb630 7 | |
249 | 575c4b5ec114d64b681d33f8792853568bfb2b2c o default |
|
249 | 575c4b5ec114d64b681d33f8792853568bfb2b2c o default | |
250 | 64e264db77f061f16d9132b70c5a58e2461fb630 o default |
|
250 | 64e264db77f061f16d9132b70c5a58e2461fb630 o default | |
251 |
|
251 | |||
252 | $ hg strip 4 |
|
252 | $ hg strip 4 | |
253 | saved backup bundle to $TESTTMP/branch-heads/.hg/strip-backup/4e4f9194f9f1-5ec4b5e6-backup.hg |
|
253 | saved backup bundle to $TESTTMP/branch-heads/.hg/strip-backup/4e4f9194f9f1-5ec4b5e6-backup.hg | |
254 |
|
254 | |||
255 | $ cat $TESTTMP/branch-heads/.hg/cache/branch2-served |
|
255 | $ cat $TESTTMP/branch-heads/.hg/cache/branch2-served | |
256 | 11abe3fb10b8689b560681094b17fe161871d043 5 |
|
256 | 11abe3fb10b8689b560681094b17fe161871d043 5 | |
257 | dc0947a82db884575bb76ea10ac97b08536bfa03 o default |
|
257 | dc0947a82db884575bb76ea10ac97b08536bfa03 o default | |
258 | 575c4b5ec114d64b681d33f8792853568bfb2b2c o default |
|
258 | 575c4b5ec114d64b681d33f8792853568bfb2b2c o default | |
259 | 11abe3fb10b8689b560681094b17fe161871d043 o default |
|
259 | 11abe3fb10b8689b560681094b17fe161871d043 o default | |
260 |
|
260 | |||
261 | $ hg heads --template="{rev}:{node} {branch}\n" |
|
261 | $ hg heads --template="{rev}:{node} {branch}\n" | |
262 | 5:11abe3fb10b8689b560681094b17fe161871d043 default |
|
262 | 5:11abe3fb10b8689b560681094b17fe161871d043 default | |
263 | 3:575c4b5ec114d64b681d33f8792853568bfb2b2c default |
|
263 | 3:575c4b5ec114d64b681d33f8792853568bfb2b2c default | |
264 | 2:dc0947a82db884575bb76ea10ac97b08536bfa03 default |
|
264 | 2:dc0947a82db884575bb76ea10ac97b08536bfa03 default | |
265 |
|
265 | |||
266 | $ cd .. |
|
266 | $ cd .. | |
267 |
|
267 | |||
268 |
|
268 | |||
269 |
|
269 | |||
270 | Preserves external parent |
|
270 | Preserves external parent | |
271 |
|
271 | |||
272 | $ hg init external-parent |
|
272 | $ hg init external-parent | |
273 | $ cd external-parent |
|
273 | $ cd external-parent | |
274 |
|
274 | |||
275 | $ hg debugdrawdag << 'EOF' |
|
275 | $ hg debugdrawdag << 'EOF' | |
276 | > H |
|
276 | > H | |
277 | > |\ |
|
277 | > |\ | |
278 | > | G |
|
278 | > | G | |
279 | > | | |
|
279 | > | | | |
280 | > | F # F/E = F\n |
|
280 | > | F # F/E = F\n | |
281 | > | | |
|
281 | > | | | |
282 | > D E # D/D = D\n |
|
282 | > D E # D/D = D\n | |
283 | > |\| |
|
283 | > |\| | |
284 | > I C B |
|
284 | > I C B | |
285 | > \|/ |
|
285 | > \|/ | |
286 | > A |
|
286 | > A | |
287 | > EOF |
|
287 | > EOF | |
288 |
|
288 | |||
289 | $ hg rebase -s F --dest I --collapse # root (F) is not a merge |
|
289 | $ hg rebase -s F --dest I --collapse # root (F) is not a merge | |
290 | rebasing 6:c82b08f646f1 "F" (F) |
|
290 | rebasing 6:c82b08f646f1 "F" (F) | |
291 | file 'E' was deleted in local [dest] but was modified in other [source]. |
|
291 | file 'E' was deleted in local [dest] but was modified in other [source]. | |
292 | You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. |
|
292 | You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. | |
293 | What do you want to do? u |
|
293 | What do you want to do? u | |
294 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
294 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
295 | [1] |
|
295 | [1] | |
296 |
|
296 | |||
297 | $ echo F > E |
|
297 | $ echo F > E | |
298 | $ hg resolve -m |
|
298 | $ hg resolve -m | |
299 | (no more unresolved files) |
|
299 | (no more unresolved files) | |
300 | continue: hg rebase --continue |
|
300 | continue: hg rebase --continue | |
301 | $ hg rebase -c |
|
301 | $ hg rebase -c | |
302 | rebasing 6:c82b08f646f1 "F" (F) |
|
302 | rebasing 6:c82b08f646f1 "F" (F) | |
303 | rebasing 7:a6db7fa104e1 "G" (G) |
|
303 | rebasing 7:a6db7fa104e1 "G" (G) | |
304 | rebasing 8:e1d201b72d91 "H" (H tip) |
|
304 | rebasing 8:e1d201b72d91 "H" (H tip) | |
305 | saved backup bundle to $TESTTMP/external-parent/.hg/strip-backup/c82b08f646f1-f2721fbf-rebase.hg |
|
305 | saved backup bundle to $TESTTMP/external-parent/.hg/strip-backup/c82b08f646f1-f2721fbf-rebase.hg | |
306 |
|
306 | |||
307 | $ hg tglog |
|
307 | $ hg tglog | |
308 | o 6: 681daa3e686d 'Collapsed revision |
|
308 | o 6: 681daa3e686d 'Collapsed revision | |
309 | |\ * F |
|
309 | |\ * F | |
310 | | | * G |
|
310 | | | * G | |
311 | | | * H' |
|
311 | | | * H' | |
312 | | | o 5: 49cb92066bfd 'E' |
|
312 | | | o 5: 49cb92066bfd 'E' | |
313 | | | | |
|
313 | | | | | |
314 | | o | 4: 09143c0bf13e 'D' |
|
314 | | o | 4: 09143c0bf13e 'D' | |
315 | | |\| |
|
315 | | |\| | |
316 | o | | 3: 08ebfeb61bac 'I' |
|
316 | o | | 3: 08ebfeb61bac 'I' | |
317 | | | | |
|
317 | | | | | |
318 | | o | 2: dc0947a82db8 'C' |
|
318 | | o | 2: dc0947a82db8 'C' | |
319 | |/ / |
|
319 | |/ / | |
320 | | o 1: 112478962961 'B' |
|
320 | | o 1: 112478962961 'B' | |
321 | |/ |
|
321 | |/ | |
322 | o 0: 426bada5c675 'A' |
|
322 | o 0: 426bada5c675 'A' | |
323 |
|
323 | |||
324 | $ hg manifest --rev tip |
|
324 | $ hg manifest --rev tip | |
325 | A |
|
325 | A | |
326 | C |
|
326 | C | |
327 | D |
|
327 | D | |
328 | E |
|
328 | E | |
329 | F |
|
329 | F | |
330 | G |
|
330 | G | |
331 | I |
|
331 | I | |
332 |
|
332 | |||
333 | $ hg up tip -q |
|
333 | $ hg up tip -q | |
334 | $ cat E |
|
334 | $ cat E | |
335 | F |
|
335 | F | |
336 |
|
336 | |||
337 | $ cd .. |
|
337 | $ cd .. | |
338 |
|
338 | |||
339 | Rebasing from multiple bases: |
|
339 | Rebasing from multiple bases: | |
340 |
|
340 | |||
341 | $ hg init multiple-bases |
|
341 | $ hg init multiple-bases | |
342 | $ cd multiple-bases |
|
342 | $ cd multiple-bases | |
343 | $ hg debugdrawdag << 'EOF' |
|
343 | $ hg debugdrawdag << 'EOF' | |
344 | > C B |
|
344 | > C B | |
345 | > D |/ |
|
345 | > D |/ | |
346 | > |/ |
|
346 | > |/ | |
347 | > A |
|
347 | > A | |
348 | > EOF |
|
348 | > EOF | |
349 | $ hg rebase --collapse -r 'B+C' -d D |
|
349 | $ hg rebase --collapse -r 'B+C' -d D | |
350 | rebasing 1:fc2b737bb2e5 "B" (B) |
|
350 | rebasing 1:fc2b737bb2e5 "B" (B) | |
351 | rebasing 2:dc0947a82db8 "C" (C) |
|
351 | rebasing 2:dc0947a82db8 "C" (C) | |
352 | saved backup bundle to $TESTTMP/multiple-bases/.hg/strip-backup/dc0947a82db8-b0c1a7ea-rebase.hg |
|
352 | saved backup bundle to $TESTTMP/multiple-bases/.hg/strip-backup/dc0947a82db8-b0c1a7ea-rebase.hg | |
353 | $ hg tglog |
|
353 | $ hg tglog | |
354 | o 2: 2127ae44d291 'Collapsed revision |
|
354 | o 2: 2127ae44d291 'Collapsed revision | |
355 | | * B |
|
355 | | * B | |
356 | | * C' |
|
356 | | * C' | |
357 | o 1: b18e25de2cf5 'D' |
|
357 | o 1: b18e25de2cf5 'D' | |
358 | | |
|
358 | | | |
359 | o 0: 426bada5c675 'A' |
|
359 | o 0: 426bada5c675 'A' | |
360 |
|
360 | |||
361 | $ cd .. |
|
361 | $ cd .. | |
362 |
|
362 | |||
363 | With non-contiguous commits: |
|
363 | With non-contiguous commits: | |
364 |
|
364 | |||
365 | $ hg init non-contiguous |
|
365 | $ hg init non-contiguous | |
366 | $ cd non-contiguous |
|
366 | $ cd non-contiguous | |
367 | $ cat >> .hg/hgrc <<EOF |
|
367 | $ cat >> .hg/hgrc <<EOF | |
368 | > [experimental] |
|
368 | > [experimental] | |
369 | > evolution=all |
|
369 | > evolution=all | |
370 | > EOF |
|
370 | > EOF | |
371 |
|
371 | |||
372 | $ hg debugdrawdag << 'EOF' |
|
372 | $ hg debugdrawdag << 'EOF' | |
373 | > F |
|
373 | > F | |
374 | > | |
|
374 | > | | |
375 | > E |
|
375 | > E | |
376 | > | |
|
376 | > | | |
377 | > D |
|
377 | > D | |
378 | > | |
|
378 | > | | |
379 | > C |
|
379 | > C | |
380 | > | |
|
380 | > | | |
381 | > B G |
|
381 | > B G | |
382 | > |/ |
|
382 | > |/ | |
383 | > A |
|
383 | > A | |
384 | > EOF |
|
384 | > EOF | |
385 |
|
385 | |||
386 | BROKEN: should be allowed |
|
386 | BROKEN: should be allowed | |
387 | $ hg rebase --collapse -r 'B+D+F' -d G |
|
387 | $ hg rebase --collapse -r 'B+D+F' -d G | |
388 | abort: unable to collapse on top of 2, there is more than one external parent: 3, 5 |
|
388 | abort: unable to collapse on top of 2, there is more than one external parent: 3, 5 | |
389 | [255] |
|
389 | [255] | |
390 | $ cd .. |
|
390 | $ cd .. | |
391 |
|
391 | |||
392 |
|
392 | |||
393 | $ hg init multiple-external-parents-2 |
|
393 | $ hg init multiple-external-parents-2 | |
394 | $ cd multiple-external-parents-2 |
|
394 | $ cd multiple-external-parents-2 | |
395 | $ hg debugdrawdag << 'EOF' |
|
395 | $ hg debugdrawdag << 'EOF' | |
396 | > D G |
|
396 | > D G | |
397 | > |\ /| |
|
397 | > |\ /| | |
398 | > B C E F |
|
398 | > B C E F | |
399 | > \| |/ |
|
399 | > \| |/ | |
400 | > \ H / |
|
400 | > \ H / | |
401 | > \|/ |
|
401 | > \|/ | |
402 | > A |
|
402 | > A | |
403 | > EOF |
|
403 | > EOF | |
404 |
|
404 | |||
405 | $ hg rebase --collapse -d H -s 'B+F' |
|
405 | $ hg rebase --collapse -d H -s 'B+F' | |
406 | abort: unable to collapse on top of 5, there is more than one external parent: 1, 3 |
|
406 | abort: unable to collapse on top of 5, there is more than one external parent: 1, 3 | |
407 | [255] |
|
407 | [255] | |
408 | $ cd .. |
|
408 | $ cd .. | |
409 |
|
409 | |||
410 | With internal merge: |
|
410 | With internal merge: | |
411 |
|
411 | |||
412 | $ hg init internal-merge |
|
412 | $ hg init internal-merge | |
413 | $ cd internal-merge |
|
413 | $ cd internal-merge | |
414 |
|
414 | |||
415 | $ hg debugdrawdag << 'EOF' |
|
415 | $ hg debugdrawdag << 'EOF' | |
416 | > E |
|
416 | > E | |
417 | > |\ |
|
417 | > |\ | |
418 | > C D |
|
418 | > C D | |
419 | > |/ |
|
419 | > |/ | |
420 | > F B |
|
420 | > F B | |
421 | > |/ |
|
421 | > |/ | |
422 | > A |
|
422 | > A | |
423 | > EOF |
|
423 | > EOF | |
424 |
|
424 | |||
425 |
|
425 | |||
426 | $ hg rebase -s B --collapse --dest F |
|
426 | $ hg rebase -s B --collapse --dest F | |
427 | rebasing 1:112478962961 "B" (B) |
|
427 | rebasing 1:112478962961 "B" (B) | |
428 | rebasing 3:26805aba1e60 "C" (C) |
|
428 | rebasing 3:26805aba1e60 "C" (C) | |
429 | rebasing 4:be0ef73c17ad "D" (D) |
|
429 | rebasing 4:be0ef73c17ad "D" (D) | |
430 | rebasing 5:02c4367d6973 "E" (E tip) |
|
430 | rebasing 5:02c4367d6973 "E" (E tip) | |
431 | saved backup bundle to $TESTTMP/internal-merge/.hg/strip-backup/112478962961-1dfb057b-rebase.hg |
|
431 | saved backup bundle to $TESTTMP/internal-merge/.hg/strip-backup/112478962961-1dfb057b-rebase.hg | |
432 |
|
432 | |||
433 | $ hg tglog |
|
433 | $ hg tglog | |
434 | o 2: c0512a1797b0 'Collapsed revision |
|
434 | o 2: c0512a1797b0 'Collapsed revision | |
435 | | * B |
|
435 | | * B | |
436 | | * C |
|
436 | | * C | |
437 | | * D |
|
437 | | * D | |
438 | | * E' |
|
438 | | * E' | |
439 | o 1: 8908a377a434 'F' |
|
439 | o 1: 8908a377a434 'F' | |
440 | | |
|
440 | | | |
441 | o 0: 426bada5c675 'A' |
|
441 | o 0: 426bada5c675 'A' | |
442 |
|
442 | |||
443 | $ hg manifest --rev tip |
|
443 | $ hg manifest --rev tip | |
444 | A |
|
444 | A | |
445 | B |
|
445 | B | |
446 | C |
|
446 | C | |
447 | D |
|
447 | D | |
448 | F |
|
448 | F | |
449 | $ cd .. |
|
449 | $ cd .. | |
450 |
|
450 | |||
451 | Interactions between collapse and keepbranches |
|
451 | Interactions between collapse and keepbranches | |
452 | $ hg init e |
|
452 | $ hg init e | |
453 | $ cd e |
|
453 | $ cd e | |
454 | $ echo 'a' > a |
|
454 | $ echo 'a' > a | |
455 | $ hg ci -Am 'A' |
|
455 | $ hg ci -Am 'A' | |
456 | adding a |
|
456 | adding a | |
457 |
|
457 | |||
458 | $ hg branch 'one' |
|
458 | $ hg branch 'one' | |
459 | marked working directory as branch one |
|
459 | marked working directory as branch one | |
460 | (branches are permanent and global, did you want a bookmark?) |
|
460 | (branches are permanent and global, did you want a bookmark?) | |
461 | $ echo 'b' > b |
|
461 | $ echo 'b' > b | |
462 | $ hg ci -Am 'B' |
|
462 | $ hg ci -Am 'B' | |
463 | adding b |
|
463 | adding b | |
464 |
|
464 | |||
465 | $ hg branch 'two' |
|
465 | $ hg branch 'two' | |
466 | marked working directory as branch two |
|
466 | marked working directory as branch two | |
467 | $ echo 'c' > c |
|
467 | $ echo 'c' > c | |
468 | $ hg ci -Am 'C' |
|
468 | $ hg ci -Am 'C' | |
469 | adding c |
|
469 | adding c | |
470 |
|
470 | |||
471 | $ hg up -q 0 |
|
471 | $ hg up -q 0 | |
472 | $ echo 'd' > d |
|
472 | $ echo 'd' > d | |
473 | $ hg ci -Am 'D' |
|
473 | $ hg ci -Am 'D' | |
474 | adding d |
|
474 | adding d | |
475 |
|
475 | |||
476 | $ hg tglog |
|
476 | $ hg tglog | |
477 | @ 3: 41acb9dca9eb 'D' |
|
477 | @ 3: 41acb9dca9eb 'D' | |
478 | | |
|
478 | | | |
479 | | o 2: 8ac4a08debf1 'C' two |
|
479 | | o 2: 8ac4a08debf1 'C' two | |
480 | | | |
|
480 | | | | |
481 | | o 1: 1ba175478953 'B' one |
|
481 | | o 1: 1ba175478953 'B' one | |
482 | |/ |
|
482 | |/ | |
483 | o 0: 1994f17a630e 'A' |
|
483 | o 0: 1994f17a630e 'A' | |
484 |
|
484 | |||
485 | $ hg rebase --keepbranches --collapse -s 1 -d 3 |
|
485 | $ hg rebase --keepbranches --collapse -s 1 -d 3 | |
486 | abort: cannot collapse multiple named branches |
|
486 | abort: cannot collapse multiple named branches | |
487 | [255] |
|
487 | [255] | |
488 |
|
488 | |||
489 | $ repeatchange() { |
|
|||
490 | > hg checkout $1 |
|
|||
491 | > hg cp d z |
|
|||
492 | > echo blah >> z |
|
|||
493 | > hg commit -Am "$2" --user "$3" |
|
|||
494 | > } |
|
|||
495 | $ repeatchange 3 "E" "user1" |
|
|||
496 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
497 | $ repeatchange 3 "E" "user2" |
|
|||
498 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
499 | created new head |
|
|||
500 | $ hg tglog |
|
|||
501 | @ 5: fbfb97b1089a 'E' |
|
|||
502 | | |
|
|||
503 | | o 4: f338eb3c2c7c 'E' |
|
|||
504 | |/ |
|
|||
505 | o 3: 41acb9dca9eb 'D' |
|
|||
506 | | |
|
|||
507 | | o 2: 8ac4a08debf1 'C' two |
|
|||
508 | | | |
|
|||
509 | | o 1: 1ba175478953 'B' one |
|
|||
510 | |/ |
|
|||
511 | o 0: 1994f17a630e 'A' |
|
|||
512 |
|
||||
513 | $ hg rebase -s 5 -d 4 |
|
|||
514 | rebasing 5:fbfb97b1089a "E" (tip) |
|
|||
515 | note: not rebasing 5:fbfb97b1089a "E" (tip), its destination already has all its changes |
|
|||
516 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/fbfb97b1089a-553e1d85-rebase.hg |
|
|||
517 | $ hg tglog |
|
|||
518 | @ 4: f338eb3c2c7c 'E' |
|
|||
519 | | |
|
|||
520 | o 3: 41acb9dca9eb 'D' |
|
|||
521 | | |
|
|||
522 | | o 2: 8ac4a08debf1 'C' two |
|
|||
523 | | | |
|
|||
524 | | o 1: 1ba175478953 'B' one |
|
|||
525 | |/ |
|
|||
526 | o 0: 1994f17a630e 'A' |
|
|||
527 |
|
||||
528 | $ hg export tip |
|
|||
529 | # HG changeset patch |
|
|||
530 | # User user1 |
|
|||
531 | # Date 0 0 |
|
|||
532 | # Thu Jan 01 00:00:00 1970 +0000 |
|
|||
533 | # Node ID f338eb3c2c7cc5b5915676a2376ba7ac558c5213 |
|
|||
534 | # Parent 41acb9dca9eb976e84cd21fcb756b4afa5a35c09 |
|
|||
535 | E |
|
|||
536 |
|
||||
537 | diff -r 41acb9dca9eb -r f338eb3c2c7c z |
|
|||
538 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
|||
539 | +++ b/z Thu Jan 01 00:00:00 1970 +0000 |
|
|||
540 | @@ -0,0 +1,2 @@ |
|
|||
541 | +d |
|
|||
542 | +blah |
|
|||
543 |
|
||||
544 | $ cd .. |
|
489 | $ cd .. | |
545 |
|
490 | |||
546 | Rebase, collapse and copies |
|
491 | Rebase, collapse and copies | |
547 |
|
492 | |||
548 | $ hg init copies |
|
493 | $ hg init copies | |
549 | $ cd copies |
|
494 | $ cd copies | |
550 | $ hg unbundle "$TESTDIR/bundles/renames.hg" |
|
495 | $ hg unbundle "$TESTDIR/bundles/renames.hg" | |
551 | adding changesets |
|
496 | adding changesets | |
552 | adding manifests |
|
497 | adding manifests | |
553 | adding file changes |
|
498 | adding file changes | |
554 | added 4 changesets with 11 changes to 7 files (+1 heads) |
|
499 | added 4 changesets with 11 changes to 7 files (+1 heads) | |
555 | new changesets f447d5abf5ea:338e84e2e558 (4 drafts) |
|
500 | new changesets f447d5abf5ea:338e84e2e558 (4 drafts) | |
556 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
501 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
557 | $ hg up -q tip |
|
502 | $ hg up -q tip | |
558 | $ hg tglog |
|
503 | $ hg tglog | |
559 | @ 3: 338e84e2e558 'move2' |
|
504 | @ 3: 338e84e2e558 'move2' | |
560 | | |
|
505 | | | |
561 | o 2: 6e7340ee38c0 'move1' |
|
506 | o 2: 6e7340ee38c0 'move1' | |
562 | | |
|
507 | | | |
563 | | o 1: 1352765a01d4 'change' |
|
508 | | o 1: 1352765a01d4 'change' | |
564 | |/ |
|
509 | |/ | |
565 | o 0: f447d5abf5ea 'add' |
|
510 | o 0: f447d5abf5ea 'add' | |
566 |
|
511 | |||
567 | $ hg rebase --collapse -d 1 |
|
512 | $ hg rebase --collapse -d 1 | |
568 | rebasing 2:6e7340ee38c0 "move1" |
|
513 | rebasing 2:6e7340ee38c0 "move1" | |
569 | merging a and d to d |
|
514 | merging a and d to d | |
570 | merging b and e to e |
|
515 | merging b and e to e | |
571 | merging c and f to f |
|
516 | merging c and f to f | |
572 | rebasing 3:338e84e2e558 "move2" (tip) |
|
517 | rebasing 3:338e84e2e558 "move2" (tip) | |
573 | merging f and c to c |
|
518 | merging f and c to c | |
574 | merging e and g to g |
|
519 | merging e and g to g | |
575 | saved backup bundle to $TESTTMP/copies/.hg/strip-backup/6e7340ee38c0-ef8ef003-rebase.hg |
|
520 | saved backup bundle to $TESTTMP/copies/.hg/strip-backup/6e7340ee38c0-ef8ef003-rebase.hg | |
576 | $ hg st |
|
521 | $ hg st | |
577 | $ hg st --copies --change tip |
|
522 | $ hg st --copies --change tip | |
578 | A d |
|
523 | A d | |
579 | a |
|
524 | a | |
580 | A g |
|
525 | A g | |
581 | b |
|
526 | b | |
582 | R b |
|
527 | R b | |
583 | $ hg up tip -q |
|
528 | $ hg up tip -q | |
584 | $ cat c |
|
529 | $ cat c | |
585 | c |
|
530 | c | |
586 | c |
|
531 | c | |
587 | $ cat d |
|
532 | $ cat d | |
588 | a |
|
533 | a | |
589 | a |
|
534 | a | |
590 | $ cat g |
|
535 | $ cat g | |
591 | b |
|
536 | b | |
592 | b |
|
537 | b | |
593 | $ hg log -r . --template "{file_copies}\n" |
|
538 | $ hg log -r . --template "{file_copies}\n" | |
594 | d (a)g (b) |
|
539 | d (a)g (b) | |
595 |
|
540 | |||
596 | Test collapsing a middle revision in-place |
|
541 | Test collapsing a middle revision in-place | |
597 |
|
542 | |||
598 | $ hg tglog |
|
543 | $ hg tglog | |
599 | @ 2: 64b456429f67 'Collapsed revision |
|
544 | @ 2: 64b456429f67 'Collapsed revision | |
600 | | * move1 |
|
545 | | * move1 | |
601 | | * move2' |
|
546 | | * move2' | |
602 | o 1: 1352765a01d4 'change' |
|
547 | o 1: 1352765a01d4 'change' | |
603 | | |
|
548 | | | |
604 | o 0: f447d5abf5ea 'add' |
|
549 | o 0: f447d5abf5ea 'add' | |
605 |
|
550 | |||
606 | $ hg rebase --collapse -r 1 -d 0 |
|
551 | $ hg rebase --collapse -r 1 -d 0 | |
607 | abort: cannot rebase changeset with children |
|
552 | abort: cannot rebase changeset with children | |
608 | (use --keep to keep original changesets) |
|
553 | (use --keep to keep original changesets) | |
609 | [255] |
|
554 | [255] | |
610 |
|
555 | |||
611 | Test collapsing in place |
|
556 | Test collapsing in place | |
612 |
|
557 | |||
613 | $ hg rebase --collapse -b . -d 0 |
|
558 | $ hg rebase --collapse -b . -d 0 | |
614 | rebasing 1:1352765a01d4 "change" |
|
559 | rebasing 1:1352765a01d4 "change" | |
615 | rebasing 2:64b456429f67 "Collapsed revision" (tip) |
|
560 | rebasing 2:64b456429f67 "Collapsed revision" (tip) | |
616 | saved backup bundle to $TESTTMP/copies/.hg/strip-backup/1352765a01d4-45a352ea-rebase.hg |
|
561 | saved backup bundle to $TESTTMP/copies/.hg/strip-backup/1352765a01d4-45a352ea-rebase.hg | |
617 | $ hg st --change tip --copies |
|
562 | $ hg st --change tip --copies | |
618 | M a |
|
563 | M a | |
619 | M c |
|
564 | M c | |
620 | A d |
|
565 | A d | |
621 | a |
|
566 | a | |
622 | A g |
|
567 | A g | |
623 | b |
|
568 | b | |
624 | R b |
|
569 | R b | |
625 | $ hg up tip -q |
|
570 | $ hg up tip -q | |
626 | $ cat a |
|
571 | $ cat a | |
627 | a |
|
572 | a | |
628 | a |
|
573 | a | |
629 | $ cat c |
|
574 | $ cat c | |
630 | c |
|
575 | c | |
631 | c |
|
576 | c | |
632 | $ cat d |
|
577 | $ cat d | |
633 | a |
|
578 | a | |
634 | a |
|
579 | a | |
635 | $ cat g |
|
580 | $ cat g | |
636 | b |
|
581 | b | |
637 | b |
|
582 | b | |
638 | $ cd .. |
|
583 | $ cd .. | |
639 |
|
584 | |||
640 |
|
585 | |||
641 | Test stripping a revision with another child |
|
586 | Test stripping a revision with another child | |
642 |
|
587 | |||
643 | $ hg init f |
|
588 | $ hg init f | |
644 | $ cd f |
|
589 | $ cd f | |
645 |
|
590 | |||
646 | $ hg debugdrawdag << 'EOF' |
|
591 | $ hg debugdrawdag << 'EOF' | |
647 | > C B |
|
592 | > C B | |
648 | > |/ |
|
593 | > |/ | |
649 | > A |
|
594 | > A | |
650 | > EOF |
|
595 | > EOF | |
651 |
|
596 | |||
652 | $ hg heads --template="{rev}:{node} {branch}: {desc}\n" |
|
597 | $ hg heads --template="{rev}:{node} {branch}: {desc}\n" | |
653 | 2:dc0947a82db884575bb76ea10ac97b08536bfa03 default: C |
|
598 | 2:dc0947a82db884575bb76ea10ac97b08536bfa03 default: C | |
654 | 1:112478962961147124edd43549aedd1a335e44bf default: B |
|
599 | 1:112478962961147124edd43549aedd1a335e44bf default: B | |
655 |
|
600 | |||
656 | $ hg strip C |
|
601 | $ hg strip C | |
657 | saved backup bundle to $TESTTMP/f/.hg/strip-backup/dc0947a82db8-d21b92a4-backup.hg |
|
602 | saved backup bundle to $TESTTMP/f/.hg/strip-backup/dc0947a82db8-d21b92a4-backup.hg | |
658 |
|
603 | |||
659 | $ hg tglog |
|
604 | $ hg tglog | |
660 | o 1: 112478962961 'B' |
|
605 | o 1: 112478962961 'B' | |
661 | | |
|
606 | | | |
662 | o 0: 426bada5c675 'A' |
|
607 | o 0: 426bada5c675 'A' | |
663 |
|
608 | |||
664 |
|
609 | |||
665 |
|
610 | |||
666 | $ hg heads --template="{rev}:{node} {branch}: {desc}\n" |
|
611 | $ hg heads --template="{rev}:{node} {branch}: {desc}\n" | |
667 | 1:112478962961147124edd43549aedd1a335e44bf default: B |
|
612 | 1:112478962961147124edd43549aedd1a335e44bf default: B | |
668 |
|
613 | |||
669 | $ cd .. |
|
614 | $ cd .. | |
670 |
|
615 | |||
671 | Test collapsing changes that add then remove a file |
|
616 | Test collapsing changes that add then remove a file | |
672 |
|
617 | |||
673 | $ hg init collapseaddremove |
|
618 | $ hg init collapseaddremove | |
674 | $ cd collapseaddremove |
|
619 | $ cd collapseaddremove | |
675 |
|
620 | |||
676 | $ touch base |
|
621 | $ touch base | |
677 | $ hg commit -Am base |
|
622 | $ hg commit -Am base | |
678 | adding base |
|
623 | adding base | |
679 | $ touch a |
|
624 | $ touch a | |
680 | $ hg commit -Am a |
|
625 | $ hg commit -Am a | |
681 | adding a |
|
626 | adding a | |
682 | $ hg rm a |
|
627 | $ hg rm a | |
683 | $ touch b |
|
628 | $ touch b | |
684 | $ hg commit -Am b |
|
629 | $ hg commit -Am b | |
685 | adding b |
|
630 | adding b | |
686 | $ hg book foo |
|
631 | $ hg book foo | |
687 | $ hg rebase -d 0 -r "1::2" --collapse -m collapsed |
|
632 | $ hg rebase -d 0 -r "1::2" --collapse -m collapsed | |
688 | rebasing 1:6d8d9f24eec3 "a" |
|
633 | rebasing 1:6d8d9f24eec3 "a" | |
689 | rebasing 2:1cc73eca5ecc "b" (foo tip) |
|
634 | rebasing 2:1cc73eca5ecc "b" (foo tip) | |
690 | saved backup bundle to $TESTTMP/collapseaddremove/.hg/strip-backup/6d8d9f24eec3-77d3b6e2-rebase.hg |
|
635 | saved backup bundle to $TESTTMP/collapseaddremove/.hg/strip-backup/6d8d9f24eec3-77d3b6e2-rebase.hg | |
691 | $ hg log -G --template "{rev}: '{desc}' {bookmarks}" |
|
636 | $ hg log -G --template "{rev}: '{desc}' {bookmarks}" | |
692 | @ 1: 'collapsed' foo |
|
637 | @ 1: 'collapsed' foo | |
693 | | |
|
638 | | | |
694 | o 0: 'base' |
|
639 | o 0: 'base' | |
695 |
|
640 | |||
696 | $ hg manifest --rev tip |
|
641 | $ hg manifest --rev tip | |
697 | b |
|
642 | b | |
698 | base |
|
643 | base | |
699 |
|
644 | |||
700 | $ cd .. |
|
645 | $ cd .. | |
701 |
|
646 | |||
702 | Test that rebase --collapse will remember message after |
|
647 | Test that rebase --collapse will remember message after | |
703 | running into merge conflict and invoking rebase --continue. |
|
648 | running into merge conflict and invoking rebase --continue. | |
704 |
|
649 | |||
705 | $ hg init collapse_remember_message |
|
650 | $ hg init collapse_remember_message | |
706 | $ cd collapse_remember_message |
|
651 | $ cd collapse_remember_message | |
707 | $ hg debugdrawdag << 'EOF' |
|
652 | $ hg debugdrawdag << 'EOF' | |
708 | > C B # B/A = B\n |
|
653 | > C B # B/A = B\n | |
709 | > |/ # C/A = C\n |
|
654 | > |/ # C/A = C\n | |
710 | > A |
|
655 | > A | |
711 | > EOF |
|
656 | > EOF | |
712 | $ hg rebase --collapse -m "new message" -b B -d C |
|
657 | $ hg rebase --collapse -m "new message" -b B -d C | |
713 | rebasing 1:81e5401e4d37 "B" (B) |
|
658 | rebasing 1:81e5401e4d37 "B" (B) | |
714 | merging A |
|
659 | merging A | |
715 | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') |
|
660 | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') | |
716 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
661 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
717 | [1] |
|
662 | [1] | |
718 | $ rm A.orig |
|
663 | $ rm A.orig | |
719 | $ hg resolve --mark A |
|
664 | $ hg resolve --mark A | |
720 | (no more unresolved files) |
|
665 | (no more unresolved files) | |
721 | continue: hg rebase --continue |
|
666 | continue: hg rebase --continue | |
722 | $ hg rebase --continue |
|
667 | $ hg rebase --continue | |
723 | rebasing 1:81e5401e4d37 "B" (B) |
|
668 | rebasing 1:81e5401e4d37 "B" (B) | |
724 | saved backup bundle to $TESTTMP/collapse_remember_message/.hg/strip-backup/81e5401e4d37-96c3dd30-rebase.hg |
|
669 | saved backup bundle to $TESTTMP/collapse_remember_message/.hg/strip-backup/81e5401e4d37-96c3dd30-rebase.hg | |
725 | $ hg log |
|
670 | $ hg log | |
726 | changeset: 2:17186933e123 |
|
671 | changeset: 2:17186933e123 | |
727 | tag: tip |
|
672 | tag: tip | |
728 | user: test |
|
673 | user: test | |
729 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
674 | date: Thu Jan 01 00:00:00 1970 +0000 | |
730 | summary: new message |
|
675 | summary: new message | |
731 |
|
676 | |||
732 | changeset: 1:043039e9df84 |
|
677 | changeset: 1:043039e9df84 | |
733 | tag: C |
|
678 | tag: C | |
734 | user: test |
|
679 | user: test | |
735 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
680 | date: Thu Jan 01 00:00:00 1970 +0000 | |
736 | summary: C |
|
681 | summary: C | |
737 |
|
682 | |||
738 | changeset: 0:426bada5c675 |
|
683 | changeset: 0:426bada5c675 | |
739 | tag: A |
|
684 | tag: A | |
740 | user: test |
|
685 | user: test | |
741 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
686 | date: Thu Jan 01 00:00:00 1970 +0000 | |
742 | summary: A |
|
687 | summary: A | |
743 |
|
688 | |||
744 | $ cd .. |
|
689 | $ cd .. | |
745 |
|
690 | |||
746 | Test aborted editor on final message |
|
691 | Test aborted editor on final message | |
747 |
|
692 | |||
748 | $ HGMERGE=:merge3 |
|
693 | $ HGMERGE=:merge3 | |
749 | $ export HGMERGE |
|
694 | $ export HGMERGE | |
750 | $ hg init aborted-editor |
|
695 | $ hg init aborted-editor | |
751 | $ cd aborted-editor |
|
696 | $ cd aborted-editor | |
752 | $ hg debugdrawdag << 'EOF' |
|
697 | $ hg debugdrawdag << 'EOF' | |
753 | > C # D/A = D\n |
|
698 | > C # D/A = D\n | |
754 | > | # C/A = C\n |
|
699 | > | # C/A = C\n | |
755 | > B D # B/A = B\n |
|
700 | > B D # B/A = B\n | |
756 | > |/ # A/A = A\n |
|
701 | > |/ # A/A = A\n | |
757 | > A |
|
702 | > A | |
758 | > EOF |
|
703 | > EOF | |
759 | $ hg rebase --collapse -t internal:merge3 -s B -d D |
|
704 | $ hg rebase --collapse -t internal:merge3 -s B -d D | |
760 | rebasing 1:f899f3910ce7 "B" (B) |
|
705 | rebasing 1:f899f3910ce7 "B" (B) | |
761 | merging A |
|
706 | merging A | |
762 | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') |
|
707 | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') | |
763 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
708 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
764 | [1] |
|
709 | [1] | |
765 | $ hg tglog |
|
710 | $ hg tglog | |
766 | o 3: 63668d570d21 'C' |
|
711 | o 3: 63668d570d21 'C' | |
767 | | |
|
712 | | | |
768 | | @ 2: 82b8abf9c185 'D' |
|
713 | | @ 2: 82b8abf9c185 'D' | |
769 | | | |
|
714 | | | | |
770 | @ | 1: f899f3910ce7 'B' |
|
715 | @ | 1: f899f3910ce7 'B' | |
771 | |/ |
|
716 | |/ | |
772 | o 0: 4a2df7238c3b 'A' |
|
717 | o 0: 4a2df7238c3b 'A' | |
773 |
|
718 | |||
774 | $ cat A |
|
719 | $ cat A | |
775 | <<<<<<< dest: 82b8abf9c185 D - test: D |
|
720 | <<<<<<< dest: 82b8abf9c185 D - test: D | |
776 | D |
|
721 | D | |
777 | ||||||| base |
|
722 | ||||||| base | |
778 | A |
|
723 | A | |
779 | ======= |
|
724 | ======= | |
780 | B |
|
725 | B | |
781 | >>>>>>> source: f899f3910ce7 B - test: B |
|
726 | >>>>>>> source: f899f3910ce7 B - test: B | |
782 | $ echo BC > A |
|
727 | $ echo BC > A | |
783 | $ hg resolve -m |
|
728 | $ hg resolve -m | |
784 | (no more unresolved files) |
|
729 | (no more unresolved files) | |
785 | continue: hg rebase --continue |
|
730 | continue: hg rebase --continue | |
786 | $ hg rebase --continue |
|
731 | $ hg rebase --continue | |
787 | rebasing 1:f899f3910ce7 "B" (B) |
|
732 | rebasing 1:f899f3910ce7 "B" (B) | |
788 | rebasing 3:63668d570d21 "C" (C tip) |
|
733 | rebasing 3:63668d570d21 "C" (C tip) | |
789 | merging A |
|
734 | merging A | |
790 | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') |
|
735 | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') | |
791 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
736 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
792 | [1] |
|
737 | [1] | |
793 | $ hg tglog |
|
738 | $ hg tglog | |
794 | @ 3: 63668d570d21 'C' |
|
739 | @ 3: 63668d570d21 'C' | |
795 | | |
|
740 | | | |
796 | | @ 2: 82b8abf9c185 'D' |
|
741 | | @ 2: 82b8abf9c185 'D' | |
797 | | | |
|
742 | | | | |
798 | o | 1: f899f3910ce7 'B' |
|
743 | o | 1: f899f3910ce7 'B' | |
799 | |/ |
|
744 | |/ | |
800 | o 0: 4a2df7238c3b 'A' |
|
745 | o 0: 4a2df7238c3b 'A' | |
801 |
|
746 | |||
802 | $ cat A |
|
747 | $ cat A | |
803 | <<<<<<< dest: 82b8abf9c185 D - test: D |
|
748 | <<<<<<< dest: 82b8abf9c185 D - test: D | |
804 | BC |
|
749 | BC | |
805 | ||||||| base |
|
750 | ||||||| base | |
806 | B |
|
751 | B | |
807 | ======= |
|
752 | ======= | |
808 | C |
|
753 | C | |
809 | >>>>>>> source: 63668d570d21 C tip - test: C |
|
754 | >>>>>>> source: 63668d570d21 C tip - test: C | |
810 | $ echo BD > A |
|
755 | $ echo BD > A | |
811 | $ hg resolve -m |
|
756 | $ hg resolve -m | |
812 | (no more unresolved files) |
|
757 | (no more unresolved files) | |
813 | continue: hg rebase --continue |
|
758 | continue: hg rebase --continue | |
814 | $ HGEDITOR=false hg rebase --continue --config ui.interactive=1 |
|
759 | $ HGEDITOR=false hg rebase --continue --config ui.interactive=1 | |
815 | already rebased 1:f899f3910ce7 "B" (B) as 82b8abf9c185 |
|
760 | already rebased 1:f899f3910ce7 "B" (B) as 82b8abf9c185 | |
816 | rebasing 3:63668d570d21 "C" (C tip) |
|
761 | rebasing 3:63668d570d21 "C" (C tip) | |
817 | abort: edit failed: false exited with status 1 |
|
762 | abort: edit failed: false exited with status 1 | |
818 | [255] |
|
763 | [255] | |
819 | $ hg tglog |
|
764 | $ hg tglog | |
820 | o 3: 63668d570d21 'C' |
|
765 | o 3: 63668d570d21 'C' | |
821 | | |
|
766 | | | |
822 | | @ 2: 82b8abf9c185 'D' |
|
767 | | @ 2: 82b8abf9c185 'D' | |
823 | | | |
|
768 | | | | |
824 | o | 1: f899f3910ce7 'B' |
|
769 | o | 1: f899f3910ce7 'B' | |
825 | |/ |
|
770 | |/ | |
826 | o 0: 4a2df7238c3b 'A' |
|
771 | o 0: 4a2df7238c3b 'A' | |
827 |
|
772 | |||
828 | $ hg rebase --continue |
|
773 | $ hg rebase --continue | |
829 | already rebased 1:f899f3910ce7 "B" (B) as 82b8abf9c185 |
|
774 | already rebased 1:f899f3910ce7 "B" (B) as 82b8abf9c185 | |
830 | already rebased 3:63668d570d21 "C" (C tip) as 82b8abf9c185 |
|
775 | already rebased 3:63668d570d21 "C" (C tip) as 82b8abf9c185 | |
831 | saved backup bundle to $TESTTMP/aborted-editor/.hg/strip-backup/f899f3910ce7-7cab5e15-rebase.hg |
|
776 | saved backup bundle to $TESTTMP/aborted-editor/.hg/strip-backup/f899f3910ce7-7cab5e15-rebase.hg |
@@ -1,332 +1,388 b'' | |||||
1 | $ cat >> $HGRCPATH <<EOF |
|
1 | $ cat >> $HGRCPATH <<EOF | |
2 | > [extensions] |
|
2 | > [extensions] | |
3 | > rebase= |
|
3 | > rebase= | |
4 | > |
|
4 | > | |
5 | > [alias] |
|
5 | > [alias] | |
6 | > tlog = log --template "{rev}: {node|short} '{desc}' {branches}\n" |
|
6 | > tlog = log --template "{rev}: {node|short} '{desc}' {branches}\n" | |
7 | > tglog = tlog --graph |
|
7 | > tglog = tlog --graph | |
8 | > EOF |
|
8 | > EOF | |
9 |
|
9 | |||
10 |
|
10 | |||
11 | $ hg init a |
|
11 | $ hg init a | |
12 | $ cd a |
|
12 | $ cd a | |
13 |
|
13 | |||
14 | $ mkdir d |
|
14 | $ mkdir d | |
15 | $ echo a > a |
|
15 | $ echo a > a | |
16 | $ hg ci -Am A |
|
16 | $ hg ci -Am A | |
17 | adding a |
|
17 | adding a | |
18 |
|
18 | |||
19 | $ echo b > d/b |
|
19 | $ echo b > d/b | |
20 | $ hg ci -Am B |
|
20 | $ hg ci -Am B | |
21 | adding d/b |
|
21 | adding d/b | |
22 |
|
22 | |||
23 | $ hg mv d d-renamed |
|
23 | $ hg mv d d-renamed | |
24 | moving d/b to d-renamed/b |
|
24 | moving d/b to d-renamed/b | |
25 | $ hg ci -m 'rename B' |
|
25 | $ hg ci -m 'rename B' | |
26 |
|
26 | |||
27 | $ hg up -q -C 1 |
|
27 | $ hg up -q -C 1 | |
28 |
|
28 | |||
29 | $ hg mv a a-renamed |
|
29 | $ hg mv a a-renamed | |
30 | $ echo x > d/x |
|
30 | $ echo x > d/x | |
31 | $ hg add d/x |
|
31 | $ hg add d/x | |
32 |
|
32 | |||
33 | $ hg ci -m 'rename A' |
|
33 | $ hg ci -m 'rename A' | |
34 | created new head |
|
34 | created new head | |
35 |
|
35 | |||
36 | $ hg tglog |
|
36 | $ hg tglog | |
37 | @ 3: 73a3ee40125d 'rename A' |
|
37 | @ 3: 73a3ee40125d 'rename A' | |
38 | | |
|
38 | | | |
39 | | o 2: 220d0626d185 'rename B' |
|
39 | | o 2: 220d0626d185 'rename B' | |
40 | |/ |
|
40 | |/ | |
41 | o 1: 3ab5da9a5c01 'B' |
|
41 | o 1: 3ab5da9a5c01 'B' | |
42 | | |
|
42 | | | |
43 | o 0: 1994f17a630e 'A' |
|
43 | o 0: 1994f17a630e 'A' | |
44 |
|
44 | |||
45 |
|
45 | |||
46 | Rename is tracked: |
|
46 | Rename is tracked: | |
47 |
|
47 | |||
48 | $ hg tlog -p --git -r tip |
|
48 | $ hg tlog -p --git -r tip | |
49 | 3: 73a3ee40125d 'rename A' |
|
49 | 3: 73a3ee40125d 'rename A' | |
50 | diff --git a/a b/a-renamed |
|
50 | diff --git a/a b/a-renamed | |
51 | rename from a |
|
51 | rename from a | |
52 | rename to a-renamed |
|
52 | rename to a-renamed | |
53 | diff --git a/d/x b/d/x |
|
53 | diff --git a/d/x b/d/x | |
54 | new file mode 100644 |
|
54 | new file mode 100644 | |
55 | --- /dev/null |
|
55 | --- /dev/null | |
56 | +++ b/d/x |
|
56 | +++ b/d/x | |
57 | @@ -0,0 +1,1 @@ |
|
57 | @@ -0,0 +1,1 @@ | |
58 | +x |
|
58 | +x | |
59 |
|
59 | |||
60 | Rebase the revision containing the rename: |
|
60 | Rebase the revision containing the rename: | |
61 |
|
61 | |||
62 | $ hg rebase -s 3 -d 2 |
|
62 | $ hg rebase -s 3 -d 2 | |
63 | rebasing 3:73a3ee40125d "rename A" (tip) |
|
63 | rebasing 3:73a3ee40125d "rename A" (tip) | |
64 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/73a3ee40125d-1d78ebcf-rebase.hg |
|
64 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/73a3ee40125d-1d78ebcf-rebase.hg | |
65 |
|
65 | |||
66 | $ hg tglog |
|
66 | $ hg tglog | |
67 | @ 3: 032a9b75e83b 'rename A' |
|
67 | @ 3: 032a9b75e83b 'rename A' | |
68 | | |
|
68 | | | |
69 | o 2: 220d0626d185 'rename B' |
|
69 | o 2: 220d0626d185 'rename B' | |
70 | | |
|
70 | | | |
71 | o 1: 3ab5da9a5c01 'B' |
|
71 | o 1: 3ab5da9a5c01 'B' | |
72 | | |
|
72 | | | |
73 | o 0: 1994f17a630e 'A' |
|
73 | o 0: 1994f17a630e 'A' | |
74 |
|
74 | |||
75 |
|
75 | |||
76 | Rename is not lost: |
|
76 | Rename is not lost: | |
77 |
|
77 | |||
78 | $ hg tlog -p --git -r tip |
|
78 | $ hg tlog -p --git -r tip | |
79 | 3: 032a9b75e83b 'rename A' |
|
79 | 3: 032a9b75e83b 'rename A' | |
80 | diff --git a/a b/a-renamed |
|
80 | diff --git a/a b/a-renamed | |
81 | rename from a |
|
81 | rename from a | |
82 | rename to a-renamed |
|
82 | rename to a-renamed | |
83 | diff --git a/d-renamed/x b/d-renamed/x |
|
83 | diff --git a/d-renamed/x b/d-renamed/x | |
84 | new file mode 100644 |
|
84 | new file mode 100644 | |
85 | --- /dev/null |
|
85 | --- /dev/null | |
86 | +++ b/d-renamed/x |
|
86 | +++ b/d-renamed/x | |
87 | @@ -0,0 +1,1 @@ |
|
87 | @@ -0,0 +1,1 @@ | |
88 | +x |
|
88 | +x | |
89 |
|
89 | |||
90 |
|
90 | |||
91 | Rebased revision does not contain information about b (issue3739) |
|
91 | Rebased revision does not contain information about b (issue3739) | |
92 |
|
92 | |||
93 | $ hg log -r 3 --debug |
|
93 | $ hg log -r 3 --debug | |
94 | changeset: 3:032a9b75e83bff1dcfb6cbfa4ef50a704bf1b569 |
|
94 | changeset: 3:032a9b75e83bff1dcfb6cbfa4ef50a704bf1b569 | |
95 | tag: tip |
|
95 | tag: tip | |
96 | phase: draft |
|
96 | phase: draft | |
97 | parent: 2:220d0626d185f372d9d8f69d9c73b0811d7725f7 |
|
97 | parent: 2:220d0626d185f372d9d8f69d9c73b0811d7725f7 | |
98 | parent: -1:0000000000000000000000000000000000000000 |
|
98 | parent: -1:0000000000000000000000000000000000000000 | |
99 | manifest: 3:035d66b27a1b06b2d12b46d41a39adb7a200c370 |
|
99 | manifest: 3:035d66b27a1b06b2d12b46d41a39adb7a200c370 | |
100 | user: test |
|
100 | user: test | |
101 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
101 | date: Thu Jan 01 00:00:00 1970 +0000 | |
102 | files+: a-renamed d-renamed/x |
|
102 | files+: a-renamed d-renamed/x | |
103 | files-: a |
|
103 | files-: a | |
104 | extra: branch=default |
|
104 | extra: branch=default | |
105 | extra: rebase_source=73a3ee40125d6f0f347082e5831ceccb3f005f8a |
|
105 | extra: rebase_source=73a3ee40125d6f0f347082e5831ceccb3f005f8a | |
106 | description: |
|
106 | description: | |
107 | rename A |
|
107 | rename A | |
108 |
|
108 | |||
109 |
|
109 | |||
110 |
|
110 | |||
|
111 | $ repeatchange() { | |||
|
112 | > hg checkout $1 | |||
|
113 | > hg cp a z | |||
|
114 | > echo blah >> z | |||
|
115 | > hg commit -Am "$2" --user "$3" | |||
|
116 | > } | |||
|
117 | $ repeatchange 1 "E" "user1" | |||
|
118 | 2 files updated, 0 files merged, 3 files removed, 0 files unresolved | |||
|
119 | created new head | |||
|
120 | $ repeatchange 1 "E" "user2" | |||
|
121 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
122 | created new head | |||
|
123 | $ hg tglog | |||
|
124 | @ 5: af8ad1f97097 'E' | |||
|
125 | | | |||
|
126 | | o 4: 60f545c27784 'E' | |||
|
127 | |/ | |||
|
128 | | o 3: 032a9b75e83b 'rename A' | |||
|
129 | | | | |||
|
130 | | o 2: 220d0626d185 'rename B' | |||
|
131 | |/ | |||
|
132 | o 1: 3ab5da9a5c01 'B' | |||
|
133 | | | |||
|
134 | o 0: 1994f17a630e 'A' | |||
|
135 | ||||
|
136 | $ hg rebase -s 5 -d 4 | |||
|
137 | rebasing 5:af8ad1f97097 "E" (tip) | |||
|
138 | note: not rebasing 5:af8ad1f97097 "E" (tip), its destination already has all its changes | |||
|
139 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/af8ad1f97097-c3e90708-rebase.hg | |||
|
140 | $ hg tglog | |||
|
141 | @ 4: 60f545c27784 'E' | |||
|
142 | | | |||
|
143 | | o 3: 032a9b75e83b 'rename A' | |||
|
144 | | | | |||
|
145 | | o 2: 220d0626d185 'rename B' | |||
|
146 | |/ | |||
|
147 | o 1: 3ab5da9a5c01 'B' | |||
|
148 | | | |||
|
149 | o 0: 1994f17a630e 'A' | |||
|
150 | ||||
|
151 | $ hg export tip | |||
|
152 | # HG changeset patch | |||
|
153 | # User user1 | |||
|
154 | # Date 0 0 | |||
|
155 | # Thu Jan 01 00:00:00 1970 +0000 | |||
|
156 | # Node ID 60f545c277846e6bad309919bae3ae106f59cb39 | |||
|
157 | # Parent 3ab5da9a5c01faa02c20f2ec4870a4f689c92da6 | |||
|
158 | E | |||
|
159 | ||||
|
160 | diff -r 3ab5da9a5c01 -r 60f545c27784 z | |||
|
161 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |||
|
162 | +++ b/z Thu Jan 01 00:00:00 1970 +0000 | |||
|
163 | @@ -0,0 +1,2 @@ | |||
|
164 | +a | |||
|
165 | +blah | |||
|
166 | ||||
111 | $ cd .. |
|
167 | $ cd .. | |
112 |
|
168 | |||
113 |
|
169 | |||
114 | $ hg init b |
|
170 | $ hg init b | |
115 | $ cd b |
|
171 | $ cd b | |
116 |
|
172 | |||
117 | $ echo a > a |
|
173 | $ echo a > a | |
118 | $ hg ci -Am A |
|
174 | $ hg ci -Am A | |
119 | adding a |
|
175 | adding a | |
120 |
|
176 | |||
121 | $ echo b > b |
|
177 | $ echo b > b | |
122 | $ hg ci -Am B |
|
178 | $ hg ci -Am B | |
123 | adding b |
|
179 | adding b | |
124 |
|
180 | |||
125 | $ hg cp b b-copied |
|
181 | $ hg cp b b-copied | |
126 | $ hg ci -Am 'copy B' |
|
182 | $ hg ci -Am 'copy B' | |
127 |
|
183 | |||
128 | $ hg up -q -C 1 |
|
184 | $ hg up -q -C 1 | |
129 |
|
185 | |||
130 | $ hg cp a a-copied |
|
186 | $ hg cp a a-copied | |
131 | $ hg ci -m 'copy A' |
|
187 | $ hg ci -m 'copy A' | |
132 | created new head |
|
188 | created new head | |
133 |
|
189 | |||
134 | $ hg tglog |
|
190 | $ hg tglog | |
135 | @ 3: 0a8162ff18a8 'copy A' |
|
191 | @ 3: 0a8162ff18a8 'copy A' | |
136 | | |
|
192 | | | |
137 | | o 2: 39e588434882 'copy B' |
|
193 | | o 2: 39e588434882 'copy B' | |
138 | |/ |
|
194 | |/ | |
139 | o 1: 6c81ed0049f8 'B' |
|
195 | o 1: 6c81ed0049f8 'B' | |
140 | | |
|
196 | | | |
141 | o 0: 1994f17a630e 'A' |
|
197 | o 0: 1994f17a630e 'A' | |
142 |
|
198 | |||
143 | Copy is tracked: |
|
199 | Copy is tracked: | |
144 |
|
200 | |||
145 | $ hg tlog -p --git -r tip |
|
201 | $ hg tlog -p --git -r tip | |
146 | 3: 0a8162ff18a8 'copy A' |
|
202 | 3: 0a8162ff18a8 'copy A' | |
147 | diff --git a/a b/a-copied |
|
203 | diff --git a/a b/a-copied | |
148 | copy from a |
|
204 | copy from a | |
149 | copy to a-copied |
|
205 | copy to a-copied | |
150 |
|
206 | |||
151 | Rebase the revision containing the copy: |
|
207 | Rebase the revision containing the copy: | |
152 |
|
208 | |||
153 | $ hg rebase -s 3 -d 2 |
|
209 | $ hg rebase -s 3 -d 2 | |
154 | rebasing 3:0a8162ff18a8 "copy A" (tip) |
|
210 | rebasing 3:0a8162ff18a8 "copy A" (tip) | |
155 | saved backup bundle to $TESTTMP/b/.hg/strip-backup/0a8162ff18a8-dd06302a-rebase.hg |
|
211 | saved backup bundle to $TESTTMP/b/.hg/strip-backup/0a8162ff18a8-dd06302a-rebase.hg | |
156 |
|
212 | |||
157 | $ hg tglog |
|
213 | $ hg tglog | |
158 | @ 3: 98f6e6dbf45a 'copy A' |
|
214 | @ 3: 98f6e6dbf45a 'copy A' | |
159 | | |
|
215 | | | |
160 | o 2: 39e588434882 'copy B' |
|
216 | o 2: 39e588434882 'copy B' | |
161 | | |
|
217 | | | |
162 | o 1: 6c81ed0049f8 'B' |
|
218 | o 1: 6c81ed0049f8 'B' | |
163 | | |
|
219 | | | |
164 | o 0: 1994f17a630e 'A' |
|
220 | o 0: 1994f17a630e 'A' | |
165 |
|
221 | |||
166 |
|
222 | |||
167 | Copy is not lost: |
|
223 | Copy is not lost: | |
168 |
|
224 | |||
169 | $ hg tlog -p --git -r tip |
|
225 | $ hg tlog -p --git -r tip | |
170 | 3: 98f6e6dbf45a 'copy A' |
|
226 | 3: 98f6e6dbf45a 'copy A' | |
171 | diff --git a/a b/a-copied |
|
227 | diff --git a/a b/a-copied | |
172 | copy from a |
|
228 | copy from a | |
173 | copy to a-copied |
|
229 | copy to a-copied | |
174 |
|
230 | |||
175 |
|
231 | |||
176 | Rebased revision does not contain information about b (issue3739) |
|
232 | Rebased revision does not contain information about b (issue3739) | |
177 |
|
233 | |||
178 | $ hg log -r 3 --debug |
|
234 | $ hg log -r 3 --debug | |
179 | changeset: 3:98f6e6dbf45ab54079c2237fbd11066a5c41a11d |
|
235 | changeset: 3:98f6e6dbf45ab54079c2237fbd11066a5c41a11d | |
180 | tag: tip |
|
236 | tag: tip | |
181 | phase: draft |
|
237 | phase: draft | |
182 | parent: 2:39e588434882ff77d01229d169cdc77f29e8855e |
|
238 | parent: 2:39e588434882ff77d01229d169cdc77f29e8855e | |
183 | parent: -1:0000000000000000000000000000000000000000 |
|
239 | parent: -1:0000000000000000000000000000000000000000 | |
184 | manifest: 3:2232f329d66fffe3930d43479ae624f66322b04d |
|
240 | manifest: 3:2232f329d66fffe3930d43479ae624f66322b04d | |
185 | user: test |
|
241 | user: test | |
186 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
242 | date: Thu Jan 01 00:00:00 1970 +0000 | |
187 | files+: a-copied |
|
243 | files+: a-copied | |
188 | extra: branch=default |
|
244 | extra: branch=default | |
189 | extra: rebase_source=0a8162ff18a8900df8df8ef7ac0046955205613e |
|
245 | extra: rebase_source=0a8162ff18a8900df8df8ef7ac0046955205613e | |
190 | description: |
|
246 | description: | |
191 | copy A |
|
247 | copy A | |
192 |
|
248 | |||
193 |
|
249 | |||
194 |
|
250 | |||
195 | $ cd .. |
|
251 | $ cd .. | |
196 |
|
252 | |||
197 |
|
253 | |||
198 | Test rebase across repeating renames: |
|
254 | Test rebase across repeating renames: | |
199 |
|
255 | |||
200 | $ hg init repo |
|
256 | $ hg init repo | |
201 |
|
257 | |||
202 | $ cd repo |
|
258 | $ cd repo | |
203 |
|
259 | |||
204 | $ echo testing > file1.txt |
|
260 | $ echo testing > file1.txt | |
205 | $ hg add file1.txt |
|
261 | $ hg add file1.txt | |
206 | $ hg ci -m "Adding file1" |
|
262 | $ hg ci -m "Adding file1" | |
207 |
|
263 | |||
208 | $ hg rename file1.txt file2.txt |
|
264 | $ hg rename file1.txt file2.txt | |
209 | $ hg ci -m "Rename file1 to file2" |
|
265 | $ hg ci -m "Rename file1 to file2" | |
210 |
|
266 | |||
211 | $ echo Unrelated change > unrelated.txt |
|
267 | $ echo Unrelated change > unrelated.txt | |
212 | $ hg add unrelated.txt |
|
268 | $ hg add unrelated.txt | |
213 | $ hg ci -m "Unrelated change" |
|
269 | $ hg ci -m "Unrelated change" | |
214 |
|
270 | |||
215 | $ hg rename file2.txt file1.txt |
|
271 | $ hg rename file2.txt file1.txt | |
216 | $ hg ci -m "Rename file2 back to file1" |
|
272 | $ hg ci -m "Rename file2 back to file1" | |
217 |
|
273 | |||
218 | $ hg update -r -2 |
|
274 | $ hg update -r -2 | |
219 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
275 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
220 |
|
276 | |||
221 | $ echo Another unrelated change >> unrelated.txt |
|
277 | $ echo Another unrelated change >> unrelated.txt | |
222 | $ hg ci -m "Another unrelated change" |
|
278 | $ hg ci -m "Another unrelated change" | |
223 | created new head |
|
279 | created new head | |
224 |
|
280 | |||
225 | $ hg tglog |
|
281 | $ hg tglog | |
226 | @ 4: b918d683b091 'Another unrelated change' |
|
282 | @ 4: b918d683b091 'Another unrelated change' | |
227 | | |
|
283 | | | |
228 | | o 3: 1ac17e43d8aa 'Rename file2 back to file1' |
|
284 | | o 3: 1ac17e43d8aa 'Rename file2 back to file1' | |
229 | |/ |
|
285 | |/ | |
230 | o 2: 480101d66d8d 'Unrelated change' |
|
286 | o 2: 480101d66d8d 'Unrelated change' | |
231 | | |
|
287 | | | |
232 | o 1: be44c61debd2 'Rename file1 to file2' |
|
288 | o 1: be44c61debd2 'Rename file1 to file2' | |
233 | | |
|
289 | | | |
234 | o 0: 8ce9a346991d 'Adding file1' |
|
290 | o 0: 8ce9a346991d 'Adding file1' | |
235 |
|
291 | |||
236 |
|
292 | |||
237 | $ hg rebase -s 4 -d 3 |
|
293 | $ hg rebase -s 4 -d 3 | |
238 | rebasing 4:b918d683b091 "Another unrelated change" (tip) |
|
294 | rebasing 4:b918d683b091 "Another unrelated change" (tip) | |
239 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/b918d683b091-3024bc57-rebase.hg |
|
295 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/b918d683b091-3024bc57-rebase.hg | |
240 |
|
296 | |||
241 | $ hg diff --stat -c . |
|
297 | $ hg diff --stat -c . | |
242 | unrelated.txt | 1 + |
|
298 | unrelated.txt | 1 + | |
243 | 1 files changed, 1 insertions(+), 0 deletions(-) |
|
299 | 1 files changed, 1 insertions(+), 0 deletions(-) | |
244 |
|
300 | |||
245 | $ cd .. |
|
301 | $ cd .. | |
246 |
|
302 | |||
247 | Verify that copies get preserved (issue4192). |
|
303 | Verify that copies get preserved (issue4192). | |
248 | $ hg init copy-gets-preserved |
|
304 | $ hg init copy-gets-preserved | |
249 | $ cd copy-gets-preserved |
|
305 | $ cd copy-gets-preserved | |
250 |
|
306 | |||
251 | $ echo a > a |
|
307 | $ echo a > a | |
252 | $ hg add a |
|
308 | $ hg add a | |
253 | $ hg commit --message "File a created" |
|
309 | $ hg commit --message "File a created" | |
254 | $ hg copy a b |
|
310 | $ hg copy a b | |
255 | $ echo b > b |
|
311 | $ echo b > b | |
256 | $ hg commit --message "File b created as copy of a and modified" |
|
312 | $ hg commit --message "File b created as copy of a and modified" | |
257 | $ hg copy b c |
|
313 | $ hg copy b c | |
258 | $ echo c > c |
|
314 | $ echo c > c | |
259 | $ hg commit --message "File c created as copy of b and modified" |
|
315 | $ hg commit --message "File c created as copy of b and modified" | |
260 | $ hg copy c d |
|
316 | $ hg copy c d | |
261 | $ echo d > d |
|
317 | $ echo d > d | |
262 | $ hg commit --message "File d created as copy of c and modified" |
|
318 | $ hg commit --message "File d created as copy of c and modified" | |
263 |
|
319 | |||
264 | Note that there are four entries in the log for d |
|
320 | Note that there are four entries in the log for d | |
265 | $ hg tglog --follow d |
|
321 | $ hg tglog --follow d | |
266 | @ 3: 421b7e82bb85 'File d created as copy of c and modified' |
|
322 | @ 3: 421b7e82bb85 'File d created as copy of c and modified' | |
267 | | |
|
323 | | | |
268 | o 2: 327f772bc074 'File c created as copy of b and modified' |
|
324 | o 2: 327f772bc074 'File c created as copy of b and modified' | |
269 | | |
|
325 | | | |
270 | o 1: 79d255d24ad2 'File b created as copy of a and modified' |
|
326 | o 1: 79d255d24ad2 'File b created as copy of a and modified' | |
271 | | |
|
327 | | | |
272 | o 0: b220cd6d2326 'File a created' |
|
328 | o 0: b220cd6d2326 'File a created' | |
273 |
|
329 | |||
274 | Update back to before we performed copies, and inject an unrelated change. |
|
330 | Update back to before we performed copies, and inject an unrelated change. | |
275 | $ hg update 0 |
|
331 | $ hg update 0 | |
276 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
332 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
277 |
|
333 | |||
278 | $ echo unrelated > unrelated |
|
334 | $ echo unrelated > unrelated | |
279 | $ hg add unrelated |
|
335 | $ hg add unrelated | |
280 | $ hg commit --message "Unrelated file created" |
|
336 | $ hg commit --message "Unrelated file created" | |
281 | created new head |
|
337 | created new head | |
282 | $ hg update 4 |
|
338 | $ hg update 4 | |
283 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
339 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
284 |
|
340 | |||
285 | Rebase the copies on top of the unrelated change. |
|
341 | Rebase the copies on top of the unrelated change. | |
286 | $ hg rebase --source 1 --dest 4 |
|
342 | $ hg rebase --source 1 --dest 4 | |
287 | rebasing 1:79d255d24ad2 "File b created as copy of a and modified" |
|
343 | rebasing 1:79d255d24ad2 "File b created as copy of a and modified" | |
288 | rebasing 2:327f772bc074 "File c created as copy of b and modified" |
|
344 | rebasing 2:327f772bc074 "File c created as copy of b and modified" | |
289 | rebasing 3:421b7e82bb85 "File d created as copy of c and modified" |
|
345 | rebasing 3:421b7e82bb85 "File d created as copy of c and modified" | |
290 | saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/strip-backup/79d255d24ad2-a2265555-rebase.hg |
|
346 | saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/strip-backup/79d255d24ad2-a2265555-rebase.hg | |
291 | $ hg update 4 |
|
347 | $ hg update 4 | |
292 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
348 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
293 |
|
349 | |||
294 | There should still be four entries in the log for d |
|
350 | There should still be four entries in the log for d | |
295 | $ hg tglog --follow d |
|
351 | $ hg tglog --follow d | |
296 | @ 4: dbb9ba033561 'File d created as copy of c and modified' |
|
352 | @ 4: dbb9ba033561 'File d created as copy of c and modified' | |
297 | | |
|
353 | | | |
298 | o 3: af74b229bc02 'File c created as copy of b and modified' |
|
354 | o 3: af74b229bc02 'File c created as copy of b and modified' | |
299 | | |
|
355 | | | |
300 | o 2: 68bf06433839 'File b created as copy of a and modified' |
|
356 | o 2: 68bf06433839 'File b created as copy of a and modified' | |
301 | : |
|
357 | : | |
302 | o 0: b220cd6d2326 'File a created' |
|
358 | o 0: b220cd6d2326 'File a created' | |
303 |
|
359 | |||
304 | Same steps as above, but with --collapse on rebase to make sure the |
|
360 | Same steps as above, but with --collapse on rebase to make sure the | |
305 | copy records collapse correctly. |
|
361 | copy records collapse correctly. | |
306 | $ hg co 1 |
|
362 | $ hg co 1 | |
307 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
363 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
308 | $ echo more >> unrelated |
|
364 | $ echo more >> unrelated | |
309 | $ hg ci -m 'unrelated commit is unrelated' |
|
365 | $ hg ci -m 'unrelated commit is unrelated' | |
310 | created new head |
|
366 | created new head | |
311 | $ hg rebase -s 2 --dest 5 --collapse |
|
367 | $ hg rebase -s 2 --dest 5 --collapse | |
312 | rebasing 2:68bf06433839 "File b created as copy of a and modified" |
|
368 | rebasing 2:68bf06433839 "File b created as copy of a and modified" | |
313 | rebasing 3:af74b229bc02 "File c created as copy of b and modified" |
|
369 | rebasing 3:af74b229bc02 "File c created as copy of b and modified" | |
314 | merging b and c to c |
|
370 | merging b and c to c | |
315 | rebasing 4:dbb9ba033561 "File d created as copy of c and modified" |
|
371 | rebasing 4:dbb9ba033561 "File d created as copy of c and modified" | |
316 | merging c and d to d |
|
372 | merging c and d to d | |
317 | saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/strip-backup/68bf06433839-dde37595-rebase.hg |
|
373 | saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/strip-backup/68bf06433839-dde37595-rebase.hg | |
318 | $ hg co tip |
|
374 | $ hg co tip | |
319 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
375 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
320 |
|
376 | |||
321 | This should show both revision 3 and 0 since 'd' was transitively a |
|
377 | This should show both revision 3 and 0 since 'd' was transitively a | |
322 | copy of 'a'. |
|
378 | copy of 'a'. | |
323 |
|
379 | |||
324 | $ hg tglog --follow d |
|
380 | $ hg tglog --follow d | |
325 | @ 3: 5a46b94210e5 'Collapsed revision |
|
381 | @ 3: 5a46b94210e5 'Collapsed revision | |
326 | : * File b created as copy of a and modified |
|
382 | : * File b created as copy of a and modified | |
327 | : * File c created as copy of b and modified |
|
383 | : * File c created as copy of b and modified | |
328 | : * File d created as copy of c and modified' |
|
384 | : * File d created as copy of c and modified' | |
329 | o 0: b220cd6d2326 'File a created' |
|
385 | o 0: b220cd6d2326 'File a created' | |
330 |
|
386 | |||
331 |
|
387 | |||
332 | $ cd .. |
|
388 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now