Show More
@@ -3025,6 +3025,23 b' def filterclonebundleentries(repo, entri' | |||
|
3025 | 3025 | ) |
|
3026 | 3026 | continue |
|
3027 | 3027 | |
|
3028 | if b'REQUIREDRAM' in entry: | |
|
3029 | try: | |
|
3030 | requiredram = util.sizetoint(entry[b'REQUIREDRAM']) | |
|
3031 | except error.ParseError: | |
|
3032 | repo.ui.debug( | |
|
3033 | b'filtering %s due to a bad REQUIREDRAM attribute\n' | |
|
3034 | % entry[b'URL'] | |
|
3035 | ) | |
|
3036 | continue | |
|
3037 | actualram = repo.ui.estimatememory() | |
|
3038 | if actualram is not None and actualram * 0.66 < requiredram: | |
|
3039 | repo.ui.debug( | |
|
3040 | b'filtering %s as it needs more than 2/3 of system memory\n' | |
|
3041 | % entry[b'URL'] | |
|
3042 | ) | |
|
3043 | continue | |
|
3044 | ||
|
3028 | 3045 | newentries.append(entry) |
|
3029 | 3046 | |
|
3030 | 3047 | return newentries |
@@ -1,5 +1,9 b'' | |||
|
1 | 1 | == New Features == |
|
2 | 2 | |
|
3 | * clonebundles can be annotated with the expected memory requirements | |
|
4 | using the `REQUIREDRAM` option. This allows clients to skip | |
|
5 | bundles created with large zstd windows and fallback to larger, but | |
|
6 | less demanding bundles. | |
|
3 | 7 | |
|
4 | 8 | == New Experimental Features == |
|
5 | 9 |
@@ -551,3 +551,88 b' Test clone bundle retrieved through bund' | |||
|
551 | 551 | searching for changes |
|
552 | 552 | no changes found |
|
553 | 553 | 2 local changesets published |
|
554 | $ killdaemons.py | |
|
555 | ||
|
556 | A manifest with a gzip bundle requiring too much memory for a 16MB system and working | |
|
557 | on a 32MB system. | |
|
558 | ||
|
559 | $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid | |
|
560 | $ cat http.pid >> $DAEMON_PIDS | |
|
561 | $ hg -R server serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log | |
|
562 | $ cat hg.pid >> $DAEMON_PIDS | |
|
563 | ||
|
564 | $ cat > server/.hg/clonebundles.manifest << EOF | |
|
565 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 REQUIREDRAM=12MB | |
|
566 | > EOF | |
|
567 | ||
|
568 | $ hg clone -U --debug --config ui.available-memory=16MB http://localhost:$HGPORT gzip-too-large | |
|
569 | using http://localhost:$HGPORT/ | |
|
570 | sending capabilities command | |
|
571 | sending clonebundles command | |
|
572 | filtering http://localhost:$HGPORT1/gz-a.hg as it needs more than 2/3 of system memory | |
|
573 | no compatible clone bundles available on server; falling back to regular clone | |
|
574 | (you may want to report this to the server operator) | |
|
575 | query 1; heads | |
|
576 | sending batch command | |
|
577 | requesting all changes | |
|
578 | sending getbundle command | |
|
579 | bundle2-input-bundle: with-transaction | |
|
580 | bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported | |
|
581 | adding changesets | |
|
582 | add changeset 53245c60e682 | |
|
583 | add changeset aaff8d2ffbbf | |
|
584 | adding manifests | |
|
585 | adding file changes | |
|
586 | adding bar revisions | |
|
587 | adding foo revisions | |
|
588 | bundle2-input-part: total payload size 920 | |
|
589 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported | |
|
590 | bundle2-input-part: "phase-heads" supported | |
|
591 | bundle2-input-part: total payload size 24 | |
|
592 | bundle2-input-part: "cache:rev-branch-cache" (advisory) supported | |
|
593 | bundle2-input-part: total payload size 59 | |
|
594 | bundle2-input-bundle: 4 parts total | |
|
595 | checking for updated bookmarks | |
|
596 | updating the branch cache | |
|
597 | added 2 changesets with 2 changes to 2 files | |
|
598 | new changesets 53245c60e682:aaff8d2ffbbf | |
|
599 | calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles | |
|
600 | (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob) | |
|
601 | ||
|
602 | $ hg clone -U --debug --config ui.available-memory=32MB http://localhost:$HGPORT gzip-too-large2 | |
|
603 | using http://localhost:$HGPORT/ | |
|
604 | sending capabilities command | |
|
605 | sending clonebundles command | |
|
606 | applying clone bundle from http://localhost:$HGPORT1/gz-a.hg | |
|
607 | bundle2-input-bundle: 1 params with-transaction | |
|
608 | bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported | |
|
609 | adding changesets | |
|
610 | add changeset 53245c60e682 | |
|
611 | add changeset aaff8d2ffbbf | |
|
612 | adding manifests | |
|
613 | adding file changes | |
|
614 | adding bar revisions | |
|
615 | adding foo revisions | |
|
616 | bundle2-input-part: total payload size 920 | |
|
617 | bundle2-input-part: "cache:rev-branch-cache" (advisory) supported | |
|
618 | bundle2-input-part: total payload size 59 | |
|
619 | bundle2-input-bundle: 2 parts total | |
|
620 | updating the branch cache | |
|
621 | added 2 changesets with 2 changes to 2 files | |
|
622 | finished applying clone bundle | |
|
623 | query 1; heads | |
|
624 | sending batch command | |
|
625 | searching for changes | |
|
626 | all remote heads known locally | |
|
627 | no changes found | |
|
628 | sending getbundle command | |
|
629 | bundle2-input-bundle: with-transaction | |
|
630 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported | |
|
631 | bundle2-input-part: "phase-heads" supported | |
|
632 | bundle2-input-part: total payload size 24 | |
|
633 | bundle2-input-bundle: 2 parts total | |
|
634 | checking for updated bookmarks | |
|
635 | 2 local changesets published | |
|
636 | calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles | |
|
637 | (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob) | |
|
638 | $ killdaemons.py |
General Comments 0
You need to be logged in to leave comments.
Login now