Follow upstream changes -- Bytestring updates
[git-darcs-import.git] / tests / rmdir.sh
blob88c3cf45a85b9c63992a72547015f84daa564df5
1 #!/usr/bin/env bash
2 set -ev
4 rm -rf temp1 temp2 temp3
6 # initialise temp1
7 mkdir temp1
8 cd temp1
9 darcs initialize
10 mkdir foo
11 echo hello world > foo/bar
12 darcs add foo foo/bar
13 darcs record -a -m add
14 cd ..
16 # get temp1 into temp2
17 darcs get temp1 temp2
18 cd temp2
19 echo hello world > foo/baz
20 cd ..
22 # remove a directory from temp1 and record
23 cd temp1
24 rm -rf foo
25 darcs record -a -m del
26 cd ..
28 cd temp2
29 test -e foo/baz
30 test -e foo/bar
31 test -d foo
33 darcs show files --no-pending --no-dir >> files
34 grep foo/bar files
35 darcs show files --no-pending --no-fil >> dirs
36 grep foo dirs
37 cd ..
39 darcs pull -a --repodir=temp2 > pullresult
40 cat pullresult
41 grep 'Warning: .ot deleting' pullresult
43 # get temp1 into temp3
44 darcs get temp1 temp3
45 cd temp3
46 darcs obliterate --last 1 -a
47 echo hello world > foo/baz
48 cd ..
50 # remove a directory from temp1 and record
51 cd temp1
52 rm -rf foo
53 darcs record -a -m del
54 cd ..
56 cd temp3
57 test -e foo/baz
58 test -e foo/bar
59 test -d foo
61 darcs show files --no-pending --no-dir >> files
62 grep foo/bar files
63 darcs show files --no-pending --no-fil >> dirs
64 grep foo dirs
65 cd ..
67 darcs pull -q -a --repodir=temp3 > pullresult
68 cat pullresult
69 test ! -s pullresult
71 rm -rf temp1 temp2 temp3