Show More
@@ -72,6 +72,7 b' testfilters = [' | |||||
72 | ] |
|
72 | ] | |
73 |
|
73 | |||
74 | uprefix = r"^ \$ " |
|
74 | uprefix = r"^ \$ " | |
|
75 | uprefixc = r"^ > " | |||
75 | utestpats = [ |
|
76 | utestpats = [ | |
76 | (uprefix + r'.*\|\s*sed', "use regex test output patterns instead of sed"), |
|
77 | (uprefix + r'.*\|\s*sed', "use regex test output patterns instead of sed"), | |
77 | (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"), |
|
78 | (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"), | |
@@ -79,6 +80,7 b' utestpats = [' | |||||
79 | (uprefix + r'.*\|\| echo.*(fail|error)', |
|
80 | (uprefix + r'.*\|\| echo.*(fail|error)', | |
80 | "explicit exit code checks unnecessary"), |
|
81 | "explicit exit code checks unnecessary"), | |
81 | (uprefix + r'set -e', "don't use set -e"), |
|
82 | (uprefix + r'set -e', "don't use set -e"), | |
|
83 | (uprefixc + r'( *)\t', "don't use tabs to indent"), | |||
82 | ] |
|
84 | ] | |
83 |
|
85 | |||
84 | for p, m in testpats: |
|
86 | for p, m in testpats: |
@@ -95,7 +95,7 b' final file versions in this repo:' | |||||
95 | > fmap="$prefix.fmap" |
|
95 | > fmap="$prefix.fmap" | |
96 | > repo="$prefix.repo" |
|
96 | > repo="$prefix.repo" | |
97 | > for i in $files; do |
|
97 | > for i in $files; do | |
98 |
> |
|
98 | > echo "include $i" >> "$fmap" | |
99 | > done |
|
99 | > done | |
100 | > hg -q convert $opts --filemap "$fmap" --datesort source "$repo" |
|
100 | > hg -q convert $opts --filemap "$fmap" --datesort source "$repo" | |
101 | > hg up -q -R "$repo" |
|
101 | > hg up -q -R "$repo" |
@@ -116,7 +116,7 b' Remove the directory, then try to replac' | |||||
116 | > fmap="$prefix.fmap" |
|
116 | > fmap="$prefix.fmap" | |
117 | > repo="$prefix.repo" |
|
117 | > repo="$prefix.repo" | |
118 | > for i in $files; do |
|
118 | > for i in $files; do | |
119 |
> |
|
119 | > echo "include $i" >> "$fmap" | |
120 | > done |
|
120 | > done | |
121 | > hg -q convert $opts --filemap "$fmap" --datesort git-repo2 "$repo" |
|
121 | > hg -q convert $opts --filemap "$fmap" --datesort git-repo2 "$repo" | |
122 | > hg up -q -R "$repo" |
|
122 | > hg up -q -R "$repo" |
@@ -24,26 +24,26 b' should be used from d74fc8dec2b4 onward ' | |||||
24 | > input = StringIO() |
|
24 | > input = StringIO() | |
25 | > |
|
25 | > | |
26 | > def startrsp(status, headers): |
|
26 | > def startrsp(status, headers): | |
27 |
> |
|
27 | > print '---- STATUS' | |
28 |
> |
|
28 | > print status | |
29 |
> |
|
29 | > print '---- HEADERS' | |
30 |
> |
|
30 | > print [i for i in headers if i[0] != 'ETag'] | |
31 |
> |
|
31 | > print '---- DATA' | |
32 |
> |
|
32 | > return output.write | |
33 | > |
|
33 | > | |
34 | > env = { |
|
34 | > env = { | |
35 |
> |
|
35 | > 'wsgi.version': (1, 0), | |
36 |
> |
|
36 | > 'wsgi.url_scheme': 'http', | |
37 |
> |
|
37 | > 'wsgi.errors': errors, | |
38 |
> |
|
38 | > 'wsgi.input': input, | |
39 |
> |
|
39 | > 'wsgi.multithread': False, | |
40 |
> |
|
40 | > 'wsgi.multiprocess': False, | |
41 |
> |
|
41 | > 'wsgi.run_once': False, | |
42 |
> |
|
42 | > 'REQUEST_METHOD': 'GET', | |
43 |
> |
|
43 | > 'SCRIPT_NAME': '', | |
44 |
> |
|
44 | > 'SERVER_NAME': '127.0.0.1', | |
45 |
> |
|
45 | > 'SERVER_PORT': os.environ['HGPORT'], | |
46 |
> |
|
46 | > 'SERVER_PROTOCOL': 'HTTP/1.0' | |
47 | > } |
|
47 | > } | |
48 | > |
|
48 | > | |
49 | > def process(app): |
|
49 | > def process(app): |
@@ -24,35 +24,34 b' should be used from d74fc8dec2b4 onward ' | |||||
24 | > input = StringIO() |
|
24 | > input = StringIO() | |
25 | > |
|
25 | > | |
26 | > def startrsp(status, headers): |
|
26 | > def startrsp(status, headers): | |
27 |
> |
|
27 | > print '---- STATUS' | |
28 |
> |
|
28 | > print status | |
29 |
> |
|
29 | > print '---- HEADERS' | |
30 |
> |
|
30 | > print [i for i in headers if i[0] != 'ETag'] | |
31 |
> |
|
31 | > print '---- DATA' | |
32 |
> |
|
32 | > return output.write | |
33 | > |
|
33 | > | |
34 | > env = { |
|
34 | > env = { | |
35 |
> |
|
35 | > 'wsgi.version': (1, 0), | |
36 |
> |
|
36 | > 'wsgi.url_scheme': 'http', | |
37 |
> |
|
37 | > 'wsgi.errors': errors, | |
38 |
> |
|
38 | > 'wsgi.input': input, | |
39 |
> |
|
39 | > 'wsgi.multithread': False, | |
40 |
> |
|
40 | > 'wsgi.multiprocess': False, | |
41 |
> |
|
41 | > 'wsgi.run_once': False, | |
42 |
> |
|
42 | > 'REQUEST_METHOD': 'GET', | |
43 |
> |
|
43 | > 'SCRIPT_NAME': '', | |
44 |
> |
|
44 | > 'SERVER_NAME': '127.0.0.1', | |
45 |
> |
|
45 | > 'SERVER_PORT': os.environ['HGPORT'], | |
46 |
> |
|
46 | > 'SERVER_PROTOCOL': 'HTTP/1.0' | |
47 | > } |
|
47 | > } | |
48 | > |
|
48 | > | |
49 | > def process(app): |
|
49 | > def process(app): | |
50 |
> |
|
50 | > content = app(env, startrsp) | |
51 |
> |
|
51 | > sys.stdout.write(output.getvalue()) | |
52 |
> |
|
52 | > sys.stdout.write(''.join(content)) | |
53 |
> |
|
53 | > print '---- ERRORS' | |
54 |
> |
|
54 | > print errors.getvalue() | |
55 | > |
|
|||
56 | > |
|
55 | > | |
57 | > output = StringIO() |
|
56 | > output = StringIO() | |
58 | > env['PATH_INFO'] = '/' |
|
57 | > env['PATH_INFO'] = '/' |
@@ -34,28 +34,28 b' by the WSGI standard and strictly implem' | |||||
34 | > output = StringIO() |
|
34 | > output = StringIO() | |
35 | > |
|
35 | > | |
36 | > def startrsp(status, headers): |
|
36 | > def startrsp(status, headers): | |
37 |
> |
|
37 | > print '---- STATUS' | |
38 |
> |
|
38 | > print status | |
39 |
> |
|
39 | > print '---- HEADERS' | |
40 |
> |
|
40 | > print [i for i in headers if i[0] != 'ETag'] | |
41 |
> |
|
41 | > print '---- DATA' | |
42 |
> |
|
42 | > return output.write | |
43 | > |
|
43 | > | |
44 | > env = { |
|
44 | > env = { | |
45 |
> |
|
45 | > 'wsgi.version': (1, 0), | |
46 |
> |
|
46 | > 'wsgi.url_scheme': 'http', | |
47 |
> |
|
47 | > 'wsgi.errors': errors, | |
48 |
> |
|
48 | > 'wsgi.input': input, | |
49 |
> |
|
49 | > 'wsgi.multithread': False, | |
50 |
> |
|
50 | > 'wsgi.multiprocess': False, | |
51 |
> |
|
51 | > 'wsgi.run_once': False, | |
52 |
> |
|
52 | > 'REQUEST_METHOD': 'GET', | |
53 |
> |
|
53 | > 'SCRIPT_NAME': '', | |
54 |
> |
|
54 | > 'PATH_INFO': '', | |
55 |
> |
|
55 | > 'QUERY_STRING': '', | |
56 |
> |
|
56 | > 'SERVER_NAME': '127.0.0.1', | |
57 |
> |
|
57 | > 'SERVER_PORT': os.environ['HGPORT'], | |
58 |
> |
|
58 | > 'SERVER_PROTOCOL': 'HTTP/1.0' | |
59 | > } |
|
59 | > } | |
60 | > |
|
60 | > | |
61 | > i = hgweb('.') |
|
61 | > i = hgweb('.') |
@@ -17,12 +17,12 b' just in case somebody has a strange $TMP' | |||||
17 | > isdir = {} |
|
17 | > isdir = {} | |
18 | > for root, dirs, files in os.walk(sys.argv[1]): |
|
18 | > for root, dirs, files in os.walk(sys.argv[1]): | |
19 | > for d in dirs: |
|
19 | > for d in dirs: | |
20 |
> |
|
20 | > name = os.path.join(root, d) | |
21 |
> |
|
21 | > isdir[name] = 1 | |
22 |
> |
|
22 | > allnames.append(name) | |
23 | > for f in files: |
|
23 | > for f in files: | |
24 |
> |
|
24 | > name = os.path.join(root, f) | |
25 |
> |
|
25 | > allnames.append(name) | |
26 | > allnames.sort() |
|
26 | > allnames.sort() | |
27 | > for name in allnames: |
|
27 | > for name in allnames: | |
28 | > suffix = name in isdir and '/' or '' |
|
28 | > suffix = name in isdir and '/' or '' |
@@ -16,7 +16,7 b' before d74fc8dec2b4 still work.' | |||||
16 | > from mercurial.hgweb.request import wsgiapplication |
|
16 | > from mercurial.hgweb.request import wsgiapplication | |
17 | > |
|
17 | > | |
18 | > def make_web_app(): |
|
18 | > def make_web_app(): | |
19 |
> |
|
19 | > return hgweb("test", "Empty test repository") | |
20 | > |
|
20 | > | |
21 | > wsgicgi.launch(wsgiapplication(make_web_app)) |
|
21 | > wsgicgi.launch(wsgiapplication(make_web_app)) | |
22 | > HGWEB |
|
22 | > HGWEB | |
@@ -42,7 +42,7 b' before d74fc8dec2b4 still work.' | |||||
42 | > from mercurial.hgweb.request import wsgiapplication |
|
42 | > from mercurial.hgweb.request import wsgiapplication | |
43 | > |
|
43 | > | |
44 | > def make_web_app(): |
|
44 | > def make_web_app(): | |
45 |
> |
|
45 | > return hgwebdir("hgweb.config") | |
46 | > |
|
46 | > | |
47 | > wsgicgi.launch(wsgiapplication(make_web_app)) |
|
47 | > wsgicgi.launch(wsgiapplication(make_web_app)) | |
48 | > HGWEBDIR |
|
48 | > HGWEBDIR |
@@ -6,11 +6,11 b'' | |||||
6 | > p2=$3 |
|
6 | > p2=$3 | |
7 | > |
|
7 | > | |
8 | > if [ "$p1" ]; then |
|
8 | > if [ "$p1" ]; then | |
9 |
> |
|
9 | > hg up -qC $p1 | |
10 | > fi |
|
10 | > fi | |
11 | > |
|
11 | > | |
12 | > if [ "$p2" ]; then |
|
12 | > if [ "$p2" ]; then | |
13 |
> |
|
13 | > HGMERGE=true hg merge -q $p2 | |
14 | > fi |
|
14 | > fi | |
15 | > |
|
15 | > | |
16 | > echo >> foo |
|
16 | > echo >> foo | |
@@ -41,8 +41,8 b'' | |||||
41 | $ lookup() |
|
41 | $ lookup() | |
42 | > { |
|
42 | > { | |
43 | > for rev in "$@"; do |
|
43 | > for rev in "$@"; do | |
44 |
> |
|
44 | > printf "$rev: " | |
45 |
> |
|
45 | > hg id -nr $rev | |
46 | > done |
|
46 | > done | |
47 | > true |
|
47 | > true | |
48 | > } |
|
48 | > } |
@@ -29,12 +29,12 b' serve errors' | |||||
29 |
|
29 | |||
30 | $ cat errors.log |
|
30 | $ cat errors.log | |
31 | $ req() { |
|
31 | $ req() { | |
32 |
> |
|
32 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
33 |
> |
|
33 | > cat hg.pid >> $DAEMON_PIDS | |
34 |
> |
|
34 | > hg --cwd ../test pull http://localhost:$HGPORT/ | |
35 |
> |
|
35 | > kill `cat hg.pid` | |
36 |
> |
|
36 | > echo % serve errors | |
37 |
> |
|
37 | > cat errors.log | |
38 | > } |
|
38 | > } | |
39 |
|
39 | |||
40 | expect error, pulling not allowed |
|
40 | expect error, pulling not allowed |
@@ -13,12 +13,12 b'' | |||||
13 | $ echo a >> a |
|
13 | $ echo a >> a | |
14 | $ hg ci -mb |
|
14 | $ hg ci -mb | |
15 | $ req() { |
|
15 | $ req() { | |
16 |
> |
|
16 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
17 |
> |
|
17 | > cat hg.pid >> $DAEMON_PIDS | |
18 |
> |
|
18 | > hg --cwd ../test2 push http://localhost:$HGPORT/ | |
19 |
> |
|
19 | > kill `cat hg.pid` | |
20 |
> |
|
20 | > echo % serve errors | |
21 |
> |
|
21 | > cat errors.log | |
22 | > } |
|
22 | > } | |
23 | $ cd ../test |
|
23 | $ cd ../test | |
24 |
|
24 |
@@ -66,8 +66,8 b' args:' | |||||
66 | > cp rev $1 |
|
66 | > cp rev $1 | |
67 | > hg add $1 2> /dev/null |
|
67 | > hg add $1 2> /dev/null | |
68 | > if [ "$2" != "" ] ; then |
|
68 | > if [ "$2" != "" ] ; then | |
69 |
> |
|
69 | > cp rev $2 | |
70 |
> |
|
70 | > hg add $2 2> /dev/null | |
71 | > fi |
|
71 | > fi | |
72 | > } |
|
72 | > } | |
73 | $ uc() { up $1; hg cp $1 $2; } # update + copy |
|
73 | $ uc() { up $1; hg cp $1 $2; } # update + copy |
General Comments 0
You need to be logged in to leave comments.
Login now