Mercurial > evolve
annotate tests/testlib/push-checkheads-util.sh @ 6931:237f99ee3d64 stable
tests: remove leading spaces in `hg help` output, run only on Mercurial 6.9+
Core decided to remove a lot of leading spaces in docstrings to support Python
3.13, see 51057ab0dffa for details.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Mon, 11 Nov 2024 10:39:57 +0400 |
parents | d1a6d83a7109 |
children |
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 } |