diff --git a/contrib/check-code.py b/contrib/check-code.py index 6ab4a7d3c1791b2b7344854b22a6e94afa21481a_Y29udHJpYi9jaGVjay1jb2RlLnB5..4c4aeaab233905def16e69972567f01ed31936e0_Y29udHJpYi9jaGVjay1jb2RlLnB5 100755 --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -72,6 +72,7 @@ ] uprefix = r"^ \$ " +uprefixc = r"^ > " utestpats = [ (uprefix + r'.*\|\s*sed', "use regex test output patterns instead of sed"), (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"), @@ -79,6 +80,7 @@ (uprefix + r'.*\|\| echo.*(fail|error)', "explicit exit code checks unnecessary"), (uprefix + r'set -e', "don't use set -e"), + (uprefixc + r'( *)\t', "don't use tabs to indent"), ] for p, m in testpats: diff --git a/tests/test-convert-filemap.t b/tests/test-convert-filemap.t index 6ab4a7d3c1791b2b7344854b22a6e94afa21481a_dGVzdHMvdGVzdC1jb252ZXJ0LWZpbGVtYXAudA==..4c4aeaab233905def16e69972567f01ed31936e0_dGVzdHMvdGVzdC1jb252ZXJ0LWZpbGVtYXAudA== 100644 --- a/tests/test-convert-filemap.t +++ b/tests/test-convert-filemap.t @@ -95,7 +95,7 @@ > fmap="$prefix.fmap" > repo="$prefix.repo" > for i in $files; do - > echo "include $i" >> "$fmap" + > echo "include $i" >> "$fmap" > done > hg -q convert $opts --filemap "$fmap" --datesort source "$repo" > hg up -q -R "$repo" diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t index 6ab4a7d3c1791b2b7344854b22a6e94afa21481a_dGVzdHMvdGVzdC1jb252ZXJ0LWdpdC50..4c4aeaab233905def16e69972567f01ed31936e0_dGVzdHMvdGVzdC1jb252ZXJ0LWdpdC50 100644 --- a/tests/test-convert-git.t +++ b/tests/test-convert-git.t @@ -116,7 +116,7 @@ > fmap="$prefix.fmap" > repo="$prefix.repo" > for i in $files; do - > echo "include $i" >> "$fmap" + > echo "include $i" >> "$fmap" > done > hg -q convert $opts --filemap "$fmap" --datesort git-repo2 "$repo" > hg up -q -R "$repo" diff --git a/tests/test-hgweb-no-path-info.t b/tests/test-hgweb-no-path-info.t index 6ab4a7d3c1791b2b7344854b22a6e94afa21481a_dGVzdHMvdGVzdC1oZ3dlYi1uby1wYXRoLWluZm8udA==..4c4aeaab233905def16e69972567f01ed31936e0_dGVzdHMvdGVzdC1oZ3dlYi1uby1wYXRoLWluZm8udA== 100644 --- a/tests/test-hgweb-no-path-info.t +++ b/tests/test-hgweb-no-path-info.t @@ -24,11 +24,11 @@ > input = StringIO() > > def startrsp(status, headers): - > print '---- STATUS' - > print status - > print '---- HEADERS' - > print [i for i in headers if i[0] != 'ETag'] - > print '---- DATA' - > return output.write + > print '---- STATUS' + > print status + > print '---- HEADERS' + > print [i for i in headers if i[0] != 'ETag'] + > print '---- DATA' + > return output.write > > env = { @@ -33,17 +33,17 @@ > > env = { - > 'wsgi.version': (1, 0), - > 'wsgi.url_scheme': 'http', - > 'wsgi.errors': errors, - > 'wsgi.input': input, - > 'wsgi.multithread': False, - > 'wsgi.multiprocess': False, - > 'wsgi.run_once': False, - > 'REQUEST_METHOD': 'GET', - > 'SCRIPT_NAME': '', - > 'SERVER_NAME': '127.0.0.1', - > 'SERVER_PORT': os.environ['HGPORT'], - > 'SERVER_PROTOCOL': 'HTTP/1.0' + > 'wsgi.version': (1, 0), + > 'wsgi.url_scheme': 'http', + > 'wsgi.errors': errors, + > 'wsgi.input': input, + > 'wsgi.multithread': False, + > 'wsgi.multiprocess': False, + > 'wsgi.run_once': False, + > 'REQUEST_METHOD': 'GET', + > 'SCRIPT_NAME': '', + > 'SERVER_NAME': '127.0.0.1', + > 'SERVER_PORT': os.environ['HGPORT'], + > 'SERVER_PROTOCOL': 'HTTP/1.0' > } > > def process(app): diff --git a/tests/test-hgweb-no-request-uri.t b/tests/test-hgweb-no-request-uri.t index 6ab4a7d3c1791b2b7344854b22a6e94afa21481a_dGVzdHMvdGVzdC1oZ3dlYi1uby1yZXF1ZXN0LXVyaS50..4c4aeaab233905def16e69972567f01ed31936e0_dGVzdHMvdGVzdC1oZ3dlYi1uby1yZXF1ZXN0LXVyaS50 100644 --- a/tests/test-hgweb-no-request-uri.t +++ b/tests/test-hgweb-no-request-uri.t @@ -24,11 +24,11 @@ > input = StringIO() > > def startrsp(status, headers): - > print '---- STATUS' - > print status - > print '---- HEADERS' - > print [i for i in headers if i[0] != 'ETag'] - > print '---- DATA' - > return output.write + > print '---- STATUS' + > print status + > print '---- HEADERS' + > print [i for i in headers if i[0] != 'ETag'] + > print '---- DATA' + > return output.write > > env = { @@ -33,17 +33,17 @@ > > env = { - > 'wsgi.version': (1, 0), - > 'wsgi.url_scheme': 'http', - > 'wsgi.errors': errors, - > 'wsgi.input': input, - > 'wsgi.multithread': False, - > 'wsgi.multiprocess': False, - > 'wsgi.run_once': False, - > 'REQUEST_METHOD': 'GET', - > 'SCRIPT_NAME': '', - > 'SERVER_NAME': '127.0.0.1', - > 'SERVER_PORT': os.environ['HGPORT'], - > 'SERVER_PROTOCOL': 'HTTP/1.0' + > 'wsgi.version': (1, 0), + > 'wsgi.url_scheme': 'http', + > 'wsgi.errors': errors, + > 'wsgi.input': input, + > 'wsgi.multithread': False, + > 'wsgi.multiprocess': False, + > 'wsgi.run_once': False, + > 'REQUEST_METHOD': 'GET', + > 'SCRIPT_NAME': '', + > 'SERVER_NAME': '127.0.0.1', + > 'SERVER_PORT': os.environ['HGPORT'], + > 'SERVER_PROTOCOL': 'HTTP/1.0' > } > > def process(app): @@ -47,12 +47,11 @@ > } > > def process(app): - > content = app(env, startrsp) - > sys.stdout.write(output.getvalue()) - > sys.stdout.write(''.join(content)) - > print '---- ERRORS' - > print errors.getvalue() - > + > content = app(env, startrsp) + > sys.stdout.write(output.getvalue()) + > sys.stdout.write(''.join(content)) + > print '---- ERRORS' + > print errors.getvalue() > > output = StringIO() > env['PATH_INFO'] = '/' diff --git a/tests/test-hgweb-non-interactive.t b/tests/test-hgweb-non-interactive.t index 6ab4a7d3c1791b2b7344854b22a6e94afa21481a_dGVzdHMvdGVzdC1oZ3dlYi1ub24taW50ZXJhY3RpdmUudA==..4c4aeaab233905def16e69972567f01ed31936e0_dGVzdHMvdGVzdC1oZ3dlYi1ub24taW50ZXJhY3RpdmUudA== 100644 --- a/tests/test-hgweb-non-interactive.t +++ b/tests/test-hgweb-non-interactive.t @@ -34,11 +34,11 @@ > output = StringIO() > > def startrsp(status, headers): - > print '---- STATUS' - > print status - > print '---- HEADERS' - > print [i for i in headers if i[0] != 'ETag'] - > print '---- DATA' - > return output.write + > print '---- STATUS' + > print status + > print '---- HEADERS' + > print [i for i in headers if i[0] != 'ETag'] + > print '---- DATA' + > return output.write > > env = { @@ -43,19 +43,19 @@ > > env = { - > 'wsgi.version': (1, 0), - > 'wsgi.url_scheme': 'http', - > 'wsgi.errors': errors, - > 'wsgi.input': input, - > 'wsgi.multithread': False, - > 'wsgi.multiprocess': False, - > 'wsgi.run_once': False, - > 'REQUEST_METHOD': 'GET', - > 'SCRIPT_NAME': '', - > 'PATH_INFO': '', - > 'QUERY_STRING': '', - > 'SERVER_NAME': '127.0.0.1', - > 'SERVER_PORT': os.environ['HGPORT'], - > 'SERVER_PROTOCOL': 'HTTP/1.0' + > 'wsgi.version': (1, 0), + > 'wsgi.url_scheme': 'http', + > 'wsgi.errors': errors, + > 'wsgi.input': input, + > 'wsgi.multithread': False, + > 'wsgi.multiprocess': False, + > 'wsgi.run_once': False, + > 'REQUEST_METHOD': 'GET', + > 'SCRIPT_NAME': '', + > 'PATH_INFO': '', + > 'QUERY_STRING': '', + > 'SERVER_NAME': '127.0.0.1', + > 'SERVER_PORT': os.environ['HGPORT'], + > 'SERVER_PROTOCOL': 'HTTP/1.0' > } > > i = hgweb('.') diff --git a/tests/test-inherit-mode.t b/tests/test-inherit-mode.t index 6ab4a7d3c1791b2b7344854b22a6e94afa21481a_dGVzdHMvdGVzdC1pbmhlcml0LW1vZGUudA==..4c4aeaab233905def16e69972567f01ed31936e0_dGVzdHMvdGVzdC1pbmhlcml0LW1vZGUudA== 100644 --- a/tests/test-inherit-mode.t +++ b/tests/test-inherit-mode.t @@ -17,7 +17,7 @@ > isdir = {} > for root, dirs, files in os.walk(sys.argv[1]): > for d in dirs: - > name = os.path.join(root, d) - > isdir[name] = 1 - > allnames.append(name) + > name = os.path.join(root, d) + > isdir[name] = 1 + > allnames.append(name) > for f in files: @@ -23,6 +23,6 @@ > for f in files: - > name = os.path.join(root, f) - > allnames.append(name) + > name = os.path.join(root, f) + > allnames.append(name) > allnames.sort() > for name in allnames: > suffix = name in isdir and '/' or '' diff --git a/tests/test-newcgi.t b/tests/test-newcgi.t index 6ab4a7d3c1791b2b7344854b22a6e94afa21481a_dGVzdHMvdGVzdC1uZXdjZ2kudA==..4c4aeaab233905def16e69972567f01ed31936e0_dGVzdHMvdGVzdC1uZXdjZ2kudA== 100644 --- a/tests/test-newcgi.t +++ b/tests/test-newcgi.t @@ -16,7 +16,7 @@ > from mercurial.hgweb.request import wsgiapplication > > def make_web_app(): - > return hgweb("test", "Empty test repository") + > return hgweb("test", "Empty test repository") > > wsgicgi.launch(wsgiapplication(make_web_app)) > HGWEB @@ -42,7 +42,7 @@ > from mercurial.hgweb.request import wsgiapplication > > def make_web_app(): - > return hgwebdir("hgweb.config") + > return hgwebdir("hgweb.config") > > wsgicgi.launch(wsgiapplication(make_web_app)) > HGWEBDIR diff --git a/tests/test-parentrevspec.t b/tests/test-parentrevspec.t index 6ab4a7d3c1791b2b7344854b22a6e94afa21481a_dGVzdHMvdGVzdC1wYXJlbnRyZXZzcGVjLnQ=..4c4aeaab233905def16e69972567f01ed31936e0_dGVzdHMvdGVzdC1wYXJlbnRyZXZzcGVjLnQ= 100644 --- a/tests/test-parentrevspec.t +++ b/tests/test-parentrevspec.t @@ -6,7 +6,7 @@ > p2=$3 > > if [ "$p1" ]; then - > hg up -qC $p1 + > hg up -qC $p1 > fi > > if [ "$p2" ]; then @@ -10,7 +10,7 @@ > fi > > if [ "$p2" ]; then - > HGMERGE=true hg merge -q $p2 + > HGMERGE=true hg merge -q $p2 > fi > > echo >> foo @@ -41,8 +41,8 @@ $ lookup() > { > for rev in "$@"; do - > printf "$rev: " - > hg id -nr $rev + > printf "$rev: " + > hg id -nr $rev > done > true > } diff --git a/tests/test-pull-http.t b/tests/test-pull-http.t index 6ab4a7d3c1791b2b7344854b22a6e94afa21481a_dGVzdHMvdGVzdC1wdWxsLWh0dHAudA==..4c4aeaab233905def16e69972567f01ed31936e0_dGVzdHMvdGVzdC1wdWxsLWh0dHAudA== 100644 --- a/tests/test-pull-http.t +++ b/tests/test-pull-http.t @@ -29,12 +29,12 @@ $ cat errors.log $ req() { - > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log - > cat hg.pid >> $DAEMON_PIDS - > hg --cwd ../test pull http://localhost:$HGPORT/ - > kill `cat hg.pid` - > echo % serve errors - > cat errors.log + > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log + > cat hg.pid >> $DAEMON_PIDS + > hg --cwd ../test pull http://localhost:$HGPORT/ + > kill `cat hg.pid` + > echo % serve errors + > cat errors.log > } expect error, pulling not allowed diff --git a/tests/test-push-http.t b/tests/test-push-http.t index 6ab4a7d3c1791b2b7344854b22a6e94afa21481a_dGVzdHMvdGVzdC1wdXNoLWh0dHAudA==..4c4aeaab233905def16e69972567f01ed31936e0_dGVzdHMvdGVzdC1wdXNoLWh0dHAudA== 100644 --- a/tests/test-push-http.t +++ b/tests/test-push-http.t @@ -13,12 +13,12 @@ $ echo a >> a $ hg ci -mb $ req() { - > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log - > cat hg.pid >> $DAEMON_PIDS - > hg --cwd ../test2 push http://localhost:$HGPORT/ - > kill `cat hg.pid` - > echo % serve errors - > cat errors.log + > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log + > cat hg.pid >> $DAEMON_PIDS + > hg --cwd ../test2 push http://localhost:$HGPORT/ + > kill `cat hg.pid` + > echo % serve errors + > cat errors.log > } $ cd ../test diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t index 6ab4a7d3c1791b2b7344854b22a6e94afa21481a_dGVzdHMvdGVzdC1yZW5hbWUtbWVyZ2UyLnQ=..4c4aeaab233905def16e69972567f01ed31936e0_dGVzdHMvdGVzdC1yZW5hbWUtbWVyZ2UyLnQ= 100644 --- a/tests/test-rename-merge2.t +++ b/tests/test-rename-merge2.t @@ -66,8 +66,8 @@ > cp rev $1 > hg add $1 2> /dev/null > if [ "$2" != "" ] ; then - > cp rev $2 - > hg add $2 2> /dev/null + > cp rev $2 + > hg add $2 2> /dev/null > fi > } $ uc() { up $1; hg cp $1 $2; } # update + copy