File: rmdir.sh

package info (click to toggle)
darcs 2.0.2-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,400 kB
  • ctags: 1,048
  • sloc: haskell: 24,937; perl: 9,736; sh: 3,369; ansic: 1,913; makefile: 17; xml: 14
file content (71 lines) | stat: -rw-r--r-- 1,177 bytes parent folder | download | duplicates (2)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
set -ev

rm -rf temp1 temp2 temp3

# initialise temp1
mkdir temp1
cd temp1
darcs initialize
mkdir foo
echo hello world > foo/bar
darcs add foo foo/bar
darcs record -a -m add
cd ..

# get temp1 into temp2
darcs get temp1 temp2
cd temp2
echo hello world > foo/baz
cd ..

# remove a directory from temp1 and record
cd temp1
rm -rf foo
darcs record -a -m del
cd ..

cd temp2
test -e foo/baz
test -e foo/bar
test -d foo

darcs show files --no-pending --no-dir >> files
grep foo/bar files
darcs show files --no-pending --no-fil >> dirs
grep foo dirs
cd ..

darcs pull -a --repodir=temp2 > pullresult
cat pullresult
grep 'Warning: .ot deleting' pullresult

# get temp1 into temp3
darcs get temp1 temp3
cd temp3
darcs obliterate --last 1 -a
echo hello world > foo/baz
cd ..

# remove a directory from temp1 and record
cd temp1
rm -rf foo
darcs record -a -m del
cd ..

cd temp3
test -e foo/baz
test -e foo/bar
test -d foo

darcs show files --no-pending --no-dir >> files
grep foo/bar files
darcs show files --no-pending --no-fil >> dirs
grep foo dirs
cd ..

darcs pull -q -a --repodir=temp3 > pullresult
cat pullresult
test ! -s pullresult

rm -rf temp1 temp2 temp3