annotate tests/testlib/push-checkheads-util.sh @ 6889:a66cf9008781

obslog: also display patch for rebased changesets This applies the same logic that is used for "merge-diff" to rebased changesets. The successors' content is compared to the content of the predecessors rebased in-memory on the new parents. This highlights the changes that were actually introduced while rebasing (like conflict resolution or API adjustment). As a side effect, obslog now also outputs slightly more diffs for splits, showing what parts of the original big changeset were moved to the smaller split components (but for now it only works for the first few changesets).
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 22 Sep 2024 02:58:54 +0200
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 }