contrib/merge-test-compat.sh
author Pulkit Goyal <7895pulkit@gmail.com>
Thu, 28 Dec 2017 03:12:54 +0530
branchstable
changeset 3362 92b414710d2e
parent 3133 13a4c35f7a0b
child 5080 6db9e2350948
permissions -rwxr-xr-x
prev: jump to parent's successor if parent is obsolete and topic is involved `hg stack` shows a linear chain of commits even when they are not linear chain and some changesets are obsoleted and have successors as separate head. This is very nice to have a post evolution view of the stack. However when `hg prev` is run on an unstable changeset whose parent is obsolete and does not topic but parents successor has the topic, it shows no parent on the topic. This patch makes `hg prev` update to parent's successor and make things follow the stack order.

#!/bin/bash
set -euox pipefail

unset GREP_OPTIONS
NOTOPIC="--config experimental.topic-mode=ignore"

compatbranches=`hg branches --quiet | grep 'mercurial-' | grep -v ':' | sort -n --reverse`
prev='stable'
for branch in $compatbranches; do
    hg up $branch
    hg merge $prev
    hg commit -m "test-compat: merge $prev into $branch"
    prev=$branch
done