Show More
@@ -1239,10 +1239,10 b' def pull(repo, remote, heads=None, force' | |||
|
1239 | 1239 | wlock = pullop.repo.wlock() |
|
1240 | 1240 | lock = pullop.repo.lock() |
|
1241 | 1241 | pullop.trmanager = transactionmanager(repo, 'pull', remote.url()) |
|
1242 | streamclone.maybeperformlegacystreamclone(pullop) | |
|
1243 | 1242 | # This should ideally be in _pullbundle2(). However, it needs to run |
|
1244 | 1243 | # before discovery to avoid extra work. |
|
1245 | 1244 | _maybeapplyclonebundle(pullop) |
|
1245 | streamclone.maybeperformlegacystreamclone(pullop) | |
|
1246 | 1246 | _pulldiscovery(pullop) |
|
1247 | 1247 | if pullop.canusebundle2: |
|
1248 | 1248 | _pullbundle2(pullop) |
@@ -1864,7 +1864,9 b' def _maybeapplyclonebundle(pullop):' | |||
|
1864 | 1864 | 'falling back to regular clone\n')) |
|
1865 | 1865 | return |
|
1866 | 1866 | |
|
1867 |
entries = filterclonebundleentries( |
|
|
1867 | entries = filterclonebundleentries( | |
|
1868 | repo, entries, streamclonerequested=pullop.streamclonerequested) | |
|
1869 | ||
|
1868 | 1870 | if not entries: |
|
1869 | 1871 | # There is a thundering herd concern here. However, if a server |
|
1870 | 1872 | # operator doesn't advertise bundles appropriate for its clients, |
@@ -1933,7 +1935,7 b' def parseclonebundlesmanifest(repo, s):' | |||
|
1933 | 1935 | |
|
1934 | 1936 | return m |
|
1935 | 1937 | |
|
1936 | def filterclonebundleentries(repo, entries): | |
|
1938 | def filterclonebundleentries(repo, entries, streamclonerequested=False): | |
|
1937 | 1939 | """Remove incompatible clone bundle manifest entries. |
|
1938 | 1940 | |
|
1939 | 1941 | Accepts a list of entries parsed with ``parseclonebundlesmanifest`` |
@@ -1948,7 +1950,15 b' def filterclonebundleentries(repo, entri' | |||
|
1948 | 1950 | spec = entry.get('BUNDLESPEC') |
|
1949 | 1951 | if spec: |
|
1950 | 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 | 1962 | except error.InvalidBundleSpecification as e: |
|
1953 | 1963 | repo.ui.debug(str(e) + '\n') |
|
1954 | 1964 | continue |
@@ -1956,6 +1966,12 b' def filterclonebundleentries(repo, entri' | |||
|
1956 | 1966 | repo.ui.debug('filtering %s because unsupported bundle ' |
|
1957 | 1967 | 'spec: %s\n' % (entry['URL'], str(e))) |
|
1958 | 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 | 1976 | if 'REQUIRESNI' in entry and not sslutil.hassni: |
|
1961 | 1977 | repo.ui.debug('filtering %s because SNI not supported\n' % |
@@ -441,6 +441,8 b' A manifest with just a gzip bundle' | |||
|
441 | 441 | > EOF |
|
442 | 442 | |
|
443 | 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 | 446 | streaming all changes |
|
445 | 447 | 4 files to transfer, 613 bytes of data |
|
446 | 448 | transferred 613 bytes in * seconds (*) (glob) |
@@ -454,6 +456,8 b' A manifest with a stream clone but no BU' | |||
|
454 | 456 | > EOF |
|
455 | 457 | |
|
456 | 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 | 461 | streaming all changes |
|
458 | 462 | 4 files to transfer, 613 bytes of data |
|
459 | 463 | transferred 613 bytes in * seconds (*) (glob) |
@@ -468,9 +472,10 b' A manifest with a gzip bundle and a stre' | |||
|
468 | 472 | > EOF |
|
469 | 473 | |
|
470 | 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 | 476 | 4 files to transfer, 613 bytes of data |
|
473 | 477 | transferred 613 bytes in * seconds (*) (glob) |
|
478 | finished applying clone bundle | |
|
474 | 479 | searching for changes |
|
475 | 480 | no changes found |
|
476 | 481 | |
@@ -482,9 +487,10 b' A manifest with a gzip bundle and stream' | |||
|
482 | 487 | > EOF |
|
483 | 488 | |
|
484 | 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 | 491 | 4 files to transfer, 613 bytes of data |
|
487 | 492 | transferred 613 bytes in * seconds (*) (glob) |
|
493 | finished applying clone bundle | |
|
488 | 494 | searching for changes |
|
489 | 495 | no changes found |
|
490 | 496 | |
@@ -496,6 +502,8 b' A manifest with a gzip bundle and a stre' | |||
|
496 | 502 | > EOF |
|
497 | 503 | |
|
498 | 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 | 507 | streaming all changes |
|
500 | 508 | 4 files to transfer, 613 bytes of data |
|
501 | 509 | transferred 613 bytes in * seconds (*) (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now