comparison tests/test-sparse-profiles.t @ 34334:1d1779734c99

sparse: require [section] in sparse config files (BC) Previously, [include] was implicit and pattern lines before a [section] were added to includes. Because the format may change in the future and explicit behavior, well, more explicit, this commit changes the config parser to reject pattern lines that don't occur in a [section]. Differential Revision: https://phab.mercurial-scm.org/D96
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 15 Jul 2017 13:21:23 -0700
parents de324547c751
children 41ef02ba329b
comparison
equal deleted inserted replaced
34333:32f348d741e5 34334:1d1779734c99
8 > purge= 8 > purge=
9 > strip= 9 > strip=
10 > rebase= 10 > rebase=
11 > EOF 11 > EOF
12 12
13 Config file without [section] is rejected
14
15 $ cat > bad.sparse <<EOF
16 > *.html
17 > EOF
18
19 $ hg debugsparse --import-rules bad.sparse
20 abort: sparse config entry outside of section: *.html
21 (add an [include] or [exclude] line to declare the entry type)
22 [255]
23 $ rm bad.sparse
24
13 $ echo a > index.html 25 $ echo a > index.html
14 $ echo x > data.py 26 $ echo x > data.py
15 $ echo z > readme.txt 27 $ echo z > readme.txt
16 $ cat > webpage.sparse <<EOF 28 $ cat > webpage.sparse <<EOF
17 > # frontend sparse profile 29 > # frontend sparse profile
255 > [extensions] 267 > [extensions]
256 > sparse= 268 > sparse=
257 > EOF 269 > EOF
258 $ touch a b 270 $ touch a b
259 $ cat > .hgsparse <<EOF 271 $ cat > .hgsparse <<EOF
272 > [include]
260 > a 273 > a
261 > EOF 274 > EOF
262 $ hg commit -Aqm 'initial' 275 $ hg commit -Aqm 'initial'
263 $ chmod a+x b 276 $ chmod a+x b
264 $ hg commit -qm 'make executable' 277 $ hg commit -qm 'make executable'