Show More
@@ -102,6 +102,37 b' from i18n import _' | |||
|
102 | 102 | _fmfsize = struct.calcsize(_fmfixed) |
|
103 | 103 | _fnodesize = struct.calcsize(_fmnode) |
|
104 | 104 | |
|
105 | ### obsolescence marker flag | |
|
106 | ||
|
107 | ## bumpedfix flag | |
|
108 | # | |
|
109 | # When a changeset A' succeed to a changeset A which became public, we call A' | |
|
110 | # "bumped" because it's a successors of a public changesets | |
|
111 | # | |
|
112 | # o A' (bumped) | |
|
113 | # |`: | |
|
114 | # | o A | |
|
115 | # |/ | |
|
116 | # o Z | |
|
117 | # | |
|
118 | # The way to solve this situation is to create a new changeset Ad as children | |
|
119 | # of A. This changeset have the same content than A'. So the diff from A to A' | |
|
120 | # is the same than the diff from A to Ad. Ad is marked as a successors of A' | |
|
121 | # | |
|
122 | # o Ad | |
|
123 | # |`: | |
|
124 | # | x A' | |
|
125 | # |'| | |
|
126 | # o | A | |
|
127 | # |/ | |
|
128 | # o Z | |
|
129 | # | |
|
130 | # But by transitivity Ad is also a successors of A. To avoid having Ad marked | |
|
131 | # as bumped too, we add the `bumpedfix` flag to the marker. <A', (Ad,)>. | |
|
132 | # This flag mean that the successors are an interdiff that fix the bumped | |
|
133 | # situation, breaking the transitivity of "bumped" here. | |
|
134 | bumpedfix = 1 | |
|
135 | ||
|
105 | 136 | def _readmarkers(data): |
|
106 | 137 | """Read and enumerate markers from raw data""" |
|
107 | 138 | off = 0 |
@@ -351,7 +382,7 b' def successormarkers(ctx):' | |||
|
351 | 382 | for data in ctx._repo.obsstore.successors.get(ctx.node(), ()): |
|
352 | 383 | yield marker(ctx._repo, data) |
|
353 | 384 | |
|
354 | def allsuccessors(obsstore, nodes): | |
|
385 | def allsuccessors(obsstore, nodes, ignoreflags=0): | |
|
355 | 386 | """Yield node for every successor of <nodes>. |
|
356 | 387 | |
|
357 | 388 | Some successors may be unknown locally. |
@@ -363,6 +394,9 b' def allsuccessors(obsstore, nodes):' | |||
|
363 | 394 | current = remaining.pop() |
|
364 | 395 | yield current |
|
365 | 396 | for mark in obsstore.successors.get(current, ()): |
|
397 | # ignore marker flagged with with specified flag | |
|
398 | if mark[2] & ignoreflags: | |
|
399 | continue | |
|
366 | 400 | for suc in mark[1]: |
|
367 | 401 | if suc not in seen: |
|
368 | 402 | seen.add(suc) |
@@ -449,7 +483,8 b' def _computebumpedset(repo):' | |||
|
449 | 483 | # get all possible bumped changesets |
|
450 | 484 | tonode = repo.changelog.node |
|
451 | 485 | publicnodes = (tonode(r) for r in repo.revs('public()')) |
|
452 |
successors = allsuccessors(repo.obsstore, publicnodes |
|
|
486 | successors = allsuccessors(repo.obsstore, publicnodes, | |
|
487 | ignoreflags=bumpedfix) | |
|
453 | 488 | # revision public or already obsolete don't count as bumped |
|
454 | 489 | query = '%ld - obsolete() - public()' |
|
455 | 490 | return set(repo.revs(query, _knownrevs(repo, successors))) |
@@ -171,6 +171,43 b' the public changeset' | |||
|
171 | 171 | summary: add new_3_c |
|
172 | 172 | |
|
173 | 173 | |
|
174 | Fixing "bumped" situation | |
|
175 | We need to create a clone of 5 and add a special marker with a flag | |
|
176 | ||
|
177 | $ hg up '5^' | |
|
178 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
179 | $ hg revert -ar 5 | |
|
180 | adding new_3_c | |
|
181 | $ hg ci -m 'add n3w_3_c' | |
|
182 | created new head | |
|
183 | $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c` | |
|
184 | $ hg log -r 'bumped()' | |
|
185 | $ hg log -G | |
|
186 | @ changeset: 6:6f9641995072 | |
|
187 | | tag: tip | |
|
188 | | parent: 1:7c3bad9141dc | |
|
189 | | user: test | |
|
190 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
191 | | summary: add n3w_3_c | |
|
192 | | | |
|
193 | | o changeset: 2:245bde4270cd | |
|
194 | |/ user: test | |
|
195 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
196 | | summary: add original_c | |
|
197 | | | |
|
198 | o changeset: 1:7c3bad9141dc | |
|
199 | | user: test | |
|
200 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
201 | | summary: add b | |
|
202 | | | |
|
203 | o changeset: 0:1f0dee641bb7 | |
|
204 | user: test | |
|
205 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
206 | summary: add a | |
|
207 | ||
|
208 | ||
|
209 | ||
|
210 | ||
|
174 | 211 | $ cd .. |
|
175 | 212 | |
|
176 | 213 | Exchange Test |
@@ -197,6 +234,7 b' Try to pull markers' | |||
|
197 | 234 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'} |
|
198 | 235 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'} |
|
199 | 236 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'} |
|
237 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'} | |
|
200 | 238 | |
|
201 | 239 | Rollback//Transaction support |
|
202 | 240 | |
@@ -206,6 +244,7 b' Rollback//Transaction support' | |||
|
206 | 244 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'} |
|
207 | 245 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'} |
|
208 | 246 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'} |
|
247 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'} | |
|
209 | 248 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 {'date': '1340 0', 'user': 'test'} |
|
210 | 249 | $ hg rollback -n |
|
211 | 250 | repository tip rolled back to revision 3 (undo debugobsolete) |
@@ -216,6 +255,7 b' Rollback//Transaction support' | |||
|
216 | 255 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'} |
|
217 | 256 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'} |
|
218 | 257 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'} |
|
258 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'} | |
|
219 | 259 | |
|
220 | 260 | $ cd .. |
|
221 | 261 | |
@@ -234,6 +274,7 b' Try to pull markers' | |||
|
234 | 274 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'} |
|
235 | 275 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'} |
|
236 | 276 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'} |
|
277 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'} | |
|
237 | 278 | |
|
238 | 279 | Check obsolete keys are exchanged only if source has an obsolete store |
|
239 | 280 | |
@@ -252,12 +293,18 b' clone support' | |||
|
252 | 293 | updating to branch default |
|
253 | 294 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
254 | 295 | $ hg -R clone-dest log -G --hidden |
|
255 |
@ changeset: |
|
|
296 | @ changeset: 6:6f9641995072 | |
|
256 | 297 | | tag: tip |
|
257 | 298 | | parent: 1:7c3bad9141dc |
|
258 | 299 | | user: test |
|
259 | 300 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
260 |
| summary: add n |
|
|
301 | | summary: add n3w_3_c | |
|
302 | | | |
|
303 | | x changeset: 5:5601fb93a350 | |
|
304 | |/ parent: 1:7c3bad9141dc | |
|
305 | | user: test | |
|
306 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
307 | | summary: add new_3_c | |
|
261 | 308 | | |
|
262 | 309 | | x changeset: 4:ca819180edb9 |
|
263 | 310 | |/ parent: 1:7c3bad9141dc |
@@ -291,6 +338,7 b' clone support' | |||
|
291 | 338 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'} |
|
292 | 339 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'} |
|
293 | 340 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'} |
|
341 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'} | |
|
294 | 342 | |
|
295 | 343 | |
|
296 | 344 | Destination repo have existing data |
@@ -315,6 +363,7 b' On pull' | |||
|
315 | 363 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'} |
|
316 | 364 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'} |
|
317 | 365 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'} |
|
366 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'} | |
|
318 | 367 | |
|
319 | 368 | |
|
320 | 369 | On push |
@@ -329,6 +378,7 b' On push' | |||
|
329 | 378 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'} |
|
330 | 379 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'} |
|
331 | 380 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'} |
|
381 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'} | |
|
332 | 382 | 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'} |
|
333 | 383 | |
|
334 | 384 | detect outgoing obsolete and unstable |
@@ -336,12 +386,12 b' detect outgoing obsolete and unstable' | |||
|
336 | 386 | |
|
337 | 387 | |
|
338 | 388 | $ hg glog |
|
339 |
o changeset: 3: |
|
|
389 | o changeset: 3:6f9641995072 | |
|
340 | 390 | | tag: tip |
|
341 | 391 | | parent: 1:7c3bad9141dc |
|
342 | 392 | | user: test |
|
343 | 393 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
344 |
| summary: add n |
|
|
394 | | summary: add n3w_3_c | |
|
345 | 395 | | |
|
346 | 396 | | o changeset: 2:245bde4270cd |
|
347 | 397 | |/ user: test |
@@ -358,34 +408,34 b' detect outgoing obsolete and unstable' | |||
|
358 | 408 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
359 | 409 | summary: add a |
|
360 | 410 | |
|
361 |
$ hg up 'desc("n |
|
|
411 | $ hg up 'desc("n3w_3_c")' | |
|
362 | 412 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
363 | 413 | $ mkcommit original_d |
|
364 | 414 | $ mkcommit original_e |
|
365 | 415 | $ hg debugobsolete `getid original_d` -d '0 0' |
|
366 | 416 | $ hg log -r 'obsolete()' |
|
367 |
changeset: 4: |
|
|
417 | changeset: 4:94b33453f93b | |
|
368 | 418 | user: test |
|
369 | 419 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
370 | 420 | summary: add original_d |
|
371 | 421 | |
|
372 | 422 | $ hg glog -r '::unstable()' |
|
373 |
@ changeset: 5: |
|
|
423 | @ changeset: 5:cda648ca50f5 | |
|
374 | 424 | | tag: tip |
|
375 | 425 | | user: test |
|
376 | 426 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
377 | 427 | | summary: add original_e |
|
378 | 428 | | |
|
379 |
x changeset: 4: |
|
|
429 | x changeset: 4:94b33453f93b | |
|
380 | 430 | | user: test |
|
381 | 431 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
382 | 432 | | summary: add original_d |
|
383 | 433 | | |
|
384 |
o changeset: 3: |
|
|
434 | o changeset: 3:6f9641995072 | |
|
385 | 435 | | parent: 1:7c3bad9141dc |
|
386 | 436 | | user: test |
|
387 | 437 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
388 |
| summary: add n |
|
|
438 | | summary: add n3w_3_c | |
|
389 | 439 | | |
|
390 | 440 | o changeset: 1:7c3bad9141dc |
|
391 | 441 | | user: test |
@@ -403,7 +453,7 b' refuse to push obsolete changeset' | |||
|
403 | 453 | $ hg push ../tmpc/ -r 'desc("original_d")' |
|
404 | 454 | pushing to ../tmpc/ |
|
405 | 455 | searching for changes |
|
406 |
abort: push includes an obsolete changeset: |
|
|
456 | abort: push includes an obsolete changeset: 94b33453f93b! | |
|
407 | 457 | [255] |
|
408 | 458 | |
|
409 | 459 | refuse to push unstable changeset |
@@ -411,7 +461,7 b' refuse to push unstable changeset' | |||
|
411 | 461 | $ hg push ../tmpc/ |
|
412 | 462 | pushing to ../tmpc/ |
|
413 | 463 | searching for changes |
|
414 |
abort: push includes an unstable changeset: |
|
|
464 | abort: push includes an unstable changeset: cda648ca50f5! | |
|
415 | 465 | [255] |
|
416 | 466 | |
|
417 | 467 | Test that extinct changeset are properly detected |
@@ -439,18 +489,18 b" Don't try to push extinct changeset" | |||
|
439 | 489 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
440 | 490 | summary: add original_c |
|
441 | 491 | |
|
442 |
changeset: 3: |
|
|
492 | changeset: 3:6f9641995072 | |
|
443 | 493 | parent: 1:7c3bad9141dc |
|
444 | 494 | user: test |
|
445 | 495 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
446 |
summary: add n |
|
|
496 | summary: add n3w_3_c | |
|
447 | 497 | |
|
448 |
changeset: 4: |
|
|
498 | changeset: 4:94b33453f93b | |
|
449 | 499 | user: test |
|
450 | 500 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
451 | 501 | summary: add original_d |
|
452 | 502 | |
|
453 |
changeset: 5: |
|
|
503 | changeset: 5:cda648ca50f5 | |
|
454 | 504 | tag: tip |
|
455 | 505 | user: test |
|
456 | 506 | date: Thu Jan 01 00:00:00 1970 +0000 |
@@ -475,22 +525,22 b' no warning displayed' | |||
|
475 | 525 | Do not warn about new head when the new head is a successors of a remote one |
|
476 | 526 | |
|
477 | 527 | $ hg glog |
|
478 |
@ changeset: 5: |
|
|
528 | @ changeset: 5:cda648ca50f5 | |
|
479 | 529 | | tag: tip |
|
480 | 530 | | user: test |
|
481 | 531 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
482 | 532 | | summary: add original_e |
|
483 | 533 | | |
|
484 |
x changeset: 4: |
|
|
534 | x changeset: 4:94b33453f93b | |
|
485 | 535 | | user: test |
|
486 | 536 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
487 | 537 | | summary: add original_d |
|
488 | 538 | | |
|
489 |
o changeset: 3: |
|
|
539 | o changeset: 3:6f9641995072 | |
|
490 | 540 | | parent: 1:7c3bad9141dc |
|
491 | 541 | | user: test |
|
492 | 542 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
493 |
| summary: add n |
|
|
543 | | summary: add n3w_3_c | |
|
494 | 544 | | |
|
495 | 545 | | o changeset: 2:245bde4270cd |
|
496 | 546 | |/ user: test |
@@ -507,7 +557,7 b' Do not warn about new head when the new ' | |||
|
507 | 557 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
508 | 558 | summary: add a |
|
509 | 559 | |
|
510 |
$ hg up -q 'desc(n |
|
|
560 | $ hg up -q 'desc(n3w_3_c)' | |
|
511 | 561 | $ mkcommit obsolete_e |
|
512 | 562 | created new head |
|
513 | 563 | $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'` |
@@ -524,10 +574,10 b' Checking _enable=False warning if obsole' | |||
|
524 | 574 | $ echo '[extensions]' >> $HGRCPATH |
|
525 | 575 | $ echo "obs=!" >> $HGRCPATH |
|
526 | 576 | $ hg log -r tip |
|
527 |
obsolete feature not enabled but |
|
|
528 |
changeset: 6: |
|
|
577 | obsolete feature not enabled but 8 markers found! | |
|
578 | changeset: 6:3de5eca88c00 | |
|
529 | 579 | tag: tip |
|
530 |
parent: 3: |
|
|
580 | parent: 3:6f9641995072 | |
|
531 | 581 | user: test |
|
532 | 582 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
533 | 583 | summary: add obsolete_e |
General Comments 0
You need to be logged in to leave comments.
Login now