| 1 |
#testcases tree flat-fncache flat-nofncache |
| 2 |
|
| 3 |
Tests narrow stream clones |
| 4 |
|
| 5 |
$ . "$TESTDIR/narrow-library.sh" |
| 6 |
|
| 7 |
#if tree |
| 8 |
$ cat << EOF >> $HGRCPATH |
| 9 |
> [experimental] |
| 10 |
> treemanifest = 1 |
| 11 |
> EOF |
| 12 |
#endif |
| 13 |
|
| 14 |
#if flat-nofncache |
| 15 |
$ cat << EOF >> $HGRCPATH |
| 16 |
> [format] |
| 17 |
> usefncache = 0 |
| 18 |
> EOF |
| 19 |
#endif |
| 20 |
|
| 21 |
Server setup |
| 22 |
|
| 23 |
$ hg init master |
| 24 |
$ cd master |
| 25 |
$ mkdir dir |
| 26 |
$ mkdir dir/src |
| 27 |
$ cd dir/src |
| 28 |
$ for x in `$TESTDIR/seq.py 20`; do echo $x > "F$x"; hg add "F$x"; hg commit -m "Commit src $x"; done |
| 29 |
|
| 30 |
$ cd .. |
| 31 |
$ mkdir tests |
| 32 |
$ cd tests |
| 33 |
$ for x in `$TESTDIR/seq.py 20`; do echo $x > "F$x"; hg add "F$x"; hg commit -m "Commit src $x"; done |
| 34 |
$ cd ../../.. |
| 35 |
|
| 36 |
Trying to stream clone when the server does not support it |
| 37 |
|
| 38 |
$ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream |
| 39 |
streaming all changes |
| 40 |
remote: abort: server does not support narrow stream clones |
| 41 |
abort: pull failed on remote |
| 42 |
[100] |
| 43 |
|
| 44 |
Enable stream clone on the server |
| 45 |
|
| 46 |
$ echo "[experimental]" >> master/.hg/hgrc |
| 47 |
$ echo "server.stream-narrow-clones=True" >> master/.hg/hgrc |
| 48 |
|
| 49 |
Cloning a specific file when stream clone is supported |
| 50 |
|
| 51 |
$ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream |
| 52 |
streaming all changes |
| 53 |
* files to transfer, * KB of data (glob) |
| 54 |
stream-cloned * files / * KB in * seconds (* */sec) (glob) |
| 55 |
|
| 56 |
$ cd narrow |
| 57 |
$ ls -A |
| 58 |
.hg |
| 59 |
$ hg tracked |
| 60 |
I path:dir/src/F10 |
| 61 |
|
| 62 |
Making sure we have the correct set of requirements |
| 63 |
|
| 64 |
$ hg debugrequires |
| 65 |
dotencode (tree !) |
| 66 |
dotencode (flat-fncache !) |
| 67 |
dirstate-v2 (dirstate-v2 !) |
| 68 |
fncache (tree !) |
| 69 |
fncache (flat-fncache !) |
| 70 |
generaldelta |
| 71 |
narrowhg-experimental |
| 72 |
persistent-nodemap (rust !) |
| 73 |
revlog-compression-zstd (zstd !) |
| 74 |
revlogv1 |
| 75 |
share-safe |
| 76 |
sparserevlog |
| 77 |
store |
| 78 |
treemanifest (tree !) |
| 79 |
|
| 80 |
Making sure store has the required files |
| 81 |
|
| 82 |
$ ls .hg/store/ |
| 83 |
00changelog-????????.nd (glob) (rust !) |
| 84 |
00changelog.d |
| 85 |
00changelog.i |
| 86 |
00changelog.n (rust !) |
| 87 |
00manifest.i |
| 88 |
data |
| 89 |
fncache (tree !) |
| 90 |
fncache (flat-fncache !) |
| 91 |
meta (tree !) |
| 92 |
narrowspec |
| 93 |
requires |
| 94 |
undo |
| 95 |
undo.backupfiles |
| 96 |
|
| 97 |
Checking that repository has all the required data and not broken |
| 98 |
|
| 99 |
$ hg verify |
| 100 |
checking changesets |
| 101 |
checking manifests |
| 102 |
checking directory manifests (tree !) |
| 103 |
crosschecking files in changesets and manifests |
| 104 |
checking files |
| 105 |
checking dirstate |
| 106 |
checked 40 changesets with 1 changes to 1 files |