Mercurial > hg
comparison mercurial/exchange.py @ 20898:f295b2ac3579
pull: move return code in the pull operation object
With bundle2 we'll have multiple code path susceptible to be responsible for
adding changeset during the pull. We move it to the pull operation to simplify
this the coming logic. The one doing the adding the changegroup will set the
value.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 01 Apr 2014 17:21:52 -0700 |
parents | 09e7118715eb |
children | d62319f91cb7 |
comparison
equal
deleted
inserted
replaced
20897:0b50788c160c | 20898:f295b2ac3579 |
---|---|
399 self.common = None | 399 self.common = None |
400 # set of pulled head | 400 # set of pulled head |
401 self.rheads = None | 401 self.rheads = None |
402 # list of missing changeset to fetch remotly | 402 # list of missing changeset to fetch remotly |
403 self.fetch = None | 403 self.fetch = None |
404 # result of changegroup pulling (used as returng code by pull) | |
405 self.cgresult = None | |
404 | 406 |
405 @util.propertycache | 407 @util.propertycache |
406 def pulledsubset(self): | 408 def pulledsubset(self): |
407 """heads of the set of changeset target by the pull""" | 409 """heads of the set of changeset target by the pull""" |
408 # compute target subset | 410 # compute target subset |
453 heads=pullop.heads, | 455 heads=pullop.heads, |
454 force=force) | 456 force=force) |
455 pullop.common, pullop.fetch, pullop.rheads = tmp | 457 pullop.common, pullop.fetch, pullop.rheads = tmp |
456 if not pullop.fetch: | 458 if not pullop.fetch: |
457 pullop.repo.ui.status(_("no changes found\n")) | 459 pullop.repo.ui.status(_("no changes found\n")) |
458 result = 0 | 460 pullop.cgresult = 0 |
459 else: | 461 else: |
460 result = _pullchangeset(pullop) | 462 pullop.cgresult = _pullchangeset(pullop) |
461 | 463 |
462 _pullphase(pullop) | 464 _pullphase(pullop) |
463 _pullobsolete(pullop) | 465 _pullobsolete(pullop) |
464 pullop.closetransaction() | 466 pullop.closetransaction() |
465 finally: | 467 finally: |
466 pullop.releasetransaction() | 468 pullop.releasetransaction() |
467 lock.release() | 469 lock.release() |
468 | 470 |
469 return result | 471 return pullop.cgresult |
470 | 472 |
471 def _pullchangeset(pullop): | 473 def _pullchangeset(pullop): |
472 """pull changeset from unbundle into the local repo""" | 474 """pull changeset from unbundle into the local repo""" |
473 # We delay the open of the transaction as late as possible so we | 475 # We delay the open of the transaction as late as possible so we |
474 # don't open transaction for nothing or you break future useful | 476 # don't open transaction for nothing or you break future useful |