annotate tests/testlib/push-checkheads-util.sh @ 6913:3c5966b42c21 mercurial-5.7

test-compat: merge mercurial-5.8 into mercurial-5.7
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 25 Oct 2024 16:31:50 +0400
parents d1a6d83a7109
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2119
diff changeset
1 # setup config and various utility to test new heads checks on push
2119
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
2
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
3 . $TESTDIR/testlib/common.sh
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
4
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
5 cat >> $HGRCPATH <<EOF
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
6 [ui]
6260
d1a6d83a7109 tests: use {fqbn} in push-checkheads-util.sh log template
Anton Shestakov <av6@dwimlabs.net>
parents: 6259
diff changeset
7 logtemplate = "{node|short} [{if(topic, fqbn, branch)}] ({phase}): {desc}\n"
2119
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
8
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
9 [phases]
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2119
diff changeset
10 # non publishing server
6260
d1a6d83a7109 tests: use {fqbn} in push-checkheads-util.sh log template
Anton Shestakov <av6@dwimlabs.net>
parents: 6259
diff changeset
11 publish = False
2119
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
12
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
13 [extensions]
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2119
diff changeset
14 # we need to strip some changeset for some test cases
6260
d1a6d83a7109 tests: use {fqbn} in push-checkheads-util.sh log template
Anton Shestakov <av6@dwimlabs.net>
parents: 6259
diff changeset
15 strip =
d1a6d83a7109 tests: use {fqbn} in push-checkheads-util.sh log template
Anton Shestakov <av6@dwimlabs.net>
parents: 6259
diff changeset
16 evolve =
2119
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
17 EOF
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
18
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
19 setuprepos() {
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
20 echo creating basic server and client repo
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
21 hg init server
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
22 cd server
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
23 mkcommit root
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
24 hg phase --public .
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
25 mkcommit A0
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2119
diff changeset
26 cd ..
2119
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
27 hg clone server client
5227
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5224
diff changeset
28
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5224
diff changeset
29 if [ "$1" = "single-head" ]; then
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5224
diff changeset
30 echo >> "server/.hg/hgrc" "[experimental]"
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5224
diff changeset
31 echo >> "server/.hg/hgrc" "# enforce a single name per branch"
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5224
diff changeset
32 echo >> "server/.hg/hgrc" "single-head-per-branch = yes"
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5224
diff changeset
33 fi
2119
e1c26c632b6d tests: adds simple test case for heads checking
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
34 }