##// END OF EJS Templates
exchange: perform stream clone with clone bundle with --uncompressed...
Gregory Szorc -
r34360:ff406f3e default
parent child Browse files
Show More
@@ -1239,10 +1239,10 b' def pull(repo, remote, heads=None, force'
1239 wlock = pullop.repo.wlock()
1239 wlock = pullop.repo.wlock()
1240 lock = pullop.repo.lock()
1240 lock = pullop.repo.lock()
1241 pullop.trmanager = transactionmanager(repo, 'pull', remote.url())
1241 pullop.trmanager = transactionmanager(repo, 'pull', remote.url())
1242 streamclone.maybeperformlegacystreamclone(pullop)
1243 # This should ideally be in _pullbundle2(). However, it needs to run
1242 # This should ideally be in _pullbundle2(). However, it needs to run
1244 # before discovery to avoid extra work.
1243 # before discovery to avoid extra work.
1245 _maybeapplyclonebundle(pullop)
1244 _maybeapplyclonebundle(pullop)
1245 streamclone.maybeperformlegacystreamclone(pullop)
1246 _pulldiscovery(pullop)
1246 _pulldiscovery(pullop)
1247 if pullop.canusebundle2:
1247 if pullop.canusebundle2:
1248 _pullbundle2(pullop)
1248 _pullbundle2(pullop)
@@ -1864,7 +1864,9 b' def _maybeapplyclonebundle(pullop):'
1864 'falling back to regular clone\n'))
1864 'falling back to regular clone\n'))
1865 return
1865 return
1866
1866
1867 entries = filterclonebundleentries(repo, entries)
1867 entries = filterclonebundleentries(
1868 repo, entries, streamclonerequested=pullop.streamclonerequested)
1869
1868 if not entries:
1870 if not entries:
1869 # There is a thundering herd concern here. However, if a server
1871 # There is a thundering herd concern here. However, if a server
1870 # operator doesn't advertise bundles appropriate for its clients,
1872 # operator doesn't advertise bundles appropriate for its clients,
@@ -1933,7 +1935,7 b' def parseclonebundlesmanifest(repo, s):'
1933
1935
1934 return m
1936 return m
1935
1937
1936 def filterclonebundleentries(repo, entries):
1938 def filterclonebundleentries(repo, entries, streamclonerequested=False):
1937 """Remove incompatible clone bundle manifest entries.
1939 """Remove incompatible clone bundle manifest entries.
1938
1940
1939 Accepts a list of entries parsed with ``parseclonebundlesmanifest``
1941 Accepts a list of entries parsed with ``parseclonebundlesmanifest``
@@ -1948,7 +1950,15 b' def filterclonebundleentries(repo, entri'
1948 spec = entry.get('BUNDLESPEC')
1950 spec = entry.get('BUNDLESPEC')
1949 if spec:
1951 if spec:
1950 try:
1952 try:
1951 parsebundlespec(repo, spec, strict=True)
1953 comp, version, params = parsebundlespec(repo, spec, strict=True)
1954
1955 # If a stream clone was requested, filter out non-streamclone
1956 # entries.
1957 if streamclonerequested and (comp != 'UN' or version != 's1'):
1958 repo.ui.debug('filtering %s because not a stream clone\n' %
1959 entry['URL'])
1960 continue
1961
1952 except error.InvalidBundleSpecification as e:
1962 except error.InvalidBundleSpecification as e:
1953 repo.ui.debug(str(e) + '\n')
1963 repo.ui.debug(str(e) + '\n')
1954 continue
1964 continue
@@ -1956,6 +1966,12 b' def filterclonebundleentries(repo, entri'
1956 repo.ui.debug('filtering %s because unsupported bundle '
1966 repo.ui.debug('filtering %s because unsupported bundle '
1957 'spec: %s\n' % (entry['URL'], str(e)))
1967 'spec: %s\n' % (entry['URL'], str(e)))
1958 continue
1968 continue
1969 # If we don't have a spec and requested a stream clone, we don't know
1970 # what the entry is so don't attempt to apply it.
1971 elif streamclonerequested:
1972 repo.ui.debug('filtering %s because cannot determine if a stream '
1973 'clone bundle\n' % entry['URL'])
1974 continue
1959
1975
1960 if 'REQUIRESNI' in entry and not sslutil.hassni:
1976 if 'REQUIRESNI' in entry and not sslutil.hassni:
1961 repo.ui.debug('filtering %s because SNI not supported\n' %
1977 repo.ui.debug('filtering %s because SNI not supported\n' %
@@ -441,6 +441,8 b' A manifest with just a gzip bundle'
441 > EOF
441 > EOF
442
442
443 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-gzip
443 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-gzip
444 no compatible clone bundles available on server; falling back to regular clone
445 (you may want to report this to the server operator)
444 streaming all changes
446 streaming all changes
445 4 files to transfer, 613 bytes of data
447 4 files to transfer, 613 bytes of data
446 transferred 613 bytes in * seconds (*) (glob)
448 transferred 613 bytes in * seconds (*) (glob)
@@ -454,6 +456,8 b' A manifest with a stream clone but no BU'
454 > EOF
456 > EOF
455
457
456 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-no-bundlespec
458 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-no-bundlespec
459 no compatible clone bundles available on server; falling back to regular clone
460 (you may want to report this to the server operator)
457 streaming all changes
461 streaming all changes
458 4 files to transfer, 613 bytes of data
462 4 files to transfer, 613 bytes of data
459 transferred 613 bytes in * seconds (*) (glob)
463 transferred 613 bytes in * seconds (*) (glob)
@@ -468,9 +472,10 b' A manifest with a gzip bundle and a stre'
468 > EOF
472 > EOF
469
473
470 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-gzip-packed
474 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-gzip-packed
471 streaming all changes
475 applying clone bundle from http://localhost:$HGPORT1/packed.hg
472 4 files to transfer, 613 bytes of data
476 4 files to transfer, 613 bytes of data
473 transferred 613 bytes in * seconds (*) (glob)
477 transferred 613 bytes in * seconds (*) (glob)
478 finished applying clone bundle
474 searching for changes
479 searching for changes
475 no changes found
480 no changes found
476
481
@@ -482,9 +487,10 b' A manifest with a gzip bundle and stream'
482 > EOF
487 > EOF
483
488
484 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-gzip-packed-requirements
489 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-gzip-packed-requirements
485 streaming all changes
490 applying clone bundle from http://localhost:$HGPORT1/packed.hg
486 4 files to transfer, 613 bytes of data
491 4 files to transfer, 613 bytes of data
487 transferred 613 bytes in * seconds (*) (glob)
492 transferred 613 bytes in * seconds (*) (glob)
493 finished applying clone bundle
488 searching for changes
494 searching for changes
489 no changes found
495 no changes found
490
496
@@ -496,6 +502,8 b' A manifest with a gzip bundle and a stre'
496 > EOF
502 > EOF
497
503
498 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-gzip-packed-unsupported-requirements
504 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-gzip-packed-unsupported-requirements
505 no compatible clone bundles available on server; falling back to regular clone
506 (you may want to report this to the server operator)
499 streaming all changes
507 streaming all changes
500 4 files to transfer, 613 bytes of data
508 4 files to transfer, 613 bytes of data
501 transferred 613 bytes in * seconds (*) (glob)
509 transferred 613 bytes in * seconds (*) (glob)
General Comments 0
You need to be logged in to leave comments. Login now