2017-01-25 16:39:17 +03:00
|
|
|
#require test-repo
|
|
|
|
|
|
|
|
$ . "$TESTDIR/helpers-testrepo.sh"
|
|
|
|
|
|
|
|
$ cat <<'EOF' > scanhelptopics.py
|
|
|
|
> from __future__ import absolute_import, print_function
|
|
|
|
> import re
|
|
|
|
> import sys
|
2017-03-19 21:42:45 +03:00
|
|
|
> if sys.platform == "win32":
|
|
|
|
> import os, msvcrt
|
|
|
|
> msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
|
2017-01-25 16:39:17 +03:00
|
|
|
> topics = set()
|
|
|
|
> topicre = re.compile(r':hg:`help ([a-z0-9\-.]+)`')
|
|
|
|
> for fname in sys.argv:
|
|
|
|
> with open(fname) as f:
|
|
|
|
> topics.update(m.group(1) for m in topicre.finditer(f.read()))
|
|
|
|
> for s in sorted(topics):
|
|
|
|
> print(s)
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
$ cd "$TESTDIR"/..
|
|
|
|
|
|
|
|
Check if ":hg:`help TOPIC`" is valid:
|
|
|
|
(use "xargs -n1 -t" to see which help commands are executed)
|
|
|
|
|
2018-07-07 03:13:22 +03:00
|
|
|
$ NPROC=`python -c 'import multiprocessing; print(multiprocessing.cpu_count())'`
|
2017-07-02 07:14:20 +03:00
|
|
|
$ testrepohg files 'glob:{hgdemandimport,hgext,mercurial}/**/*.py' \
|
2017-06-28 03:24:31 +03:00
|
|
|
> | sed 's|\\|/|g' \
|
2018-07-26 02:34:49 +03:00
|
|
|
> | xargs $PYTHON "$TESTTMP/scanhelptopics.py" > $TESTTMP/topics
|
2018-07-10 03:55:01 +03:00
|
|
|
|
|
|
|
Remove subversion from the list; it does not work on macOS and casuses this test
|
|
|
|
to print errors.
|
2018-07-26 02:34:49 +03:00
|
|
|
$ grep -v subversion $TESTTMP/topics > $TESTTMP/topics_filtered
|
|
|
|
$ cat $TESTTMP/topics_filtered | xargs -n1 -P $NPROC hg --cwd / help >/dev/null 2>$TESTTMP/results
|
2018-07-10 03:55:01 +03:00
|
|
|
$ sort $TESTTMP/results
|