-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathtest-svn.sh
executable file
·40 lines (26 loc) · 913 Bytes
/
test-svn.sh
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
#!/bin/bash
DIR="$( CDPATH='' cd -- "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
[ "$DIR" ] || exit
svn --help > /dev/null || { echo "Fail: could not find 'svn' executable"; exit 1; }
svnadmin --help > /dev/null || { echo "Fail: could not find 'svnadmin' executable"; exit 1; }
trap cleanup INT ERR
function cleanup() {
cd "$DIR/test-data" || exit
rm -rf proj proj-working svnrepo
}
set -eEx
cd test-data
mkdir -p proj/trunk
cp composer.from.json proj/trunk/composer.json
cp composer.from.lock proj/trunk/composer.lock
svnadmin create svnrepo
svn import ./proj file://$PWD/svnrepo -m "Initial commit"
svn checkout file://$PWD/svnrepo proj-working
cp composer.to.json proj-working/trunk/composer.json
cp composer.to.lock proj-working/trunk/composer.lock
cd proj-working/trunk
../../../composer-lock-diff
cd ..
../../composer-lock-diff -p trunk
cd ..
rm -rf proj proj-working svnrepo