annotate tests/test-check-commit.t @ 6920:df546ef8d75f mercurial-5.0

test-compat: merge mercurial-5.1 into mercurial-5.0
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 25 Oct 2024 18:11:50 +0400
parents 6859ed744625
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2335
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
1 #require test-repo
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
2
6692
cdf929e69cde test-compat: merge mercurial-5.2 into mercurial-5.1
Anton Shestakov <av6@dwimlabs.net>
parents: 5652
diff changeset
3 Mercurial 5.1 has a really outdated contrib/check-commit compared to the
cdf929e69cde test-compat: merge mercurial-5.2 into mercurial-5.1
Anton Shestakov <av6@dwimlabs.net>
parents: 5652
diff changeset
4 current commit and code standards in evolve
cdf929e69cde test-compat: merge mercurial-5.2 into mercurial-5.1
Anton Shestakov <av6@dwimlabs.net>
parents: 5652
diff changeset
5
cdf929e69cde test-compat: merge mercurial-5.2 into mercurial-5.1
Anton Shestakov <av6@dwimlabs.net>
parents: 5652
diff changeset
6 $ exit 80
cdf929e69cde test-compat: merge mercurial-5.2 into mercurial-5.1
Anton Shestakov <av6@dwimlabs.net>
parents: 5652
diff changeset
7
6853
753e378208b7 tests: use testrepohg in test-check-commit.t
Anton Shestakov <av6@dwimlabs.net>
parents: 5652
diff changeset
8 $ . "$RUNTESTDIR/helpers-testrepo.sh"
753e378208b7 tests: use testrepohg in test-check-commit.t
Anton Shestakov <av6@dwimlabs.net>
parents: 5652
diff changeset
9
5652
ccde78088d0b tests: update the experimental.evolution=all comment
Anton Shestakov <av6@dwimlabs.net>
parents: 5651
diff changeset
10 Enable obsolescence to avoid the warning issue when obsmarkers are found
2335
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
11
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
12 $ cat << EOF >> $HGRCPATH
5651
c7abe71d749d tests: move experimental.evolution=all config option closer to the comment
Anton Shestakov <av6@dwimlabs.net>
parents: 2672
diff changeset
13 > [experimental]
c7abe71d749d tests: move experimental.evolution=all config option closer to the comment
Anton Shestakov <av6@dwimlabs.net>
parents: 2672
diff changeset
14 > evolution = all
2335
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
15 > EOF
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
16
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
17 Go back in the hg repo
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
18
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
19 $ cd $TESTDIR/..
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
20
6854
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
21 $ REVSET='not public() and ::. and not desc("# no-check-commit")'
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
22
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
23 $ mkdir "$TESTTMP/p"
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
24 $ REVS=`testrepohg log -r "$REVSET" -T.`
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
25 $ if [ -n "$REVS" ] ; then
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
26 > testrepohg export --git -o "$TESTTMP/p/%n-%h" -r "$REVSET"
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
27 > for f in `ls "$TESTTMP/p"`; do
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
28 > "$RUNTESTDIR/../contrib/check-commit" < "$TESTTMP/p/$f" > "$TESTTMP/check-commit.out"
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
29 > if [ $? -ne 0 ]; then
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
30 > node="${f##*-}"
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
31 > echo "Revision $node does not comply with rules"
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
32 > echo '------------------------------------------------------'
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
33 > cat ${TESTTMP}/check-commit.out
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
34 > echo
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
35 > fi
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
36 > done
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
37 > fi