Mercurial > evolve
comparison contrib/merge-test-compat.sh @ 5081:17fac26833da stable
contrib: make merge-test-compat.sh more topic-friendly
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 23 Jan 2020 11:01:46 +0100 |
parents | 6db9e2350948 |
children |
comparison
equal
deleted
inserted
replaced
5080:6db9e2350948 | 5081:17fac26833da |
---|---|
3 | 3 |
4 unset GREP_OPTIONS | 4 unset GREP_OPTIONS |
5 | 5 |
6 compatbranches=$(hg branches --quiet | grep 'mercurial-' | grep -v ':' | sort -n --reverse) | 6 compatbranches=$(hg branches --quiet | grep 'mercurial-' | grep -v ':' | sort -n --reverse) |
7 prev='stable' | 7 prev='stable' |
8 topic=${1:-'test-compat'} | |
8 for branch in $compatbranches; do | 9 for branch in $compatbranches; do |
9 hg up "$branch" | 10 # Logic in the revsets below: |
10 hg merge "$prev" | 11 # 1. There is target topic on stable or compatibility branch: merge all |
12 # those commits, they are related to our work and need to pass tests on all | |
13 # compatibility branches. | |
14 # 2. There is no target topic: avoid any commits that have topic set, they | |
15 # are definitely unrelated to what we're doing. | |
16 # In other words, if you want to test certain commits, assign them all to | |
17 # one topic and provide that topic as the first argument to this script. | |
18 uptarget="first(max(branch('$branch') and topic('$topic')) or max(branch('$branch') and not topic()))" | |
19 hg up -r "$uptarget" | |
20 hg topic "$topic" | |
21 mergetarget="first(max(branch('$prev') and topic('$topic')) or max(branch('$prev') and not topic()))" | |
22 hg merge -r "$mergetarget" | |
11 hg commit -m "test-compat: merge $prev into $branch" | 23 hg commit -m "test-compat: merge $prev into $branch" |
12 prev=$branch | 24 prev=$branch |
13 done | 25 done |