Show More
@@ -1,389 +1,396 b'' | |||
|
1 | #testcases filelog compatibility changeset | |
|
1 | #testcases filelog compatibility changeset sidedata | |
|
2 | 2 | |
|
3 | 3 | $ cat >> $HGRCPATH << EOF |
|
4 | 4 | > [extensions] |
|
5 | 5 | > rebase= |
|
6 | 6 | > [alias] |
|
7 | 7 | > l = log -G -T '{rev} {desc}\n{files}\n' |
|
8 | 8 | > EOF |
|
9 | 9 | |
|
10 | 10 | #if compatibility |
|
11 | 11 | $ cat >> $HGRCPATH << EOF |
|
12 | 12 | > [experimental] |
|
13 | 13 | > copies.read-from = compatibility |
|
14 | 14 | > EOF |
|
15 | 15 | #endif |
|
16 | 16 | |
|
17 | 17 | #if changeset |
|
18 | 18 | $ cat >> $HGRCPATH << EOF |
|
19 | 19 | > [experimental] |
|
20 | 20 | > copies.read-from = changeset-only |
|
21 | 21 | > copies.write-to = changeset-only |
|
22 | 22 | > EOF |
|
23 | 23 | #endif |
|
24 | 24 | |
|
25 | #if sidedata | |
|
26 | $ cat >> $HGRCPATH << EOF | |
|
27 | > [format] | |
|
28 | > exp-use-copies-side-data-changeset = yes | |
|
29 | > EOF | |
|
30 | #endif | |
|
31 | ||
|
25 | 32 | $ REPONUM=0 |
|
26 | 33 | $ newrepo() { |
|
27 | 34 | > cd $TESTTMP |
|
28 | 35 | > REPONUM=`expr $REPONUM + 1` |
|
29 | 36 | > hg init repo-$REPONUM |
|
30 | 37 | > cd repo-$REPONUM |
|
31 | 38 | > } |
|
32 | 39 | |
|
33 | 40 | Copy a file, then delete destination, then copy again. This does not create a new filelog entry. |
|
34 | 41 | $ newrepo |
|
35 | 42 | $ echo x > x |
|
36 | 43 | $ hg ci -Aqm 'add x' |
|
37 | 44 | $ echo x2 > x |
|
38 | 45 | $ hg ci -m 'modify x' |
|
39 | 46 | $ hg co -q 0 |
|
40 | 47 | $ hg cp x y |
|
41 | 48 | $ hg ci -qm 'copy x to y' |
|
42 | 49 | $ hg rm y |
|
43 | 50 | $ hg ci -m 'remove y' |
|
44 | 51 | $ hg cp -f x y |
|
45 | 52 | $ hg ci -m 'copy x onto y (again)' |
|
46 | 53 | $ hg l |
|
47 | 54 | @ 4 copy x onto y (again) |
|
48 | 55 | | y |
|
49 | 56 | o 3 remove y |
|
50 | 57 | | y |
|
51 | 58 | o 2 copy x to y |
|
52 | 59 | | y |
|
53 | 60 | | o 1 modify x |
|
54 | 61 | |/ x |
|
55 | 62 | o 0 add x |
|
56 | 63 | x |
|
57 | 64 | $ hg debugp1copies -r 4 |
|
58 | 65 | x -> y |
|
59 | 66 | $ hg debugpathcopies 0 4 |
|
60 | 67 | x -> y |
|
61 | 68 | $ hg graft -r 1 |
|
62 | 69 | grafting 1:* "modify x" (glob) |
|
63 | 70 | merging y and x to y |
|
64 | 71 | $ hg co -qC 1 |
|
65 | 72 | $ hg graft -r 4 |
|
66 | 73 | grafting 4:* "copy x onto y (again)" (glob) |
|
67 | 74 | merging x and y to y |
|
68 | 75 | |
|
69 | 76 | Copy x to y, then remove y, then add back y. With copy metadata in the |
|
70 | 77 | changeset, this could easily end up reporting y as copied from x (if we don't |
|
71 | 78 | unmark it as a copy when it's removed). Despite x and y not being related, we |
|
72 | 79 | want grafts to propagate across the rename. |
|
73 | 80 | $ newrepo |
|
74 | 81 | $ echo x > x |
|
75 | 82 | $ hg ci -Aqm 'add x' |
|
76 | 83 | $ echo x2 > x |
|
77 | 84 | $ hg ci -m 'modify x' |
|
78 | 85 | $ hg co -q 0 |
|
79 | 86 | $ hg mv x y |
|
80 | 87 | $ hg ci -qm 'rename x to y' |
|
81 | 88 | $ hg rm y |
|
82 | 89 | $ hg ci -qm 'remove y' |
|
83 | 90 | $ echo x > y |
|
84 | 91 | $ hg ci -Aqm 'add back y' |
|
85 | 92 | $ hg l |
|
86 | 93 | @ 4 add back y |
|
87 | 94 | | y |
|
88 | 95 | o 3 remove y |
|
89 | 96 | | y |
|
90 | 97 | o 2 rename x to y |
|
91 | 98 | | x y |
|
92 | 99 | | o 1 modify x |
|
93 | 100 | |/ x |
|
94 | 101 | o 0 add x |
|
95 | 102 | x |
|
96 | 103 | $ hg debugpathcopies 0 4 |
|
97 | 104 | BROKEN: This should succeed and merge the changes from x into y |
|
98 | 105 | $ hg graft -r 1 |
|
99 | 106 | grafting 1:* "modify x" (glob) |
|
100 | 107 | file 'x' was deleted in local [local] but was modified in other [graft]. |
|
101 | 108 | You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. |
|
102 | 109 | What do you want to do? u |
|
103 | 110 | abort: unresolved conflicts, can't continue |
|
104 | 111 | (use 'hg resolve' and 'hg graft --continue') |
|
105 | 112 | [255] |
|
106 | 113 | |
|
107 | 114 | Add x, remove it, then add it back, then rename x to y. Similar to the case |
|
108 | 115 | above, but here the break in history is before the rename. |
|
109 | 116 | $ newrepo |
|
110 | 117 | $ echo x > x |
|
111 | 118 | $ hg ci -Aqm 'add x' |
|
112 | 119 | $ echo x2 > x |
|
113 | 120 | $ hg ci -m 'modify x' |
|
114 | 121 | $ hg co -q 0 |
|
115 | 122 | $ hg rm x |
|
116 | 123 | $ hg ci -qm 'remove x' |
|
117 | 124 | $ echo x > x |
|
118 | 125 | $ hg ci -Aqm 'add x again' |
|
119 | 126 | $ hg mv x y |
|
120 | 127 | $ hg ci -m 'rename x to y' |
|
121 | 128 | $ hg l |
|
122 | 129 | @ 4 rename x to y |
|
123 | 130 | | x y |
|
124 | 131 | o 3 add x again |
|
125 | 132 | | x |
|
126 | 133 | o 2 remove x |
|
127 | 134 | | x |
|
128 | 135 | | o 1 modify x |
|
129 | 136 | |/ x |
|
130 | 137 | o 0 add x |
|
131 | 138 | x |
|
132 | 139 | $ hg debugpathcopies 0 4 |
|
133 | 140 | x -> y |
|
134 | 141 | $ hg graft -r 1 |
|
135 | 142 | grafting 1:* "modify x" (glob) |
|
136 | 143 | merging y and x to y |
|
137 | 144 | $ hg co -qC 1 |
|
138 | 145 | $ hg graft -r 4 |
|
139 | 146 | grafting 4:* "rename x to y" (glob) |
|
140 | 147 | merging x and y to y |
|
141 | 148 | |
|
142 | 149 | Add x, modify it, remove it, then add it back, then rename x to y. Similar to |
|
143 | 150 | the case above, but here the re-added file's nodeid is different from before |
|
144 | 151 | the break. |
|
145 | 152 | |
|
146 | 153 | $ newrepo |
|
147 | 154 | $ echo x > x |
|
148 | 155 | $ hg ci -Aqm 'add x' |
|
149 | 156 | $ echo x2 > x |
|
150 | 157 | $ hg ci -m 'modify x' |
|
151 | 158 | $ echo x3 > x |
|
152 | 159 | $ hg ci -qm 'modify x again' |
|
153 | 160 | $ hg co -q 1 |
|
154 | 161 | $ hg rm x |
|
155 | 162 | $ hg ci -qm 'remove x' |
|
156 | 163 | # Same content to avoid conflicts |
|
157 | 164 | $ hg revert -r 1 x |
|
158 | 165 | $ hg ci -Aqm 'add x again' |
|
159 | 166 | $ hg mv x y |
|
160 | 167 | $ hg ci -m 'rename x to y' |
|
161 | 168 | $ hg l |
|
162 | 169 | @ 5 rename x to y |
|
163 | 170 | | x y |
|
164 | 171 | o 4 add x again |
|
165 | 172 | | x |
|
166 | 173 | o 3 remove x |
|
167 | 174 | | x |
|
168 | 175 | | o 2 modify x again |
|
169 | 176 | |/ x |
|
170 | 177 | o 1 modify x |
|
171 | 178 | | x |
|
172 | 179 | o 0 add x |
|
173 | 180 | x |
|
174 | 181 | $ hg debugpathcopies 0 5 |
|
175 | x -> y (no-filelog !) | |
|
176 | #if no-filelog | |
|
182 | x -> y (no-filelog no-sidedata !) | |
|
183 | #if no-filelog no-sidedata | |
|
177 | 184 | $ hg graft -r 2 |
|
178 | 185 | grafting 2:* "modify x again" (glob) |
|
179 | 186 | merging y and x to y |
|
180 | 187 | #else |
|
181 | 188 | BROKEN: This should succeed and merge the changes from x into y |
|
182 | 189 | $ hg graft -r 2 |
|
183 | 190 | grafting 2:* "modify x again" (glob) |
|
184 | 191 | file 'x' was deleted in local [local] but was modified in other [graft]. |
|
185 | 192 | You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. |
|
186 | 193 | What do you want to do? u |
|
187 | 194 | abort: unresolved conflicts, can't continue |
|
188 | 195 | (use 'hg resolve' and 'hg graft --continue') |
|
189 | 196 | [255] |
|
190 | 197 | #endif |
|
191 | 198 | $ hg co -qC 2 |
|
192 | 199 | BROKEN: This should succeed and merge the changes from x into y |
|
193 | 200 | $ hg graft -r 5 |
|
194 | 201 | grafting 5:* "rename x to y"* (glob) |
|
195 | 202 | file 'x' was deleted in other [graft] but was modified in local [local]. |
|
196 | 203 | You can use (c)hanged version, (d)elete, or leave (u)nresolved. |
|
197 | 204 | What do you want to do? u |
|
198 | 205 | abort: unresolved conflicts, can't continue |
|
199 | 206 | (use 'hg resolve' and 'hg graft --continue') |
|
200 | 207 | [255] |
|
201 | 208 | |
|
202 | 209 | Add x, remove it, then add it back, rename x to y from the first commit. |
|
203 | 210 | Similar to the case above, but here the break in history is parallel to the |
|
204 | 211 | rename. |
|
205 | 212 | $ newrepo |
|
206 | 213 | $ echo x > x |
|
207 | 214 | $ hg ci -Aqm 'add x' |
|
208 | 215 | $ hg rm x |
|
209 | 216 | $ hg ci -qm 'remove x' |
|
210 | 217 | $ echo x > x |
|
211 | 218 | $ hg ci -Aqm 'add x again' |
|
212 | 219 | $ echo x2 > x |
|
213 | 220 | $ hg ci -m 'modify x' |
|
214 | 221 | $ hg co -q 0 |
|
215 | 222 | $ hg mv x y |
|
216 | 223 | $ hg ci -qm 'rename x to y' |
|
217 | 224 | $ hg l |
|
218 | 225 | @ 4 rename x to y |
|
219 | 226 | | x y |
|
220 | 227 | | o 3 modify x |
|
221 | 228 | | | x |
|
222 | 229 | | o 2 add x again |
|
223 | 230 | | | x |
|
224 | 231 | | o 1 remove x |
|
225 | 232 | |/ x |
|
226 | 233 | o 0 add x |
|
227 | 234 | x |
|
228 | 235 | $ hg debugpathcopies 2 4 |
|
229 | 236 | x -> y |
|
230 | 237 | $ hg graft -r 3 |
|
231 | 238 | grafting 3:* "modify x" (glob) |
|
232 | 239 | merging y and x to y |
|
233 | 240 | $ hg co -qC 3 |
|
234 | 241 | $ hg graft -r 4 |
|
235 | 242 | grafting 4:* "rename x to y" (glob) |
|
236 | 243 | merging x and y to y |
|
237 | 244 | |
|
238 | 245 | Add x, remove it, then add it back, rename x to y from the first commit. |
|
239 | 246 | Similar to the case above, but here the re-added file's nodeid is different |
|
240 | 247 | from the base. |
|
241 | 248 | $ newrepo |
|
242 | 249 | $ echo x > x |
|
243 | 250 | $ hg ci -Aqm 'add x' |
|
244 | 251 | $ hg rm x |
|
245 | 252 | $ hg ci -qm 'remove x' |
|
246 | 253 | $ echo x2 > x |
|
247 | 254 | $ hg ci -Aqm 'add x again with different content' |
|
248 | 255 | $ hg co -q 0 |
|
249 | 256 | $ hg mv x y |
|
250 | 257 | $ hg ci -qm 'rename x to y' |
|
251 | 258 | $ hg l |
|
252 | 259 | @ 3 rename x to y |
|
253 | 260 | | x y |
|
254 | 261 | | o 2 add x again with different content |
|
255 | 262 | | | x |
|
256 | 263 | | o 1 remove x |
|
257 | 264 | |/ x |
|
258 | 265 | o 0 add x |
|
259 | 266 | x |
|
260 | 267 | $ hg debugpathcopies 2 3 |
|
261 | 268 | x -> y |
|
262 | 269 | BROKEN: This should merge the changes from x into y |
|
263 | 270 | $ hg graft -r 2 |
|
264 | 271 | grafting 2:* "add x again with different content" (glob) |
|
265 | 272 | $ hg co -qC 2 |
|
266 | 273 | BROKEN: This should succeed and merge the changes from x into y |
|
267 | 274 | $ hg graft -r 3 |
|
268 | 275 | grafting 3:* "rename x to y" (glob) |
|
269 | 276 | file 'x' was deleted in other [graft] but was modified in local [local]. |
|
270 | 277 | You can use (c)hanged version, (d)elete, or leave (u)nresolved. |
|
271 | 278 | What do you want to do? u |
|
272 | 279 | abort: unresolved conflicts, can't continue |
|
273 | 280 | (use 'hg resolve' and 'hg graft --continue') |
|
274 | 281 | [255] |
|
275 | 282 | |
|
276 | 283 | Add x on two branches, then rename x to y on one side. Similar to the case |
|
277 | 284 | above, but here the break in history is via the base commit. |
|
278 | 285 | $ newrepo |
|
279 | 286 | $ echo a > a |
|
280 | 287 | $ hg ci -Aqm 'base' |
|
281 | 288 | $ echo x > x |
|
282 | 289 | $ hg ci -Aqm 'add x' |
|
283 | 290 | $ echo x2 > x |
|
284 | 291 | $ hg ci -m 'modify x' |
|
285 | 292 | $ hg co -q 0 |
|
286 | 293 | $ echo x > x |
|
287 | 294 | $ hg ci -Aqm 'add x again' |
|
288 | 295 | $ hg mv x y |
|
289 | 296 | $ hg ci -qm 'rename x to y' |
|
290 | 297 | $ hg l |
|
291 | 298 | @ 4 rename x to y |
|
292 | 299 | | x y |
|
293 | 300 | o 3 add x again |
|
294 | 301 | | x |
|
295 | 302 | | o 2 modify x |
|
296 | 303 | | | x |
|
297 | 304 | | o 1 add x |
|
298 | 305 | |/ x |
|
299 | 306 | o 0 base |
|
300 | 307 | a |
|
301 | 308 | $ hg debugpathcopies 1 4 |
|
302 | 309 | x -> y |
|
303 | 310 | $ hg graft -r 2 |
|
304 | 311 | grafting 2:* "modify x" (glob) |
|
305 | 312 | merging y and x to y |
|
306 | 313 | $ hg co -qC 2 |
|
307 | 314 | $ hg graft -r 4 |
|
308 | 315 | grafting 4:* "rename x to y"* (glob) |
|
309 | 316 | merging x and y to y |
|
310 | 317 | |
|
311 | 318 | Add x on two branches, with same content but different history, then rename x |
|
312 | 319 | to y on one side. Similar to the case above, here the file's nodeid is |
|
313 | 320 | different between the branches. |
|
314 | 321 | $ newrepo |
|
315 | 322 | $ echo a > a |
|
316 | 323 | $ hg ci -Aqm 'base' |
|
317 | 324 | $ echo x > x |
|
318 | 325 | $ hg ci -Aqm 'add x' |
|
319 | 326 | $ echo x2 > x |
|
320 | 327 | $ hg ci -m 'modify x' |
|
321 | 328 | $ hg co -q 0 |
|
322 | 329 | $ touch x |
|
323 | 330 | $ hg ci -Aqm 'add empty x' |
|
324 | 331 | # Same content to avoid conflicts |
|
325 | 332 | $ hg revert -r 1 x |
|
326 | 333 | $ hg ci -m 'modify x to match commit 1' |
|
327 | 334 | $ hg mv x y |
|
328 | 335 | $ hg ci -qm 'rename x to y' |
|
329 | 336 | $ hg l |
|
330 | 337 | @ 5 rename x to y |
|
331 | 338 | | x y |
|
332 | 339 | o 4 modify x to match commit 1 |
|
333 | 340 | | x |
|
334 | 341 | o 3 add empty x |
|
335 | 342 | | x |
|
336 | 343 | | o 2 modify x |
|
337 | 344 | | | x |
|
338 | 345 | | o 1 add x |
|
339 | 346 | |/ x |
|
340 | 347 | o 0 base |
|
341 | 348 | a |
|
342 | 349 | $ hg debugpathcopies 1 5 |
|
343 | x -> y (no-filelog !) | |
|
344 | #if filelog | |
|
350 | x -> y (no-filelog no-sidedata !) | |
|
351 | #if no-filelog no-sidedata | |
|
352 | $ hg graft -r 2 | |
|
353 | grafting 2:* "modify x" (glob) | |
|
354 | merging y and x to y | |
|
355 | #else | |
|
345 | 356 | BROKEN: This should succeed and merge the changes from x into y |
|
346 | 357 | $ hg graft -r 2 |
|
347 | 358 | grafting 2:* "modify x" (glob) |
|
348 | 359 | file 'x' was deleted in local [local] but was modified in other [graft]. |
|
349 | 360 | You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. |
|
350 | 361 | What do you want to do? u |
|
351 | 362 | abort: unresolved conflicts, can't continue |
|
352 | 363 | (use 'hg resolve' and 'hg graft --continue') |
|
353 | 364 | [255] |
|
354 | #else | |
|
355 | $ hg graft -r 2 | |
|
356 | grafting 2:* "modify x" (glob) | |
|
357 | merging y and x to y | |
|
358 | 365 | #endif |
|
359 | 366 | $ hg co -qC 2 |
|
360 | 367 | BROKEN: This should succeed and merge the changes from x into y |
|
361 | 368 | $ hg graft -r 5 |
|
362 | 369 | grafting 5:* "rename x to y"* (glob) |
|
363 | 370 | file 'x' was deleted in other [graft] but was modified in local [local]. |
|
364 | 371 | You can use (c)hanged version, (d)elete, or leave (u)nresolved. |
|
365 | 372 | What do you want to do? u |
|
366 | 373 | abort: unresolved conflicts, can't continue |
|
367 | 374 | (use 'hg resolve' and 'hg graft --continue') |
|
368 | 375 | [255] |
|
369 | 376 | |
|
370 | 377 | Copies via null revision (there shouldn't be any) |
|
371 | 378 | $ newrepo |
|
372 | 379 | $ echo x > x |
|
373 | 380 | $ hg ci -Aqm 'add x' |
|
374 | 381 | $ hg cp x y |
|
375 | 382 | $ hg ci -m 'copy x to y' |
|
376 | 383 | $ hg co -q null |
|
377 | 384 | $ echo x > x |
|
378 | 385 | $ hg ci -Aqm 'add x (again)' |
|
379 | 386 | $ hg l |
|
380 | 387 | @ 2 add x (again) |
|
381 | 388 | x |
|
382 | 389 | o 1 copy x to y |
|
383 | 390 | | y |
|
384 | 391 | o 0 add x |
|
385 | 392 | x |
|
386 | 393 | $ hg debugpathcopies 1 2 |
|
387 | 394 | $ hg debugpathcopies 2 1 |
|
388 | 395 | $ hg graft -r 1 |
|
389 | 396 | grafting 1:* "copy x to y" (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now