mercurial/streamclone.py
changeset 32744 33b7283a3828
parent 32259 076f1ff43f0f
child 33226 b045344fe35e
equal deleted inserted replaced
32743:f924dd043974 32744:33b7283a3828
    11 
    11 
    12 from .i18n import _
    12 from .i18n import _
    13 from . import (
    13 from . import (
    14     branchmap,
    14     branchmap,
    15     error,
    15     error,
       
    16     phases,
    16     store,
    17     store,
    17     util,
    18     util,
    18 )
    19 )
    19 
    20 
    20 def canperformstreamclone(pullop, bailifbundle2supported=False):
    21 def canperformstreamclone(pullop, bailifbundle2supported=False):
   160         if rbranchmap:
   161         if rbranchmap:
   161             branchmap.replacecache(repo, rbranchmap)
   162             branchmap.replacecache(repo, rbranchmap)
   162 
   163 
   163         repo.invalidate()
   164         repo.invalidate()
   164 
   165 
   165 def allowservergeneration(ui):
   166 def allowservergeneration(repo):
   166     """Whether streaming clones are allowed from the server."""
   167     """Whether streaming clones are allowed from the server."""
   167     return ui.configbool('server', 'uncompressed', True, untrusted=True)
   168     if not repo.ui.configbool('server', 'uncompressed', True, untrusted=True):
       
   169         return False
       
   170 
       
   171     # The way stream clone works makes it impossible to hide secret changesets.
       
   172     # So don't allow this by default.
       
   173     secret = phases.hassecret(repo)
       
   174     if secret:
       
   175         return repo.ui.configbool('server', 'uncompressedallowsecret', False)
       
   176 
       
   177     return True
   168 
   178 
   169 # This is it's own function so extensions can override it.
   179 # This is it's own function so extensions can override it.
   170 def _walkstreamfiles(repo):
   180 def _walkstreamfiles(repo):
   171     return repo.store.walk()
   181     return repo.store.walk()
   172 
   182