1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#!/bin/sh
#
# Copyright (c) 2009 David Kågedal
#
test_description='Exercise pushing patches with --set-tree.'
. ./test-lib.sh
test_expect_success \
'Create initial patches' '
stg init &&
stg new A -m A &&
echo hello world > a &&
stg add a &&
stg refresh
stg new B -m B &&
echo HELLO WORLD > a &&
stg refresh
'
test_expect_success \
'Back up and create a partial patch' '
stg pop &&
stg new C -m C &&
echo hello WORLD > a &&
stg refresh
'
test_expect_success \
'Reapply patch B' '
stg push --set-tree B
'
test_expect_success \
'Compare results' '
stg pop -a &&
stg push &&
test "$(echo $(cat a))" = "hello world" &&
stg push &&
test "$(echo $(cat a))" = "hello WORLD" &&
stg push &&
test "$(echo $(cat a))" = "HELLO WORLD"
'
test_done
|