Show More
@@ -395,8 +395,23 b' class pulloperation(object):' | |||
|
395 | 395 | self._trname = 'pull\n' + util.hidepassword(remote.url()) |
|
396 | 396 | # hold the transaction once created |
|
397 | 397 | self._tr = None |
|
398 | # heads of the set of changeset target by the pull | |
|
399 |
self. |
|
|
398 | # set of common changeset between local and remote before pull | |
|
399 | self.common = None | |
|
400 | # set of pulled head | |
|
401 | self.rheads = None | |
|
402 | ||
|
403 | @util.propertycache | |
|
404 | def pulledsubset(self): | |
|
405 | """heads of the set of changeset target by the pull""" | |
|
406 | # compute target subset | |
|
407 | if self.heads is None: | |
|
408 | # We pulled every thing possible | |
|
409 | # sync on everything common | |
|
410 | return self.common + self.rheads | |
|
411 | else: | |
|
412 | # We pulled a specific subset | |
|
413 | # sync on this subset | |
|
414 | return self.heads | |
|
400 | 415 | |
|
401 | 416 | def gettransaction(self): |
|
402 | 417 | """get appropriate pull transaction, creating it if needed""" |
@@ -430,7 +445,7 b' def pull(repo, remote, heads=None, force' | |||
|
430 | 445 | pullop.remote, |
|
431 | 446 | heads=pullop.heads, |
|
432 | 447 | force=force) |
|
433 | common, fetch, rheads = tmp | |
|
448 | pullop.common, fetch, pullop.rheads = tmp | |
|
434 | 449 | if not fetch: |
|
435 | 450 | pullop.repo.ui.status(_("no changes found\n")) |
|
436 | 451 | result = 0 |
@@ -439,17 +454,19 b' def pull(repo, remote, heads=None, force' | |||
|
439 | 454 | # don't open transaction for nothing or you break future useful |
|
440 | 455 | # rollback call |
|
441 | 456 | pullop.gettransaction() |
|
442 | if pullop.heads is None and list(common) == [nullid]: | |
|
457 | if pullop.heads is None and list(pullop.common) == [nullid]: | |
|
443 | 458 | pullop.repo.ui.status(_("requesting all changes\n")) |
|
444 | 459 | elif (pullop.heads is None |
|
445 | 460 | and pullop.remote.capable('changegroupsubset')): |
|
446 | 461 | # issue1320, avoid a race if remote changed after discovery |
|
447 | pullop.heads = rheads | |
|
462 | pullop.heads = pullop.rheads | |
|
448 | 463 | |
|
449 | 464 | if pullop.remote.capable('getbundle'): |
|
450 | 465 | # TODO: get bundlecaps from remote |
|
451 |
cg = pullop.remote.getbundle('pull', |
|
|
452 |
|
|
|
466 | cg = pullop.remote.getbundle('pull', | |
|
467 | common=pullop.common, | |
|
468 | heads=(pullop.heads | |
|
469 | or pullop.rheads)) | |
|
453 | 470 | elif pullop.heads is None: |
|
454 | 471 | cg = pullop.remote.changegroup(fetch, 'pull') |
|
455 | 472 | elif not pullop.remote.capable('changegroupsubset'): |
@@ -462,17 +479,6 b' def pull(repo, remote, heads=None, force' | |||
|
462 | 479 | result = pullop.repo.addchangegroup(cg, 'pull', |
|
463 | 480 | pullop.remote.url()) |
|
464 | 481 | |
|
465 | # compute target subset | |
|
466 | if pullop.heads is None: | |
|
467 | # We pulled every thing possible | |
|
468 | # sync on everything common | |
|
469 | subset = common + rheads | |
|
470 | else: | |
|
471 | # We pulled a specific subset | |
|
472 | # sync on this subset | |
|
473 | subset = pullop.heads | |
|
474 | pullop.pulledsubset = subset | |
|
475 | ||
|
476 | 482 | _pullphase(pullop) |
|
477 | 483 | _pullobsolete(pullop) |
|
478 | 484 | pullop.closetransaction() |
General Comments 0
You need to be logged in to leave comments.
Login now