File: clean-command.sh

package info (click to toggle)
darcs 2.18.4-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 5,960 kB
  • sloc: haskell: 47,748; sh: 13,466; ansic: 447; perl: 134; makefile: 8
file content (66 lines) | stat: -rw-r--r-- 1,290 bytes parent folder | download
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
#!/usr/bin/env bash
# Tests for the clean / revert -l command

. lib

rm -rf R
darcs init R
cd R

create_stuff () {
  rm -rf unadded unadded-dir unadded-dir-with-boring boring.o CVS

  # non-boring stuff
  echo content > unadded
  mkdir unadded-dir
  echo content > unadded-dir/unadded
  mkdir unadded-dir-with-boring
  echo content > unadded-dir-with-boring/unadded

  # boring stuff
  echo content > boring.o
  mkdir CVS
  echo content > CVS/also-considered-boring
  echo content > CVS/boring.o
  echo content > unadded-dir-with-boring/boring.o
}

test_nonboring () {
  # test that non-boring stuff is gone
  not ls unadded
  not ls unadded-dir
  not ls unadded-dir-with-boring/unadded
  # non-boring file under boring dir is still considered non-boring
  not ls CVS/unadded

  # test that boring stuff is unchanged
  diff unadded-dir-with-boring/boring.o <(echo content)
  diff boring.o <(echo content)
  diff CVS/boring.o <(echo content)
}

test_boring () {
  not ls unadded
  not ls unadded-dir
  not ls unadded-dir-with-boring
  not ls boring.o
  not ls CVS
}

create_stuff
darcs clean -a
test_nonboring

create_stuff
darcs revert -l -a
test_nonboring

create_stuff
darcs clean --boring -a
test_boring

create_stuff
# error: conflicting options
not darcs revert -l --boring -a

cd ..