tests/test-mq-strip
author Steve Borho <steve@borho.org>
Mon, 15 Feb 2010 21:18:16 -0600
branchstable
changeset 10486 6b354a763617
parent 8452 cb93eee1fbcd
child 11200 12e5149cafca
permissions -rwxr-xr-x
mergetools: improve configuration for several merge tools * meld - provide labels for the three panes * diffmerge - add registry key for detection, improve arguments * beyond compare - add linux version * winmerge - improve arguments * araxis - add configuration, including registry key for detection * misc - provide default priorities for more tools

#!/bin/sh

echo "[extensions]" >> $HGRCPATH
echo "mq=" >> $HGRCPATH

teststrip() {
    hg up -C $1
    echo % before update $1, strip $2
    hg parents
    hg strip $2 2>&1 | sed 's/\(saving bundle to \).*/\1/'
    echo % after update $1, strip $2
    hg parents
    hg unbundle -q .hg/strip-backup/*
    rm .hg/strip-backup/*
}

hg init test
cd test

echo foo > bar
hg ci -Ama

echo more >> bar
hg ci -Amb

echo blah >> bar
hg ci -Amc

hg up 1
echo blah >> bar
hg ci -Amd

echo final >> bar
hg ci -Ame

hg log

teststrip 4 4
teststrip 4 3
teststrip 1 4
teststrip 4 2
teststrip 4 1
teststrip null 4

hg log

hg up -C 2
hg merge 4
echo % before strip of merge parent
hg parents
hg strip 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
echo % after strip of merge parent
hg parents