Mercurial > hg
comparison mercurial/exchange.py @ 20485:de2544933139
pull: move pulled subset into the object
We compute the set of local changeset that were target of the pull. This is then
used by phases logic to decide which part of the history should have it phase
updated.
We move this information into the object to allow extraction of phase
synchronisation in its own function.
I expect obsolete marker exchange to use it too in the future.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Fri, 31 Jan 2014 01:21:42 -0800 |
parents | 80628d4069be |
children | 0c469df6e914 |
comparison
equal
deleted
inserted
replaced
20484:0f1ef9e9e904 | 20485:de2544933139 |
---|---|
393 self.force = force | 393 self.force = force |
394 # the name the pull transaction | 394 # the name the pull transaction |
395 self._trname = 'pull\n' + util.hidepassword(remote.url()) | 395 self._trname = 'pull\n' + util.hidepassword(remote.url()) |
396 # hold the transaction once created | 396 # hold the transaction once created |
397 self._tr = None | 397 self._tr = None |
398 # heads of the set of changeset target by the pull | |
399 self.pulledsubset = None | |
398 | 400 |
399 def gettransaction(self): | 401 def gettransaction(self): |
400 """get appropriate pull transaction, creating it if needed""" | 402 """get appropriate pull transaction, creating it if needed""" |
401 if self._tr is None: | 403 if self._tr is None: |
402 self._tr = self.repo.transaction(self._trname) | 404 self._tr = self.repo.transaction(self._trname) |
467 subset = common + rheads | 469 subset = common + rheads |
468 else: | 470 else: |
469 # We pulled a specific subset | 471 # We pulled a specific subset |
470 # sync on this subset | 472 # sync on this subset |
471 subset = pullop.heads | 473 subset = pullop.heads |
474 pullop.pulledsubset = subset | |
472 | 475 |
473 # Get remote phases data from remote | 476 # Get remote phases data from remote |
474 remotephases = pullop.remote.listkeys('phases') | 477 remotephases = pullop.remote.listkeys('phases') |
475 publishing = bool(remotephases.get('publishing', False)) | 478 publishing = bool(remotephases.get('publishing', False)) |
476 if remotephases and not publishing: | 479 if remotephases and not publishing: |
477 # remote is new and unpublishing | 480 # remote is new and unpublishing |
478 pheads, _dr = phases.analyzeremotephases(pullop.repo, subset, | 481 pheads, _dr = phases.analyzeremotephases(pullop.repo, |
482 pullop.pulledsubset, | |
479 remotephases) | 483 remotephases) |
480 phases.advanceboundary(pullop.repo, phases.public, pheads) | 484 phases.advanceboundary(pullop.repo, phases.public, pheads) |
481 phases.advanceboundary(pullop.repo, phases.draft, subset) | 485 phases.advanceboundary(pullop.repo, phases.draft, |
486 pullop.pulledsubset) | |
482 else: | 487 else: |
483 # Remote is old or publishing all common changesets | 488 # Remote is old or publishing all common changesets |
484 # should be seen as public | 489 # should be seen as public |
485 phases.advanceboundary(pullop.repo, phases.public, subset) | 490 phases.advanceboundary(pullop.repo, phases.public, |
491 pullop.pulledsubset) | |
486 | 492 |
487 _pullobsolete(pullop) | 493 _pullobsolete(pullop) |
488 pullop.closetransaction() | 494 pullop.closetransaction() |
489 finally: | 495 finally: |
490 pullop.releasetransaction() | 496 pullop.releasetransaction() |