Follow upstream changes -- rest
[git-darcs-import.git] / tests / get_tag.sh
blobcbae56ff64814beca49b10554c465b58f2fc847b
1 #!/usr/bin/env bash
2 set -ev
4 rm -rf temp1 temp2
5 mkdir temp1
6 cd temp1
7 darcs initialize
8 echo ALL ignore-times >> _darcs/prefs/defaults
9 echo A > foo
10 darcs add foo
11 darcs record -a -m AA -A x
12 echo B > foo
13 darcs record -a -m BB -A x
14 echo C > foo
15 darcs record -a -m CC -A x
16 darcs tag -m 1.0 -A x
17 cp foo foo_version_1.0
18 echo D > foo
19 darcs record -a -m DD -A x
20 echo E > foo
21 darcs record -a -m EE -A x
22 echo F > foo
23 darcs record -a -m FF -A x
26 # Check that get store commuted patches
27 cd ..
28 darcs get --tag 1.0 --repo-name temp2 temp1
29 cmp temp2/foo temp1/foo_version_1.0
30 rm -rf temp1 temp2 temp3
32 mkdir temp1
33 cd temp1
34 darcs init
35 cat > file <<EOF
40 EOF
41 darcs rec -Ax -alm 'Add file'
42 cat > file <<EOF
46 EOF
47 darcs rec -Ax -alm 'Remove line 1'
48 cat > file <<EOF
51 EOF
52 darcs rec -Ax -alm 'Remove line 3'
53 cd ..
54 mkdir temp2
55 cd temp2
56 darcs init
57 echo y/n/y | tr / \\012 | darcs pull ../temp1
58 darcs tag -Ax -m Tag
59 darcs push -a ../temp1
60 cd ..
61 darcs get --tag=Tag temp1 temp3
62 cd temp3
63 darcs check
64 cd ..
65 rm -rf temp1 temp2 temp3
67 # Check that pending looks ok
68 mkdir temp1
69 cd temp1
70 darcs init
71 mkdir d
72 darcs add d
73 darcs rec -Ax -am 'add d'
74 darcs tag -Ax t
75 rmdir d
76 darcs rec -Ax -am 'rm d'
77 cd ..
78 darcs get --tag t temp1 temp2
79 cd temp2
80 if [ -f _darcs/patches/pending ]; then
81 if grep -v '^[{}]$' _darcs/patches/pending >/dev/null; then
82 cat _darcs/patches/pending
83 exit 1
86 cd ..
87 rm -rf temp1 temp2