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