| 1 |
#require no-windows |
| 2 |
|
| 3 |
$ . "$TESTDIR/remotefilelog-library.sh" |
| 4 |
|
| 5 |
$ hg init master |
| 6 |
$ cd master |
| 7 |
$ cat >> .hg/hgrc <<EOF |
| 8 |
> [remotefilelog] |
| 9 |
> server=True |
| 10 |
> EOF |
| 11 |
$ echo x > x |
| 12 |
$ echo z > z |
| 13 |
$ hg commit -qAm x1 |
| 14 |
$ echo x2 > x |
| 15 |
$ echo z2 > z |
| 16 |
$ hg commit -qAm x2 |
| 17 |
$ hg bookmark foo |
| 18 |
|
| 19 |
$ cd .. |
| 20 |
|
| 21 |
# prefetch a revision w/ a sparse checkout |
| 22 |
|
| 23 |
$ hgcloneshallow ssh://user@dummy/master shallow --noupdate |
| 24 |
streaming all changes |
| 25 |
3 files to transfer, 527 bytes of data (no-zstd !) |
| 26 |
stream-cloned 3 files / 527 bytes in * seconds (* */sec) (glob) (no-zstd !) |
| 27 |
3 files to transfer, 534 bytes of data (zstd no-rust !) |
| 28 |
stream-cloned 3 files / 534 bytes in * seconds (* */sec) (glob) (zstd no-rust !) |
| 29 |
5 files to transfer, 660 bytes of data (zstd rust !) |
| 30 |
stream-cloned 5 files / 660 bytes in * seconds (*/sec) (glob) (zstd rust !) |
| 31 |
searching for changes |
| 32 |
no changes found |
| 33 |
$ cd shallow |
| 34 |
$ printf "[extensions]\nsparse=\n" >> .hg/hgrc |
| 35 |
|
| 36 |
$ hg debugsparse -I x |
| 37 |
$ hg prefetch -r 0 |
| 38 |
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
| 39 |
|
| 40 |
$ hg cat -r 0 x |
| 41 |
x |
| 42 |
|
| 43 |
$ hg debugsparse -I z |
| 44 |
$ hg prefetch -r 0 |
| 45 |
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
| 46 |
|
| 47 |
$ hg cat -r 0 z |
| 48 |
z |
| 49 |
|
| 50 |
# prefetch sparse only on pull when configured |
| 51 |
|
| 52 |
$ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc |
| 53 |
$ hg strip tip |
| 54 |
saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/876b1317060d-b2e91d8d-backup.hg (glob) |
| 55 |
2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over *s (glob) |
| 56 |
|
| 57 |
$ hg debugsparse --delete z |
| 58 |
|
| 59 |
$ clearcache |
| 60 |
$ hg pull |
| 61 |
pulling from ssh://user@dummy/master |
| 62 |
searching for changes |
| 63 |
adding changesets |
| 64 |
adding manifests |
| 65 |
adding file changes |
| 66 |
updating bookmark foo |
| 67 |
added 1 changesets with 0 changes to 0 files |
| 68 |
new changesets 876b1317060d |
| 69 |
(run 'hg update' to get a working copy) |
| 70 |
prefetching file contents |
| 71 |
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
| 72 |
|
| 73 |
# Dont consider filtered files when doing copy tracing |
| 74 |
|
| 75 |
## Push an unrelated commit |
| 76 |
$ cd ../ |
| 77 |
|
| 78 |
$ hgcloneshallow ssh://user@dummy/master shallow2 |
| 79 |
streaming all changes |
| 80 |
* files to transfer, * bytes of data (glob) |
| 81 |
stream-cloned * files / * bytes in * seconds (*) (glob) |
| 82 |
searching for changes |
| 83 |
no changes found |
| 84 |
updating to branch default |
| 85 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 86 |
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
| 87 |
$ cd shallow2 |
| 88 |
$ printf "[extensions]\nsparse=\n" >> .hg/hgrc |
| 89 |
|
| 90 |
$ hg up -q 0 |
| 91 |
2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) |
| 92 |
$ touch a |
| 93 |
$ hg ci -Aqm a |
| 94 |
$ hg push -q -f |
| 95 |
|
| 96 |
## Pull the unrelated commit and rebase onto it - verify unrelated file was not |
| 97 |
pulled |
| 98 |
|
| 99 |
$ cd ../shallow |
| 100 |
$ hg up -q 1 |
| 101 |
$ hg pull -q |
| 102 |
$ hg debugsparse -I z |
| 103 |
$ clearcache |
| 104 |
$ hg prefetch -r '. + .^' -I x -I z |
| 105 |
4 files fetched over 1 fetches - (4 misses, 0.00% hit ratio) over * (glob) |
| 106 |
$ hg rebase -d 2 --keep |
| 107 |
rebasing 1:876b1317060d foo "x2" |