##// END OF EJS Templates
test-revlog-mmapindex: make it compatible with chg...
Jun Wu -
r34447:b0c97e44 default
parent child Browse files
Show More
@@ -1,54 +1,55 b''
1 create verbosemmap.py
1 create verbosemmap.py
2 $ cat << EOF > verbosemmap.py
2 $ cat << EOF > verbosemmap.py
3 > # extension to make util.mmapread verbose
3 > # extension to make util.mmapread verbose
4 >
4 >
5 > from __future__ import absolute_import
5 > from __future__ import absolute_import
6 >
6 >
7 > from mercurial import (
7 > from mercurial import (
8 > extensions,
8 > extensions,
9 > util,
9 > util,
10 > )
10 > )
11 >
11 >
12 > def mmapread(orig, fp):
12 > def extsetup(ui):
13 > print "mmapping %s" % fp.name
13 > def mmapread(orig, fp):
14 > return orig(fp)
14 > ui.write("mmapping %s\n" % fp.name)
15 > ui.flush()
16 > return orig(fp)
15 >
17 >
16 > def extsetup(ui):
17 > extensions.wrapfunction(util, 'mmapread', mmapread)
18 > extensions.wrapfunction(util, 'mmapread', mmapread)
18 > EOF
19 > EOF
19
20
20 setting up base repo
21 setting up base repo
21 $ hg init a
22 $ hg init a
22 $ cd a
23 $ cd a
23 $ touch a
24 $ touch a
24 $ hg add a
25 $ hg add a
25 $ hg commit -qm base
26 $ hg commit -qm base
26 $ for i in `$TESTDIR/seq.py 1 100` ; do
27 $ for i in `$TESTDIR/seq.py 1 100` ; do
27 > echo $i > a
28 > echo $i > a
28 > hg commit -qm $i
29 > hg commit -qm $i
29 > done
30 > done
30
31
31 set up verbosemmap extension
32 set up verbosemmap extension
32 $ cat << EOF >> $HGRCPATH
33 $ cat << EOF >> $HGRCPATH
33 > [extensions]
34 > [extensions]
34 > verbosemmap=$TESTTMP/verbosemmap.py
35 > verbosemmap=$TESTTMP/verbosemmap.py
35 > EOF
36 > EOF
36
37
37 mmap index which is now more than 4k long
38 mmap index which is now more than 4k long
38 $ hg log -l 5 -T '{rev}\n' --config experimental.mmapindexthreshold=4k
39 $ hg log -l 5 -T '{rev}\n' --config experimental.mmapindexthreshold=4k
39 mmapping $TESTTMP/a/.hg/store/00changelog.i (glob)
40 mmapping $TESTTMP/a/.hg/store/00changelog.i (glob)
40 100
41 100
41 99
42 99
42 98
43 98
43 97
44 97
44 96
45 96
45
46
46 do not mmap index which is still less than 32k
47 do not mmap index which is still less than 32k
47 $ hg log -l 5 -T '{rev}\n' --config experimental.mmapindexthreshold=32k
48 $ hg log -l 5 -T '{rev}\n' --config experimental.mmapindexthreshold=32k
48 100
49 100
49 99
50 99
50 98
51 98
51 97
52 97
52 96
53 96
53
54
54 $ cd ..
55 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now