1 | #!/bin/sh |
---|
2 | # |
---|
3 | # mailer-init.sh: create and initialize a repository for the mailer tests |
---|
4 | # |
---|
5 | # USAGE: ./mailer-init.sh |
---|
6 | # |
---|
7 | |
---|
8 | scripts="`dirname $0`" |
---|
9 | scripts="`cd $scripts && pwd`" |
---|
10 | |
---|
11 | d=$scripts/mailer-init.$$ |
---|
12 | mkdir $d |
---|
13 | cd $d |
---|
14 | echo "test directory is: $d" |
---|
15 | |
---|
16 | svnadmin create repos |
---|
17 | svn co file://`pwd`/repos wc |
---|
18 | cd wc |
---|
19 | |
---|
20 | # create a bunch of dirs and files |
---|
21 | mkdir dir1 dir2 |
---|
22 | echo file1 > file1 |
---|
23 | echo file2 > file2 |
---|
24 | echo file3 > dir1/file3 |
---|
25 | echo file4 > dir1/file4 |
---|
26 | echo file5 > dir2/file5 |
---|
27 | echo file6 > dir2/file6 |
---|
28 | svn add * |
---|
29 | svn commit -m "initial load" |
---|
30 | |
---|
31 | # make some changes and set some properties |
---|
32 | svn ps prop1 propval1 file1 |
---|
33 | echo change C1 >> file2 |
---|
34 | svn ps svn:keywords Id file2 |
---|
35 | svn ps svn:new_svn_prop val file2 |
---|
36 | svn ps prop1 propval1 file2 |
---|
37 | svn ps prop3 propval3 dir1 |
---|
38 | echo change C2 >> dir2/file5 |
---|
39 | svn commit -m "two file changes" |
---|
40 | |
---|
41 | # copy a file and a dir and change property |
---|
42 | svn cp file1 dir2/file7 |
---|
43 | svn cp dir1 dir3 |
---|
44 | svn ps prop3 propval4 dir3 |
---|
45 | svn commit -m "two copies" |
---|
46 | |
---|
47 | # copy and modify a file |
---|
48 | svn cp file1 dir3/file8 |
---|
49 | echo change C3 >> dir3/file8 |
---|
50 | svn commit -m "copied and changed" |
---|
51 | |
---|
52 | # change and delete properties |
---|
53 | svn ps svn:keywords Date file2 |
---|
54 | svn ps prop2 propval2 file2 |
---|
55 | svn pd prop1 file2 |
---|
56 | svn pd svn:new_svn_prop file2 |
---|
57 | svn ps prop3 propval4 dir1 |
---|
58 | svn pd prop3 dir3 |
---|
59 | svn up # make sure our dirs are up to date |
---|
60 | svn commit -m "changes and deletes of properties" |
---|
61 | |
---|
62 | # add a file, add a dir, and make a change |
---|
63 | echo file9 > file9 |
---|
64 | svn add file9 |
---|
65 | svn mkdir dir4 |
---|
66 | echo change C4 >> dir1/file3 |
---|
67 | svn commit -m "mixed addition and change" |
---|
68 | |
---|
69 | # add a file, add a dir, delete a file, delete a dir, and make a change |
---|
70 | echo file10 > dir1/file10 |
---|
71 | svn add dir1/file10 |
---|
72 | svn mkdir dir3/dir5 |
---|
73 | svn rm file2 dir2 |
---|
74 | echo change C5 >> dir3/file3 |
---|
75 | svn up # make sure our dirs are up to date |
---|
76 | svn commit -m "adds, deletes, and a change" |
---|
77 | |
---|
78 | # copy a dir and change a file in it |
---|
79 | svn cp dir3 dir6 |
---|
80 | echo change C6 >> dir6/file4 |
---|
81 | svn commit -m "copy dir, then make a change" |
---|
82 | |
---|
83 | # add a binary file and set property to binary value |
---|
84 | echo -e "\x00\x01\x02\x03\x04" > file11 |
---|
85 | svn add file11 |
---|
86 | svn ps prop2 -F file11 file9 |
---|
87 | svn commit -m "add binary file" |
---|
88 | |
---|
89 | # change the binary file and set property to non binary value |
---|
90 | echo -e "\x20\x01\x02\x20" > file11 |
---|
91 | svn ps prop2 propval2 file9 |
---|
92 | svn commit -m "change binary file" |
---|
93 | |
---|
94 | # tweak the commit dates to known quantities |
---|
95 | $scripts/mailer-tweak.py ../repos |
---|