mercurial/exchange.py
branchstable
changeset 48796 c00d3ce4e94b
parent 48549 28f0092ec89f
child 48875 6000f5b25c9b
equal deleted inserted replaced
48776:b84ff512b645 48796:c00d3ce4e94b
    20     bundle2,
    20     bundle2,
    21     bundlecaches,
    21     bundlecaches,
    22     changegroup,
    22     changegroup,
    23     discovery,
    23     discovery,
    24     error,
    24     error,
    25     exchangev2,
       
    26     lock as lockmod,
    25     lock as lockmod,
    27     logexchange,
    26     logexchange,
    28     narrowspec,
    27     narrowspec,
    29     obsolete,
    28     obsolete,
    30     obsutil,
    29     obsutil,
   520         step(pushop)
   519         step(pushop)
   521 
   520 
   522 
   521 
   523 def _checksubrepostate(pushop):
   522 def _checksubrepostate(pushop):
   524     """Ensure all outgoing referenced subrepo revisions are present locally"""
   523     """Ensure all outgoing referenced subrepo revisions are present locally"""
       
   524 
       
   525     repo = pushop.repo
       
   526 
       
   527     # If the repository does not use subrepos, skip the expensive
       
   528     # manifest checks.
       
   529     if not len(repo.file(b'.hgsub')) or not len(repo.file(b'.hgsubstate')):
       
   530         return
       
   531 
   525     for n in pushop.outgoing.missing:
   532     for n in pushop.outgoing.missing:
   526         ctx = pushop.repo[n]
   533         ctx = repo[n]
   527 
   534 
   528         if b'.hgsub' in ctx.manifest() and b'.hgsubstate' in ctx.files():
   535         if b'.hgsub' in ctx.manifest() and b'.hgsubstate' in ctx.files():
   529             for subpath in sorted(ctx.substate):
   536             for subpath in sorted(ctx.substate):
   530                 sub = ctx.sub(subpath)
   537                 sub = ctx.sub(subpath)
   531                 sub.verify(onpush=True)
   538                 sub.verify(onpush=True)
  1664         if confirm or (
  1671         if confirm or (
  1665             repo.ui.configbool(b"pull", b"confirm") and not repo.ui.plain()
  1672             repo.ui.configbool(b"pull", b"confirm") and not repo.ui.plain()
  1666         ):
  1673         ):
  1667             add_confirm_callback(repo, pullop)
  1674             add_confirm_callback(repo, pullop)
  1668 
  1675 
  1669         # Use the modern wire protocol, if available.
  1676         # This should ideally be in _pullbundle2(). However, it needs to run
  1670         if remote.capable(b'command-changesetdata'):
  1677         # before discovery to avoid extra work.
  1671             exchangev2.pull(pullop)
  1678         _maybeapplyclonebundle(pullop)
  1672         else:
  1679         streamclone.maybeperformlegacystreamclone(pullop)
  1673             # This should ideally be in _pullbundle2(). However, it needs to run
  1680         _pulldiscovery(pullop)
  1674             # before discovery to avoid extra work.
  1681         if pullop.canusebundle2:
  1675             _maybeapplyclonebundle(pullop)
  1682             _fullpullbundle2(repo, pullop)
  1676             streamclone.maybeperformlegacystreamclone(pullop)
  1683         _pullchangeset(pullop)
  1677             _pulldiscovery(pullop)
  1684         _pullphase(pullop)
  1678             if pullop.canusebundle2:
  1685         _pullbookmarks(pullop)
  1679                 _fullpullbundle2(repo, pullop)
  1686         _pullobsolete(pullop)
  1680             _pullchangeset(pullop)
       
  1681             _pullphase(pullop)
       
  1682             _pullbookmarks(pullop)
       
  1683             _pullobsolete(pullop)
       
  1684 
  1687 
  1685     # storing remotenames
  1688     # storing remotenames
  1686     if repo.ui.configbool(b'experimental', b'remotenames'):
  1689     if repo.ui.configbool(b'experimental', b'remotenames'):
  1687         logexchange.pullremotenames(repo, remote)
  1690         logexchange.pullremotenames(repo, remote)
  1688 
  1691