Show More
@@ -1,258 +1,306 b'' | |||||
1 | $ cat >> $HGRCPATH <<EOF |
|
1 | $ cat >> $HGRCPATH <<EOF | |
2 | > [extensions] |
|
2 | > [extensions] | |
3 | > rebase= |
|
3 | > rebase= | |
4 | > |
|
4 | > | |
5 | > [alias] |
|
5 | > [alias] | |
6 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" |
|
6 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
7 | > EOF |
|
7 | > EOF | |
8 |
|
8 | |||
9 | $ hg init repo |
|
9 | $ hg init repo | |
10 | $ cd repo |
|
10 | $ cd repo | |
11 |
|
11 | |||
12 | $ echo A > a |
|
12 | $ echo A > a | |
13 | $ echo >> a |
|
13 | $ echo >> a | |
14 | $ hg ci -Am A |
|
14 | $ hg ci -Am A | |
15 | adding a |
|
15 | adding a | |
16 |
|
16 | |||
17 | $ echo B > a |
|
17 | $ echo B > a | |
18 | $ echo >> a |
|
18 | $ echo >> a | |
19 | $ hg ci -m B |
|
19 | $ hg ci -m B | |
20 |
|
20 | |||
21 | $ echo C > a |
|
21 | $ echo C > a | |
22 | $ echo >> a |
|
22 | $ echo >> a | |
23 | $ hg ci -m C |
|
23 | $ hg ci -m C | |
24 |
|
24 | |||
25 | $ hg up -q -C 0 |
|
25 | $ hg up -q -C 0 | |
26 |
|
26 | |||
27 | $ echo D >> a |
|
27 | $ echo D >> a | |
28 | $ hg ci -Am AD |
|
28 | $ hg ci -Am AD | |
29 | created new head |
|
29 | created new head | |
30 |
|
30 | |||
31 | $ hg tglog |
|
31 | $ hg tglog | |
32 | @ 3: 'AD' |
|
32 | @ 3: 'AD' | |
33 | | |
|
33 | | | |
34 | | o 2: 'C' |
|
34 | | o 2: 'C' | |
35 | | | |
|
35 | | | | |
36 | | o 1: 'B' |
|
36 | | o 1: 'B' | |
37 | |/ |
|
37 | |/ | |
38 | o 0: 'A' |
|
38 | o 0: 'A' | |
39 |
|
39 | |||
40 | $ hg rebase -s 1 -d 3 |
|
40 | $ hg rebase -s 1 -d 3 | |
41 | merging a |
|
41 | merging a | |
42 | merging a |
|
42 | merging a | |
43 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-backup.hg (glob) |
|
43 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-backup.hg (glob) | |
44 |
|
44 | |||
45 | $ hg tglog |
|
45 | $ hg tglog | |
46 | o 3: 'C' |
|
46 | o 3: 'C' | |
47 | | |
|
47 | | | |
48 | o 2: 'B' |
|
48 | o 2: 'B' | |
49 | | |
|
49 | | | |
50 | @ 1: 'AD' |
|
50 | @ 1: 'AD' | |
51 | | |
|
51 | | | |
52 | o 0: 'A' |
|
52 | o 0: 'A' | |
53 |
|
53 | |||
54 |
|
54 | |||
55 | $ cd .. |
|
55 | $ cd .. | |
56 |
|
56 | |||
57 |
|
57 | |||
58 | Test rebasing of merges with ancestors of the rebase destination - a situation |
|
58 | Test rebasing of merges with ancestors of the rebase destination - a situation | |
59 | that often happens when trying to recover from repeated merging with a mainline |
|
59 | that often happens when trying to recover from repeated merging with a mainline | |
60 | branch. |
|
60 | branch. | |
61 |
|
61 | |||
62 | The test case creates a dev branch that contains a couple of merges from the |
|
62 | The test case creates a dev branch that contains a couple of merges from the | |
63 | default branch. When rebasing to the default branch, these merges would be |
|
63 | default branch. When rebasing to the default branch, these merges would be | |
64 | merges with ancestors on the same branch. The merges _could_ contain some |
|
64 | merges with ancestors on the same branch. The merges _could_ contain some | |
65 | interesting conflict resolutions or additional changes in the merge commit, but |
|
65 | interesting conflict resolutions or additional changes in the merge commit, but | |
66 | that is mixed up with the actual merge stuff and there is in general no way to |
|
66 | that is mixed up with the actual merge stuff and there is in general no way to | |
67 | separate them. |
|
67 | separate them. | |
68 |
|
68 | |||
69 | Note: The dev branch contains _no_ changes to f-default. It might be unclear |
|
69 | Note: The dev branch contains _no_ changes to f-default. It might be unclear | |
70 | how rebasing of ancestor merges should be handled, but the current behavior |
|
70 | how rebasing of ancestor merges should be handled, but the current behavior | |
71 | with spurious prompts for conflicts in files that didn't change seems very |
|
71 | with spurious prompts for conflicts in files that didn't change seems very | |
72 | wrong. |
|
72 | wrong. | |
73 |
|
73 | |||
74 | $ hg init ancestor-merge |
|
74 | $ hg init ancestor-merge | |
75 | $ cd ancestor-merge |
|
75 | $ cd ancestor-merge | |
76 |
|
76 | |||
77 | $ touch f-default |
|
77 | $ touch f-default | |
78 | $ hg ci -Aqm 'default: create f-default' |
|
78 | $ hg ci -Aqm 'default: create f-default' | |
79 |
|
79 | |||
80 | $ hg branch -q dev |
|
80 | $ hg branch -q dev | |
81 | $ hg ci -qm 'dev: create branch' |
|
81 | $ hg ci -qm 'dev: create branch' | |
82 |
|
82 | |||
83 | $ echo stuff > f-dev |
|
83 | $ echo stuff > f-dev | |
84 | $ hg ci -Aqm 'dev: f-dev stuff' |
|
84 | $ hg ci -Aqm 'dev: f-dev stuff' | |
85 |
|
85 | |||
86 | $ hg up -q default |
|
86 | $ hg up -q default | |
87 | $ echo stuff > f-default |
|
87 | $ echo stuff > f-default | |
88 | $ hg ci -m 'default: f-default stuff' |
|
88 | $ hg ci -m 'default: f-default stuff' | |
89 |
|
89 | |||
90 | $ hg up -q dev |
|
90 | $ hg up -q dev | |
91 | $ hg merge -q default |
|
91 | $ hg merge -q default | |
92 | $ hg ci -m 'dev: merge default' |
|
92 | $ hg ci -m 'dev: merge default' | |
93 |
|
93 | |||
94 | $ hg up -q default |
|
94 | $ hg up -q default | |
95 | $ hg rm f-default |
|
95 | $ hg rm f-default | |
96 | $ hg ci -m 'default: remove f-default' |
|
96 | $ hg ci -m 'default: remove f-default' | |
97 |
|
97 | |||
98 | $ hg up -q dev |
|
98 | $ hg up -q dev | |
99 | $ hg merge -q default |
|
99 | $ hg merge -q default | |
100 | $ hg ci -m 'dev: merge default' |
|
100 | $ hg ci -m 'dev: merge default' | |
101 |
|
101 | |||
102 | $ hg up -q default |
|
102 | $ hg up -q default | |
103 | $ echo stuff > f-other |
|
103 | $ echo stuff > f-other | |
104 | $ hg ci -Aqm 'default: f-other stuff' |
|
104 | $ hg ci -Aqm 'default: f-other stuff' | |
105 |
|
105 | |||
106 | $ hg tglog |
|
106 | $ hg tglog | |
107 | @ 7: 'default: f-other stuff' |
|
107 | @ 7: 'default: f-other stuff' | |
108 | | |
|
108 | | | |
109 | | o 6: 'dev: merge default' dev |
|
109 | | o 6: 'dev: merge default' dev | |
110 | |/| |
|
110 | |/| | |
111 | o | 5: 'default: remove f-default' |
|
111 | o | 5: 'default: remove f-default' | |
112 | | | |
|
112 | | | | |
113 | | o 4: 'dev: merge default' dev |
|
113 | | o 4: 'dev: merge default' dev | |
114 | |/| |
|
114 | |/| | |
115 | o | 3: 'default: f-default stuff' |
|
115 | o | 3: 'default: f-default stuff' | |
116 | | | |
|
116 | | | | |
117 | | o 2: 'dev: f-dev stuff' dev |
|
117 | | o 2: 'dev: f-dev stuff' dev | |
118 | | | |
|
118 | | | | |
119 | | o 1: 'dev: create branch' dev |
|
119 | | o 1: 'dev: create branch' dev | |
120 | |/ |
|
120 | |/ | |
121 | o 0: 'default: create f-default' |
|
121 | o 0: 'default: create f-default' | |
122 |
|
122 | |||
123 | $ hg clone -qU . ../ancestor-merge-2 |
|
123 | $ hg clone -qU . ../ancestor-merge-2 | |
124 |
|
124 | |||
125 | Full rebase all the way back from branching point: |
|
125 | Full rebase all the way back from branching point: | |
126 |
|
126 | |||
127 | $ hg rebase -r 'only(dev,default)' -d default |
|
127 | $ hg rebase -r 'only(dev,default)' -d default | |
128 | remote changed f-default which local deleted |
|
128 | remote changed f-default which local deleted | |
129 | use (c)hanged version or leave (d)eleted? c |
|
129 | use (c)hanged version or leave (d)eleted? c | |
130 | local changed f-default which remote deleted |
|
130 | local changed f-default which remote deleted | |
131 | use (c)hanged version or (d)elete? c |
|
131 | use (c)hanged version or (d)elete? c | |
132 | saved backup bundle to $TESTTMP/ancestor-merge/.hg/strip-backup/1d1a643d390e-backup.hg (glob) |
|
132 | saved backup bundle to $TESTTMP/ancestor-merge/.hg/strip-backup/1d1a643d390e-backup.hg (glob) | |
133 | $ hg tglog |
|
133 | $ hg tglog | |
134 | o 5: 'dev: merge default' |
|
134 | o 5: 'dev: merge default' | |
135 | | |
|
135 | | | |
136 | o 4: 'dev: f-dev stuff' |
|
136 | o 4: 'dev: f-dev stuff' | |
137 | | |
|
137 | | | |
138 | @ 3: 'default: f-other stuff' |
|
138 | @ 3: 'default: f-other stuff' | |
139 | | |
|
139 | | | |
140 | o 2: 'default: remove f-default' |
|
140 | o 2: 'default: remove f-default' | |
141 | | |
|
141 | | | |
142 | o 1: 'default: f-default stuff' |
|
142 | o 1: 'default: f-default stuff' | |
143 | | |
|
143 | | | |
144 | o 0: 'default: create f-default' |
|
144 | o 0: 'default: create f-default' | |
145 |
|
145 | |||
146 | Grafty cherry picking rebasing: |
|
146 | Grafty cherry picking rebasing: | |
147 |
|
147 | |||
148 | $ cd ../ancestor-merge-2 |
|
148 | $ cd ../ancestor-merge-2 | |
149 |
|
149 | |||
150 | $ hg phase -fdr0: |
|
150 | $ hg phase -fdr0: | |
151 | $ hg rebase -r 'children(only(dev,default))' -d default |
|
151 | $ hg rebase -r 'children(only(dev,default))' -d default | |
152 | remote changed f-default which local deleted |
|
152 | remote changed f-default which local deleted | |
153 | use (c)hanged version or leave (d)eleted? c |
|
153 | use (c)hanged version or leave (d)eleted? c | |
154 | local changed f-default which remote deleted |
|
154 | local changed f-default which remote deleted | |
155 | use (c)hanged version or (d)elete? c |
|
155 | use (c)hanged version or (d)elete? c | |
156 | saved backup bundle to $TESTTMP/ancestor-merge-2/.hg/strip-backup/ec2c14fb2984-backup.hg (glob) |
|
156 | saved backup bundle to $TESTTMP/ancestor-merge-2/.hg/strip-backup/ec2c14fb2984-backup.hg (glob) | |
157 | $ hg tglog |
|
157 | $ hg tglog | |
158 | o 6: 'dev: merge default' |
|
158 | o 6: 'dev: merge default' | |
159 | | |
|
159 | | | |
160 | o 5: 'dev: f-dev stuff' |
|
160 | o 5: 'dev: f-dev stuff' | |
161 | | |
|
161 | | | |
162 | o 4: 'default: f-other stuff' |
|
162 | o 4: 'default: f-other stuff' | |
163 | | |
|
163 | | | |
164 | o 3: 'default: remove f-default' |
|
164 | o 3: 'default: remove f-default' | |
165 | | |
|
165 | | | |
166 | o 2: 'default: f-default stuff' |
|
166 | o 2: 'default: f-default stuff' | |
167 | | |
|
167 | | | |
168 | | o 1: 'dev: create branch' dev |
|
168 | | o 1: 'dev: create branch' dev | |
169 | |/ |
|
169 | |/ | |
170 | o 0: 'default: create f-default' |
|
170 | o 0: 'default: create f-default' | |
171 |
|
171 | |||
172 | $ cd .. |
|
172 | $ cd .. | |
173 |
|
173 | |||
174 |
|
174 | |||
175 | Test order of parents of rebased merged with un-rebased changes as p1. |
|
175 | Test order of parents of rebased merged with un-rebased changes as p1. | |
176 |
|
176 | |||
177 | $ hg init parentorder |
|
177 | $ hg init parentorder | |
178 | $ cd parentorder |
|
178 | $ cd parentorder | |
179 | $ touch f |
|
179 | $ touch f | |
180 | $ hg ci -Aqm common |
|
180 | $ hg ci -Aqm common | |
181 | $ touch change |
|
181 | $ touch change | |
182 | $ hg ci -Aqm change |
|
182 | $ hg ci -Aqm change | |
183 | $ touch target |
|
183 | $ touch target | |
184 | $ hg ci -Aqm target |
|
184 | $ hg ci -Aqm target | |
185 | $ hg up -qr 0 |
|
185 | $ hg up -qr 0 | |
186 | $ touch outside |
|
186 | $ touch outside | |
187 | $ hg ci -Aqm outside |
|
187 | $ hg ci -Aqm outside | |
188 | $ hg merge -qr 1 |
|
188 | $ hg merge -qr 1 | |
189 | $ hg ci -m 'merge p1 3=outside p2 1=ancestor' |
|
189 | $ hg ci -m 'merge p1 3=outside p2 1=ancestor' | |
190 | $ hg par |
|
190 | $ hg par | |
191 | changeset: 4:6990226659be |
|
191 | changeset: 4:6990226659be | |
192 | tag: tip |
|
192 | tag: tip | |
193 | parent: 3:f59da8fc0fcf |
|
193 | parent: 3:f59da8fc0fcf | |
194 | parent: 1:dd40c13f7a6f |
|
194 | parent: 1:dd40c13f7a6f | |
195 | user: test |
|
195 | user: test | |
196 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
196 | date: Thu Jan 01 00:00:00 1970 +0000 | |
197 | summary: merge p1 3=outside p2 1=ancestor |
|
197 | summary: merge p1 3=outside p2 1=ancestor | |
198 |
|
198 | |||
199 | $ hg up -qr 1 |
|
199 | $ hg up -qr 1 | |
200 | $ hg merge -qr 3 |
|
200 | $ hg merge -qr 3 | |
201 | $ hg ci -qm 'merge p1 1=ancestor p2 3=outside' |
|
201 | $ hg ci -qm 'merge p1 1=ancestor p2 3=outside' | |
202 | $ hg par |
|
202 | $ hg par | |
203 | changeset: 5:a57575f79074 |
|
203 | changeset: 5:a57575f79074 | |
204 | tag: tip |
|
204 | tag: tip | |
205 | parent: 1:dd40c13f7a6f |
|
205 | parent: 1:dd40c13f7a6f | |
206 | parent: 3:f59da8fc0fcf |
|
206 | parent: 3:f59da8fc0fcf | |
207 | user: test |
|
207 | user: test | |
208 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
208 | date: Thu Jan 01 00:00:00 1970 +0000 | |
209 | summary: merge p1 1=ancestor p2 3=outside |
|
209 | summary: merge p1 1=ancestor p2 3=outside | |
210 |
|
210 | |||
211 | $ hg tglog |
|
211 | $ hg tglog | |
212 | @ 5: 'merge p1 1=ancestor p2 3=outside' |
|
212 | @ 5: 'merge p1 1=ancestor p2 3=outside' | |
213 | |\ |
|
213 | |\ | |
214 | +---o 4: 'merge p1 3=outside p2 1=ancestor' |
|
214 | +---o 4: 'merge p1 3=outside p2 1=ancestor' | |
215 | | |/ |
|
215 | | |/ | |
216 | | o 3: 'outside' |
|
216 | | o 3: 'outside' | |
217 | | | |
|
217 | | | | |
218 | +---o 2: 'target' |
|
218 | +---o 2: 'target' | |
219 | | | |
|
219 | | | | |
220 | o | 1: 'change' |
|
220 | o | 1: 'change' | |
221 | |/ |
|
221 | |/ | |
222 | o 0: 'common' |
|
222 | o 0: 'common' | |
223 |
|
223 | |||
224 | $ hg rebase -r 4 -d 2 |
|
224 | $ hg rebase -r 4 -d 2 | |
225 | saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/6990226659be-backup.hg (glob) |
|
225 | saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/6990226659be-backup.hg (glob) | |
226 | $ hg tip |
|
226 | $ hg tip | |
227 | changeset: 5:cca50676b1c5 |
|
227 | changeset: 5:cca50676b1c5 | |
228 | tag: tip |
|
228 | tag: tip | |
229 | parent: 2:a60552eb93fb |
|
229 | parent: 2:a60552eb93fb | |
230 | parent: 3:f59da8fc0fcf |
|
230 | parent: 3:f59da8fc0fcf | |
231 | user: test |
|
231 | user: test | |
232 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
232 | date: Thu Jan 01 00:00:00 1970 +0000 | |
233 | summary: merge p1 3=outside p2 1=ancestor |
|
233 | summary: merge p1 3=outside p2 1=ancestor | |
234 |
|
234 | |||
235 | $ hg rebase -r 4 -d 2 |
|
235 | $ hg rebase -r 4 -d 2 | |
236 | saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/a57575f79074-backup.hg (glob) |
|
236 | saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/a57575f79074-backup.hg (glob) | |
237 | $ hg tip |
|
237 | $ hg tip | |
238 | changeset: 5:f9daf77ffe76 |
|
238 | changeset: 5:f9daf77ffe76 | |
239 | tag: tip |
|
239 | tag: tip | |
240 | parent: 2:a60552eb93fb |
|
240 | parent: 2:a60552eb93fb | |
241 | parent: 3:f59da8fc0fcf |
|
241 | parent: 3:f59da8fc0fcf | |
242 | user: test |
|
242 | user: test | |
243 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
243 | date: Thu Jan 01 00:00:00 1970 +0000 | |
244 | summary: merge p1 1=ancestor p2 3=outside |
|
244 | summary: merge p1 1=ancestor p2 3=outside | |
245 |
|
245 | |||
246 | $ hg tglog |
|
246 | $ hg tglog | |
247 | @ 5: 'merge p1 1=ancestor p2 3=outside' |
|
247 | @ 5: 'merge p1 1=ancestor p2 3=outside' | |
248 | |\ |
|
248 | |\ | |
249 | +---o 4: 'merge p1 3=outside p2 1=ancestor' |
|
249 | +---o 4: 'merge p1 3=outside p2 1=ancestor' | |
250 | | |/ |
|
250 | | |/ | |
251 | | o 3: 'outside' |
|
251 | | o 3: 'outside' | |
252 | | | |
|
252 | | | | |
253 | o | 2: 'target' |
|
253 | o | 2: 'target' | |
254 | | | |
|
254 | | | | |
255 | o | 1: 'change' |
|
255 | o | 1: 'change' | |
256 | |/ |
|
256 | |/ | |
257 | o 0: 'common' |
|
257 | o 0: 'common' | |
258 |
|
258 | |||
|
259 | rebase of merge of ancestors | |||
|
260 | ||||
|
261 | $ hg up -qr 2 | |||
|
262 | $ hg merge -qr 3 | |||
|
263 | $ echo 'other change while merging future "rebase ancestors"' > other | |||
|
264 | $ hg ci -Aqm 'merge rebase ancestors' | |||
|
265 | $ hg rebase -d 5 -v | |||
|
266 | resolving manifests | |||
|
267 | removing other | |||
|
268 | note: merging f9daf77ffe76+ and 4c5f12f25ebe using bids from ancestors a60552eb93fb and f59da8fc0fcf | |||
|
269 | ||||
|
270 | calculating bids for ancestor a60552eb93fb | |||
|
271 | resolving manifests | |||
|
272 | ||||
|
273 | calculating bids for ancestor f59da8fc0fcf | |||
|
274 | resolving manifests | |||
|
275 | ||||
|
276 | auction for merging merge bids | |||
|
277 | other: consensus for g | |||
|
278 | end of auction | |||
|
279 | ||||
|
280 | getting other | |||
|
281 | other | |||
|
282 | rebase merging completed | |||
|
283 | 1 changesets found | |||
|
284 | saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/4c5f12f25ebe-backup.hg (glob) | |||
|
285 | 1 changesets found | |||
|
286 | adding branch | |||
|
287 | adding changesets | |||
|
288 | adding manifests | |||
|
289 | adding file changes | |||
|
290 | added 1 changesets with 1 changes to 1 files | |||
|
291 | rebase completed | |||
|
292 | $ hg tglog | |||
|
293 | @ 6: 'merge rebase ancestors' | |||
|
294 | | | |||
|
295 | o 5: 'merge p1 1=ancestor p2 3=outside' | |||
|
296 | |\ | |||
|
297 | +---o 4: 'merge p1 3=outside p2 1=ancestor' | |||
|
298 | | |/ | |||
|
299 | | o 3: 'outside' | |||
|
300 | | | | |||
|
301 | o | 2: 'target' | |||
|
302 | | | | |||
|
303 | o | 1: 'change' | |||
|
304 | |/ | |||
|
305 | o 0: 'common' | |||
|
306 |
General Comments 0
You need to be logged in to leave comments.
Login now