471 # We pulled a specific subset |
471 # We pulled a specific subset |
472 # sync on this subset |
472 # sync on this subset |
473 subset = pullop.heads |
473 subset = pullop.heads |
474 pullop.pulledsubset = subset |
474 pullop.pulledsubset = subset |
475 |
475 |
476 # Get remote phases data from remote |
476 _pullphase(pullop) |
477 remotephases = pullop.remote.listkeys('phases') |
|
478 publishing = bool(remotephases.get('publishing', False)) |
|
479 if remotephases and not publishing: |
|
480 # remote is new and unpublishing |
|
481 pheads, _dr = phases.analyzeremotephases(pullop.repo, |
|
482 pullop.pulledsubset, |
|
483 remotephases) |
|
484 phases.advanceboundary(pullop.repo, phases.public, pheads) |
|
485 phases.advanceboundary(pullop.repo, phases.draft, |
|
486 pullop.pulledsubset) |
|
487 else: |
|
488 # Remote is old or publishing all common changesets |
|
489 # should be seen as public |
|
490 phases.advanceboundary(pullop.repo, phases.public, |
|
491 pullop.pulledsubset) |
|
492 |
|
493 _pullobsolete(pullop) |
477 _pullobsolete(pullop) |
494 pullop.closetransaction() |
478 pullop.closetransaction() |
495 finally: |
479 finally: |
496 pullop.releasetransaction() |
480 pullop.releasetransaction() |
497 lock.release() |
481 lock.release() |
498 |
482 |
499 return result |
483 return result |
|
484 |
|
485 def _pullphase(pullop): |
|
486 # Get remote phases data from remote |
|
487 remotephases = pullop.remote.listkeys('phases') |
|
488 publishing = bool(remotephases.get('publishing', False)) |
|
489 if remotephases and not publishing: |
|
490 # remote is new and unpublishing |
|
491 pheads, _dr = phases.analyzeremotephases(pullop.repo, |
|
492 pullop.pulledsubset, |
|
493 remotephases) |
|
494 phases.advanceboundary(pullop.repo, phases.public, pheads) |
|
495 phases.advanceboundary(pullop.repo, phases.draft, |
|
496 pullop.pulledsubset) |
|
497 else: |
|
498 # Remote is old or publishing all common changesets |
|
499 # should be seen as public |
|
500 phases.advanceboundary(pullop.repo, phases.public, |
|
501 pullop.pulledsubset) |
500 |
502 |
501 def _pullobsolete(pullop): |
503 def _pullobsolete(pullop): |
502 """utility function to pull obsolete markers from a remote |
504 """utility function to pull obsolete markers from a remote |
503 |
505 |
504 The `gettransaction` is function that return the pull transaction, creating |
506 The `gettransaction` is function that return the pull transaction, creating |