##// END OF EJS Templates
tests: conditionalize tests based on presence of revlogs for files...
Gregory Szorc -
r37356:cbc4425e default
parent child Browse files
Show More
@@ -717,3 +717,47 b' def has_xdiff():'
717 return bdiff.xdiffblocks(b'', b'') == [(0, 0, 0, 0)]
717 return bdiff.xdiffblocks(b'', b'') == [(0, 0, 0, 0)]
718 except (ImportError, AttributeError):
718 except (ImportError, AttributeError):
719 return False
719 return False
720
721 def getrepofeatures():
722 """Obtain set of repository features in use.
723
724 HGREPOFEATURES can be used to define or remove features. It contains
725 a space-delimited list of feature strings. Strings beginning with ``-``
726 mean to remove.
727 """
728 # Default list provided by core.
729 features = {
730 'revlogstore',
731 }
732
733 # Features that imply other features.
734 implies = {
735 'simplestore': ['-revlogstore'],
736 }
737
738 for override in os.environ.get('HGREPOFEATURES', '').split(' '):
739 if not override:
740 continue
741
742 if override.startswith('-'):
743 if override[1:] in features:
744 features.remove(override[1:])
745 else:
746 features.add(override)
747
748 for imply in implies.get(override, []):
749 if imply.startswith('-'):
750 if imply[1:] in features:
751 features.remove(imply[1:])
752 else:
753 features.add(imply)
754
755 return features
756
757 @check('reporevlogstore', 'repository using the default revlog store')
758 def has_reporevlogstore():
759 return 'revlogstore' in getrepofeatures()
760
761 @check('reposimplestore', 'repository using simple storage extension')
762 def has_reposimplestore():
763 return 'simplestore' in getrepofeatures()
@@ -5,6 +5,11 b''
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 # To use this with the test suite:
9 #
10 # $ HGREPOFEATURES="simplestore" ./run-tests.py \
11 # --extra-config-opt extensions.simplestore=`pwd`/simplestorerepo.py
12
8 from __future__ import absolute_import
13 from __future__ import absolute_import
9
14
10 from mercurial.i18n import _
15 from mercurial.i18n import _
@@ -28,12 +28,14 b' Create a non-inlined filelog:'
28
28
29 List files in store/data (should show a 'b.d'):
29 List files in store/data (should show a 'b.d'):
30
30
31 #if reporevlogstore
31 $ for i in .hg/store/data/*; do
32 $ for i in .hg/store/data/*; do
32 > echo $i
33 > echo $i
33 > done
34 > done
34 .hg/store/data/a.i
35 .hg/store/data/a.i
35 .hg/store/data/b.d
36 .hg/store/data/b.d
36 .hg/store/data/b.i
37 .hg/store/data/b.i
38 #endif
37
39
38 Trigger branchcache creation:
40 Trigger branchcache creation:
39
41
@@ -158,7 +158,9 b' perfstatus'
158 $ hg perfpathcopies 1 2
158 $ hg perfpathcopies 1 2
159 $ hg perfrawfiles 2
159 $ hg perfrawfiles 2
160 $ hg perfrevlogindex -c
160 $ hg perfrevlogindex -c
161 #if reporevlogstore
161 $ hg perfrevlogrevisions .hg/store/data/a.i
162 $ hg perfrevlogrevisions .hg/store/data/a.i
163 #endif
162 $ hg perfrevlogrevision -m 0
164 $ hg perfrevlogrevision -m 0
163 $ hg perfrevlogchunks -c
165 $ hg perfrevlogchunks -c
164 $ hg perfrevrange
166 $ hg perfrevrange
@@ -516,8 +516,14 b' testing: convert must not produce duplic'
516 contents of fncache file:
516 contents of fncache file:
517
517
518 $ cat b/.hg/store/fncache | sort
518 $ cat b/.hg/store/fncache | sort
519 data/a.i
519 data/a.i (reporevlogstore !)
520 data/b.i
520 data/b.i (reporevlogstore !)
521 data/a/0f3078c2d7345d887b54f7c9dab0d91bfa57fd07 (reposimplestore !)
522 data/a/4271c3e84237016935a176b6f282fde2128458b0 (reposimplestore !)
523 data/a/b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (reposimplestore !)
524 data/a/index (reposimplestore !)
525 data/b/37d9b5d994eab34eda9c16b195ace52c7b129980 (reposimplestore !)
526 data/b/index (reposimplestore !)
521
527
522 test bogus URL
528 test bogus URL
523
529
@@ -86,8 +86,10 b' this should show the rename information '
86 copy: a
86 copy: a
87 copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
87 copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
88
88
89 #if reporevlogstore
89 $ md5sum.py .hg/store/data/b.i
90 $ md5sum.py .hg/store/data/b.i
90 44913824c8f5890ae218f9829535922e .hg/store/data/b.i
91 44913824c8f5890ae218f9829535922e .hg/store/data/b.i
92 #endif
91 $ hg cat b > bsum
93 $ hg cat b > bsum
92 $ md5sum.py bsum
94 $ md5sum.py bsum
93 60b725f10c9c85c70d97880dfe8191b3 bsum
95 60b725f10c9c85c70d97880dfe8191b3 bsum
@@ -1,4 +1,4 b''
1 #require hardlink
1 #require hardlink reporevlogstore
2
2
3 $ cat > nlinks.py <<EOF
3 $ cat > nlinks.py <<EOF
4 > from __future__ import print_function
4 > from __future__ import print_function
@@ -16,7 +16,8 b' url for proxy, stream'
16
16
17 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --stream http://localhost:$HGPORT/ b
17 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --stream http://localhost:$HGPORT/ b
18 streaming all changes
18 streaming all changes
19 3 files to transfer, 303 bytes of data
19 3 files to transfer, 303 bytes of data (reporevlogstore !)
20 4 files to transfer, 330 bytes of data (reposimplestore !)
20 transferred * bytes in * seconds (*/sec) (glob)
21 transferred * bytes in * seconds (*/sec) (glob)
21 searching for changes
22 searching for changes
22 no changes found
23 no changes found
@@ -153,7 +153,7 b' Specifying a revset that evaluates to nu'
153 uncompressed size of bundle content:
153 uncompressed size of bundle content:
154 352 (changelog)
154 352 (changelog)
155 326 (manifests)
155 326 (manifests)
156 253 foo
156 25\d foo (re)
157 adding changesets
157 adding changesets
158 adding manifests
158 adding manifests
159 adding file changes
159 adding file changes
@@ -73,6 +73,8 b' clone and pull to break links'
73
73
74 relink
74 relink
75
75
76 #if no-reposimplestore
77
76 $ hg relink --debug --config progress.debug=true | fix_path
78 $ hg relink --debug --config progress.debug=true | fix_path
77 relinking $TESTTMP/repo/.hg/store to $TESTTMP/clone/.hg/store
79 relinking $TESTTMP/repo/.hg/store to $TESTTMP/clone/.hg/store
78 tip has 2 files, estimated total number of files: 3
80 tip has 2 files, estimated total number of files: 3
@@ -101,3 +103,4 b' check hardlinks'
101 $ $PYTHON arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i
103 $ $PYTHON arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i
102 repo/.hg/store/data/b.i != clone/.hg/store/data/b.i
104 repo/.hg/store/data/b.i != clone/.hg/store/data/b.i
103
105
106 #endif
@@ -448,6 +448,7 b' verify fncache is kept up-to-date'
448 $ cat .hg/store/fncache | sort
448 $ cat .hg/store/fncache | sort
449 data/a.i
449 data/a.i
450 data/bar.i
450 data/bar.i
451
451 $ hg strip tip
452 $ hg strip tip
452 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
453 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
453 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
454 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
@@ -34,6 +34,7 b" Preparing the 'sub1' repo which depends "
34 linking [ <=> ] 4\r (no-eol) (esc)
34 linking [ <=> ] 4\r (no-eol) (esc)
35 linking [ <=> ] 5\r (no-eol) (esc)
35 linking [ <=> ] 5\r (no-eol) (esc)
36 linking [ <=> ] 6\r (no-eol) (esc)
36 linking [ <=> ] 6\r (no-eol) (esc)
37 linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !)
37 \r (no-eol) (esc)
38 \r (no-eol) (esc)
38 \r (no-eol) (esc)
39 \r (no-eol) (esc)
39 updating [===========================================>] 1/1\r (no-eol) (esc)
40 updating [===========================================>] 1/1\r (no-eol) (esc)
@@ -60,6 +61,9 b" Preparing the 'main' repo which depends "
60 linking [ <=> ] 6\r (no-eol) (esc)
61 linking [ <=> ] 6\r (no-eol) (esc)
61 linking [ <=> ] 7\r (no-eol) (esc)
62 linking [ <=> ] 7\r (no-eol) (esc)
62 linking [ <=> ] 8\r (no-eol) (esc)
63 linking [ <=> ] 8\r (no-eol) (esc)
64 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
65 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
66 linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !)
63 \r (no-eol) (esc)
67 \r (no-eol) (esc)
64 \r (no-eol) (esc)
68 \r (no-eol) (esc)
65 updating [===========================================>] 3/3\r (no-eol) (esc)
69 updating [===========================================>] 3/3\r (no-eol) (esc)
@@ -71,6 +75,7 b" Preparing the 'main' repo which depends "
71 linking [ <=> ] 4\r (no-eol) (esc)
75 linking [ <=> ] 4\r (no-eol) (esc)
72 linking [ <=> ] 5\r (no-eol) (esc)
76 linking [ <=> ] 5\r (no-eol) (esc)
73 linking [ <=> ] 6\r (no-eol) (esc)
77 linking [ <=> ] 6\r (no-eol) (esc)
78 linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !)
74 updating [===========================================>] 1/1\r (no-eol) (esc)
79 updating [===========================================>] 1/1\r (no-eol) (esc)
75 \r (no-eol) (esc)
80 \r (no-eol) (esc)
76 updating to branch default
81 updating to branch default
@@ -161,6 +166,9 b' Clone main'
161 linking [ <=> ] 6\r (no-eol) (esc)
166 linking [ <=> ] 6\r (no-eol) (esc)
162 linking [ <=> ] 7\r (no-eol) (esc)
167 linking [ <=> ] 7\r (no-eol) (esc)
163 linking [ <=> ] 8\r (no-eol) (esc)
168 linking [ <=> ] 8\r (no-eol) (esc)
169 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
170 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
171 linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !)
164 \r (no-eol) (esc)
172 \r (no-eol) (esc)
165 \r (no-eol) (esc)
173 \r (no-eol) (esc)
166 updating [===========================================>] 3/3\r (no-eol) (esc)
174 updating [===========================================>] 3/3\r (no-eol) (esc)
@@ -174,15 +182,25 b' Clone main'
174 linking [ <=> ] 6\r (no-eol) (esc)
182 linking [ <=> ] 6\r (no-eol) (esc)
175 linking [ <=> ] 7\r (no-eol) (esc)
183 linking [ <=> ] 7\r (no-eol) (esc)
176 linking [ <=> ] 8\r (no-eol) (esc)
184 linking [ <=> ] 8\r (no-eol) (esc)
185 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
186 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
187 linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !)
177 updating [===========================================>] 3/3\r (no-eol) (esc)
188 updating [===========================================>] 3/3\r (no-eol) (esc)
178 \r (no-eol) (esc)
189 \r (no-eol) (esc)
179 \r (no-eol) (esc)
190 \r (no-eol) (esc)
180 linking [ <=> ] 1\r (no-eol) (esc)
191 linking [ <=> ] 1\r (no-eol) (esc) (no-reposimplestore !)
181 linking [ <=> ] 2\r (no-eol) (esc)
192 linking [ <=> ] 2\r (no-eol) (esc) (no-reposimplestore !)
182 linking [ <=> ] 3\r (no-eol) (esc)
193 linking [ <=> ] 3\r (no-eol) (esc) (no-reposimplestore !)
183 linking [ <=> ] 4\r (no-eol) (esc)
194 linking [ <=> ] 4\r (no-eol) (esc) (no-reposimplestore !)
184 linking [ <=> ] 5\r (no-eol) (esc)
195 linking [ <=> ] 5\r (no-eol) (esc) (no-reposimplestore !)
185 linking [ <=> ] 6\r (no-eol) (esc)
196 linking [ <=> ] 6\r (no-eol) (esc) (no-reposimplestore !)
197 linking [ <=> ] 1\r (no-eol) (esc) (reposimplestore !)
198 linking [ <=> ] 2\r (no-eol) (esc) (reposimplestore !)
199 linking [ <=> ] 3\r (no-eol) (esc) (reposimplestore !)
200 linking [ <=> ] 4\r (no-eol) (esc) (reposimplestore !)
201 linking [ <=> ] 5\r (no-eol) (esc) (reposimplestore !)
202 linking [ <=> ] 6\r (no-eol) (esc) (reposimplestore !)
203 linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !)
186 updating [===========================================>] 1/1\r (no-eol) (esc)
204 updating [===========================================>] 1/1\r (no-eol) (esc)
187 \r (no-eol) (esc)
205 \r (no-eol) (esc)
188 updating to branch default
206 updating to branch default
@@ -462,6 +462,11 b' cloned:'
462 linking [ <=> ] 6\r (no-eol) (esc)
462 linking [ <=> ] 6\r (no-eol) (esc)
463 linking [ <=> ] 7\r (no-eol) (esc)
463 linking [ <=> ] 7\r (no-eol) (esc)
464 linking [ <=> ] 8\r (no-eol) (esc)
464 linking [ <=> ] 8\r (no-eol) (esc)
465 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
466 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
467 linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !)
468 linking [ <=> ] 12\r (no-eol) (esc) (reposimplestore !)
469 linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !)
465 \r (no-eol) (esc)
470 \r (no-eol) (esc)
466 #else
471 #else
467 $ hg clone -U . ../empty
472 $ hg clone -U . ../empty
@@ -487,6 +492,13 b' cloned:'
487 linking [ <=> ] 6\r (no-eol) (esc)
492 linking [ <=> ] 6\r (no-eol) (esc)
488 linking [ <=> ] 7\r (no-eol) (esc)
493 linking [ <=> ] 7\r (no-eol) (esc)
489 linking [ <=> ] 8\r (no-eol) (esc)
494 linking [ <=> ] 8\r (no-eol) (esc)
495 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
496 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
497 linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !)
498 linking [ <=> ] 12\r (no-eol) (esc) (reposimplestore !)
499 linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !)
500 linking [ <=> ] 14\r (no-eol) (esc) (reposimplestore !)
501 linking [ <=> ] 15\r (no-eol) (esc) (reposimplestore !)
490 \r (no-eol) (esc)
502 \r (no-eol) (esc)
491 \r (no-eol) (esc)
503 \r (no-eol) (esc)
492 archiving (foo) [ ] 0/3\r (no-eol) (esc)
504 archiving (foo) [ ] 0/3\r (no-eol) (esc)
@@ -501,6 +513,9 b' cloned:'
501 linking [ <=> ] 4\r (no-eol) (esc)
513 linking [ <=> ] 4\r (no-eol) (esc)
502 linking [ <=> ] 5\r (no-eol) (esc)
514 linking [ <=> ] 5\r (no-eol) (esc)
503 linking [ <=> ] 6\r (no-eol) (esc)
515 linking [ <=> ] 6\r (no-eol) (esc)
516 linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !)
517 linking [ <=> ] 8\r (no-eol) (esc) (reposimplestore !)
518 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
504 \r (no-eol) (esc)
519 \r (no-eol) (esc)
505 \r (no-eol) (esc)
520 \r (no-eol) (esc)
506 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
521 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
@@ -1,3 +1,5 b''
1 #require no-reposimplestore
2
1 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
2 > [extensions]
4 > [extensions]
3 > share =
5 > share =
General Comments 0
You need to be logged in to leave comments. Login now