Mercurial > hg
comparison tests/test-config.t @ 35393:4441705b7111
tests: remove (glob) annotations that were only for '\' matches
# skip-blame because this was mechanically rewritten the following script. I
ran it on both *.t and *.py, but none of the *.py changes were proper. All *.t
ones appear to be, and they run without addition failures on both Windows and
Linux.
import argparse
import os
import re
ap = argparse.ArgumentParser()
ap.add_argument('path', nargs='+')
opts = ap.parse_args()
globre = re.compile(r'^(.*) \(glob\)(.*)$')
for p in opts.path:
tmp = p + '.tmp'
with open(p, 'rb') as src, open(tmp, 'wb') as dst:
for line in src:
m = globre.match(line)
if not m or '$LOCALIP' in line or '*' in line:
dst.write(line)
continue
if '?' in line[:-3] or ('?' in line[:-3] and line[-3:] != '(?)'):
dst.write(line)
continue
dst.write(m.group(1) + m.group(2) + '\n')
os.unlink(p)
os.rename(tmp, p)
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 10 Dec 2017 22:50:57 -0500 |
parents | e714159860fd |
children | a22915edc279 |
comparison
equal
deleted
inserted
replaced
35392:5feb782c7a95 | 35393:4441705b7111 |
---|---|
5 | 5 |
6 $ cat > .hg/hgrc << EOF | 6 $ cat > .hg/hgrc << EOF |
7 > novaluekey | 7 > novaluekey |
8 > EOF | 8 > EOF |
9 $ hg showconfig | 9 $ hg showconfig |
10 hg: parse error at $TESTTMP/.hg/hgrc:1: novaluekey (glob) | 10 hg: parse error at $TESTTMP/.hg/hgrc:1: novaluekey |
11 [255] | 11 [255] |
12 | 12 |
13 Invalid syntax: no key | 13 Invalid syntax: no key |
14 | 14 |
15 $ cat > .hg/hgrc << EOF | 15 $ cat > .hg/hgrc << EOF |
16 > =nokeyvalue | 16 > =nokeyvalue |
17 > EOF | 17 > EOF |
18 $ hg showconfig | 18 $ hg showconfig |
19 hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue (glob) | 19 hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue |
20 [255] | 20 [255] |
21 | 21 |
22 Test hint about invalid syntax from leading white space | 22 Test hint about invalid syntax from leading white space |
23 | 23 |
24 $ cat > .hg/hgrc << EOF | 24 $ cat > .hg/hgrc << EOF |
25 > key=value | 25 > key=value |
26 > EOF | 26 > EOF |
27 $ hg showconfig | 27 $ hg showconfig |
28 hg: parse error at $TESTTMP/.hg/hgrc:1: key=value (glob) | 28 hg: parse error at $TESTTMP/.hg/hgrc:1: key=value |
29 unexpected leading whitespace | 29 unexpected leading whitespace |
30 [255] | 30 [255] |
31 | 31 |
32 $ cat > .hg/hgrc << EOF | 32 $ cat > .hg/hgrc << EOF |
33 > [section] | 33 > [section] |
34 > key=value | 34 > key=value |
35 > EOF | 35 > EOF |
36 $ hg showconfig | 36 $ hg showconfig |
37 hg: parse error at $TESTTMP/.hg/hgrc:1: [section] (glob) | 37 hg: parse error at $TESTTMP/.hg/hgrc:1: [section] |
38 unexpected leading whitespace | 38 unexpected leading whitespace |
39 [255] | 39 [255] |
40 | 40 |
41 Reset hgrc | 41 Reset hgrc |
42 | 42 |