comparison tests/test-check-tag.t @ 6836:0a1ed671eb7a

tests: use testrepohg in test-check-tag.t testrepohg is required if you want it to read ~/.hgrc. Important if the CI user is not root, but needs to trust root hgrc files.
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 02 Aug 2024 16:36:40 +0400
parents aa51f19c71f6
children
comparison
equal deleted inserted replaced
6835:89349d870f6b 6836:0a1ed671eb7a
1 #require test-repo 1 #require test-repo
2 2
3 Enable obsolescence to avoid the warning issue when obsmarkers are found 3 Enable obsolescence to avoid the warning issue when obsmarkers are found
4 4
5 $ cat << EOF >> $HGRCPATH 5 $ . "$RUNTESTDIR/helpers-testrepo.sh"
6 > [experimental]
7 > evolution = all
8 > EOF
9 6
10 $ cd "$TESTDIR"/.. 7 $ cd "$TESTDIR"/..
11 8
12 Checking all non-public tagged revisions up to the current commit, see our 9 Checking all non-public tagged revisions up to the current commit, see our
13 release checklist for more ideas 10 release checklist for more ideas
14 11
15 $ for node in `hg log --rev 'tag() and ::. and not public() and not desc("# no-check-commit")' --template '{node|short}\n'`; do 12 $ for node in `testrepohg log --rev 'tag() and ::. and not public() and not desc("# no-check-commit")' --template '{node|short}\n'`; do
16 > tags=`hg log --rev $node --template '{tags}\n'` 13 > tags=`testrepohg log --rev $node --template '{tags}\n'`
17 > if echo "$tags" | grep -q ' '; then 14 > if echo "$tags" | grep -q ' '; then
18 > echo "Revision $node is tagged multiple times: $tags" 15 > echo "Revision $node is tagged multiple times: $tags"
19 > fi 16 > fi
20 > branch=`hg log --rev $node --template '{branch}\n'` 17 > branch=`testrepohg log --rev $node --template '{branch}\n'`
21 > if [ "$branch" != "stable" ]; then 18 > if [ "$branch" != "stable" ]; then
22 > echo "Revision $node is not on stable branch: $branch" 19 > echo "Revision $node is not on stable branch: $branch"
23 > fi 20 > fi
24 > # Here we skip: 21 > # Here we skip:
25 > # - pullbundle because it usually has no changes (so no version bump) 22 > # - pullbundle because it usually has no changes (so no version bump)
26 > if hg grep --rev $node '^__version__ = .*\.dev' hgext3rd/evolve/ hgext3rd/topic/; then 23 > if testrepohg grep --rev $node '^__version__ = .*\.dev' hgext3rd/evolve/ hgext3rd/topic/; then
27 > echo "Versions should not end with .dev at tagged revision $node" 24 > echo "Versions should not end with .dev at tagged revision $node"
28 > fi 25 > fi
29 > entry=`hg cat --rev $node CHANGELOG | grep -F "$tags"` 26 > entry=`testrepohg cat --rev $node CHANGELOG | grep -F "$tags"`
30 > if [ -z "$entry" ]; then 27 > if [ -z "$entry" ]; then
31 > echo "Revision $node has no CHANGELOG entry for $tags" 28 > echo "Revision $node has no CHANGELOG entry for $tags"
32 > fi 29 > fi
33 > if echo "$entry" | grep -E -vq ' -- [0-9]{4}-[0-9]{2}-[0-9]{2}'; then 30 > if echo "$entry" | grep -E -vq ' -- [0-9]{4}-[0-9]{2}-[0-9]{2}'; then
34 > echo "CHANGELOG entry for $tags should have a date in YYYY-MM-DD format: $entry" 31 > echo "CHANGELOG entry for $tags should have a date in YYYY-MM-DD format: $entry"
35 > fi 32 > fi
36 > entry=`hg cat --rev $node debian/changelog | grep -F "$tags"` 33 > entry=`testrepohg cat --rev $node debian/changelog | grep -F "$tags"`
37 > if [ -z "$entry" ]; then 34 > if [ -z "$entry" ]; then
38 > echo "Revision $node has no debian/changelog entry for $tags" 35 > echo "Revision $node has no debian/changelog entry for $tags"
39 > fi 36 > fi
40 > done 37 > done