comparison tests/test-narrow-clone-stream.t @ 40494:9aeb9e2d28a7

store: introduce _matchtrackedpath() and use it to filter store files This patch introduces a function to filter store files on the basis of the path which they are tracking. The function assumes that the entries can be of two types, 'meta/*' and 'data/*' which means it will just work on revlog based storage and not with another storage ways. For the 'data/*' entries, we remove the 'data/' part and '.i/.d' part from the beginning and the end then pass that to matcher. For the 'meta/*' entries, we remove the 'meta/' and '/00manifest.(i/d)' part from beginning and end then call matcher.visitdir() with it to make sure all the parent directories are also downloaded. Since the storage filtering for narrow stream clones is implemented with this patch, we remove the un-implemented error message, add some more tests and add the treemanifest case to tests too. The tests demonstrate that it works correctly. After this patch, we have now narrow stream clones working. Narrow stream clones are a very important feature for large repositories who have good internet connection because they use streamclones for cloning and if they do normal narrow clone, that takes more time then a full streamclone. Also narrow-stream clone will drastically speed up clone timings. Differential Revision: https://phab.mercurial-scm.org/D5139
author Pulkit Goyal <pulkit@yandex-team.ru>
date Wed, 17 Oct 2018 17:42:32 +0300
parents af62936c2508
children d6ec45b79277
comparison
equal deleted inserted replaced
40493:a2c4502e409b 40494:9aeb9e2d28a7
1 #testcases tree flat
2
1 Tests narrow stream clones 3 Tests narrow stream clones
2 4
3 $ . "$TESTDIR/narrow-library.sh" 5 $ . "$TESTDIR/narrow-library.sh"
6
7 #if tree
8 $ cat << EOF >> $HGRCPATH
9 > [experimental]
10 > treemanifest = 1
11 > EOF
12 #endif
4 13
5 Server setup 14 Server setup
6 15
7 $ hg init master 16 $ hg init master
8 $ cd master 17 $ cd master
25 abort: pull failed on remote 34 abort: pull failed on remote
26 [255] 35 [255]
27 36
28 Enable stream clone on the server 37 Enable stream clone on the server
29 38
30 $ echo "[server]" >> master/.hg/hgrc 39 $ echo "[experimental.server]" >> master/.hg/hgrc
31 $ echo "stream-narrow-clones=True" >> master/.hg/hgrc 40 $ echo "stream-narrow-clones=True" >> master/.hg/hgrc
32 41
33 Cloning a specific file when stream clone is supported 42 Cloning a specific file when stream clone is supported
34 43
35 $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/f10" --stream 44 $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/f10" --stream
36 streaming all changes 45 streaming all changes
37 remote: abort: server does not support narrow stream clones 46 * files to transfer, * KB of data (glob)
38 abort: pull failed on remote 47 transferred * KB in * seconds (* */sec) (glob)
39 [255] 48
49 $ cd narrow
50 $ ls
51 $ hg tracked
52 I path:dir/src/f10
53
54 Making sure we have the correct set of requirements
55
56 $ cat .hg/requires
57 dotencode
58 fncache
59 generaldelta
60 narrowhg-experimental
61 revlogv1
62 store
63 treemanifest (tree !)
64
65 Making sure store has the required files
66
67 $ ls .hg/store/
68 00changelog.i
69 00manifest.i
70 data
71 fncache
72 meta (tree !)
73 narrowspec
74 undo
75 undo.backupfiles
76 undo.phaseroots
77
78 Checking that repository has all the required data and not broken
79
80 $ hg verify
81 checking changesets
82 checking manifests
83 checking directory manifests (tree !)
84 crosschecking files in changesets and manifests
85 checking files
86 checked 40 changesets with 1 changes to 1 files