annotate tests/test-check-commit.t @ 6935:954d7ea5cd67 stable tip

stack: when stack base is obsolete, pick any successor, even if at random There are situations when s0 is obsolete and we also cannot pick just one successor for it to use in stack. In such a case, let's pick the "latest" successor from the first set. We're assuming that obsutil.successorssets() returns data in the same order (it should, since it makes sure to sort data internally). Keeping that in mind, while the successor picked for s0 by this code is not based on any sort of sophisticated logic, it should nonetheless be the same every time. This patch is probably not going to completely break anything that was previously working fine, because the previous behavior was to just abort with an exception.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 16 Nov 2024 17:01:02 +0400
parents 03fe10eb9f2d
children 6859ed744625
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
6853
753e378208b7 tests: use testrepohg in test-check-commit.t
Anton Shestakov <av6@dwimlabs.net>
parents: 5652
diff changeset
3 $ . "$RUNTESTDIR/helpers-testrepo.sh"
753e378208b7 tests: use testrepohg in test-check-commit.t
Anton Shestakov <av6@dwimlabs.net>
parents: 5652
diff changeset
4
5652
ccde78088d0b tests: update the experimental.evolution=all comment
Anton Shestakov <av6@dwimlabs.net>
parents: 5651
diff changeset
5 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
6
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
7 $ 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
8 > [experimental]
c7abe71d749d tests: move experimental.evolution=all config option closer to the comment
Anton Shestakov <av6@dwimlabs.net>
parents: 2672
diff changeset
9 > evolution = all
2335
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
10 > EOF
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 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
13
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
14 $ cd $TESTDIR/..
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
15
6854
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
16 $ 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
17
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
18 $ 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
19 $ 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
20 $ 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
21 > 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
22 > 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
23 > "$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
24 > 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
25 > node="${f##*-}"
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
26 > 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
27 > echo '------------------------------------------------------'
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
28 > 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
29 > echo
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
30 > fi
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
31 > done
03fe10eb9f2d tests: update test-check-commit.t with changes from the upstream version
Anton Shestakov <av6@dwimlabs.net>
parents: 6853
diff changeset
32 > fi