File: t1207-push-tree.sh

package info (click to toggle)
stgit 0.19-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,748 kB
  • sloc: python: 10,558; sh: 5,739; lisp: 2,678; makefile: 142; perl: 42
file content (46 lines) | stat: -rwxr-xr-x 838 bytes parent folder | download | duplicates (5)
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