1539 |
10 Oct 12 |
peter |
#!/bin/sh |
1539 |
10 Oct 12 |
peter |
2 |
|
1539 |
10 Oct 12 |
peter |
# $Id$ |
1539 |
10 Oct 12 |
peter |
4 |
|
1539 |
10 Oct 12 |
peter |
# Copyright (C) 2012 Peter Johansson |
1539 |
10 Oct 12 |
peter |
6 |
# |
1539 |
10 Oct 12 |
peter |
# This file is part of svndigest, http://dev.thep.lu.se/svndigest |
1539 |
10 Oct 12 |
peter |
8 |
# |
1539 |
10 Oct 12 |
peter |
# svndigest is free software; you can redistribute it and/or modify it |
1539 |
10 Oct 12 |
peter |
# under the terms of the GNU General Public License as published by |
1539 |
10 Oct 12 |
peter |
# the Free Software Foundation; either version 3 of the License, or |
1539 |
10 Oct 12 |
peter |
# (at your option) any later version. |
1539 |
10 Oct 12 |
peter |
13 |
# |
1539 |
10 Oct 12 |
peter |
# svndigest is distributed in the hope that it will be useful, but |
1539 |
10 Oct 12 |
peter |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
1539 |
10 Oct 12 |
peter |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1539 |
10 Oct 12 |
peter |
# General Public License for more details. |
1539 |
10 Oct 12 |
peter |
18 |
# |
1539 |
10 Oct 12 |
peter |
# You should have received a copy of the GNU General Public License |
1539 |
10 Oct 12 |
peter |
# along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
1539 |
10 Oct 12 |
peter |
21 |
|
1539 |
10 Oct 12 |
peter |
22 |
required="repo" |
1539 |
10 Oct 12 |
peter |
23 |
. test/init.sh || exit 99 |
1539 |
10 Oct 12 |
peter |
24 |
|
1539 |
10 Oct 12 |
peter |
25 |
targetdir=out |
1539 |
10 Oct 12 |
peter |
26 |
rm -rf out/* |
1539 |
10 Oct 12 |
peter |
27 |
$mkdir_p out |
1539 |
10 Oct 12 |
peter |
28 |
|
1539 |
10 Oct 12 |
peter |
# create a mixed revision wc |
1539 |
10 Oct 12 |
peter |
30 |
$SVN update -r 66 $rootdir || exit_fail |
1539 |
10 Oct 12 |
peter |
31 |
$SVN update -r 30 $rootdir/lib || exit_fail |
1539 |
10 Oct 12 |
peter |
32 |
|
1539 |
10 Oct 12 |
peter |
33 |
svnversion $rootdir |
1539 |
10 Oct 12 |
peter |
34 |
SVNDIGEST_run 0 -r $rootdir -t $targetdir --ignore-cache --format=none |
1539 |
10 Oct 12 |
peter |
35 |
test -e stderr || exit_fail |
1539 |
10 Oct 12 |
peter |
36 |
test -s stderr && exit_fail |
1539 |
10 Oct 12 |
peter |
37 |
|
1539 |
10 Oct 12 |
peter |
38 |
head $targetdir/toy_project/classic/all/total/bootstrap.html \ |
1539 |
10 Oct 12 |
peter |
39 |
| grep 'revision:' || exit_fail |
1539 |
10 Oct 12 |
peter |
40 |
|
1539 |
10 Oct 12 |
peter |
41 |
head $targetdir/toy_project/classic/all/total/index.html \ |
1539 |
10 Oct 12 |
peter |
42 |
| grep 'revision:' || exit_fail |
1539 |
10 Oct 12 |
peter |
43 |
|
1539 |
10 Oct 12 |
peter |
44 |
head $targetdir/toy_project/classic/all/total/bin/index.html \ |
1539 |
10 Oct 12 |
peter |
45 |
| grep 'revision:' || exit_fail |
1539 |
10 Oct 12 |
peter |
46 |
|
1539 |
10 Oct 12 |
peter |
# update lib to latest rev |
1539 |
10 Oct 12 |
peter |
48 |
$SVN update -r 71 $rootdir/lib/ |
1539 |
10 Oct 12 |
peter |
49 |
|
1539 |
10 Oct 12 |
peter |
50 |
svnversion $rootdir |
1539 |
10 Oct 12 |
peter |
# e expect files in lib to be reprinted as well lib and its mother |
1539 |
10 Oct 12 |
peter |
52 |
SVNDIGEST_run 0 -r $rootdir -t $targetdir --update --format=none |
1539 |
10 Oct 12 |
peter |
53 |
test -e stderr || exit_fail |
1539 |
10 Oct 12 |
peter |
54 |
test -s stderr && exit_fail |
1539 |
10 Oct 12 |
peter |
55 |
|
1539 |
10 Oct 12 |
peter |
56 |
grep '^Printing output for ' stdout || exit_fail |
1539 |
10 Oct 12 |
peter |
57 |
|
1539 |
10 Oct 12 |
peter |
58 |
grep '^Printing output for .*lib/Node.h' stdout || exit_fail |
1539 |
10 Oct 12 |
peter |
# lib/Node.cc hasn't been changed and shouldn't be printed again |
1539 |
10 Oct 12 |
peter |
60 |
grep '^Printing output for .*lib/Node.cc' stdout && exit_fail |
1539 |
10 Oct 12 |
peter |
61 |
|
1539 |
10 Oct 12 |
peter |
# directory bin hasn't changed and shouldn't... |
1539 |
10 Oct 12 |
peter |
63 |
grep '^Printing output for .*toy_project/bin' stdout && exit_fail |
1539 |
10 Oct 12 |
peter |
64 |
|
1539 |
10 Oct 12 |
peter |
65 |
grep '^Printing output.*toy_project/lib' stdout | grep -v 'lib/' || exit_fail |
1539 |
10 Oct 12 |
peter |
66 |
|
1539 |
10 Oct 12 |
peter |
67 |
head $targetdir/toy_project/classic/all/total/index.html \ |
1539 |
10 Oct 12 |
peter |
68 |
| grep 'revision:' | grep 66 || exit_fail |
1539 |
10 Oct 12 |
peter |
69 |
|
1539 |
10 Oct 12 |
peter |
70 |
head $targetdir/toy_project/classic/all/total/lib/index.html \ |
1539 |
10 Oct 12 |
peter |
71 |
| grep 'revision:' | grep 71 || exit_fail |
1539 |
10 Oct 12 |
peter |
72 |
|
1539 |
10 Oct 12 |
peter |
# update to revision 66 (but nothing changes) |
1539 |
10 Oct 12 |
peter |
74 |
$SVN update -r 71 $rootdir |
1539 |
10 Oct 12 |
peter |
75 |
|
1539 |
10 Oct 12 |
peter |
76 |
svnversion $rootdir |
1539 |
10 Oct 12 |
peter |
77 |
SVNDIGEST_run 0 -r $rootdir -t $targetdir --update --format=none |
1539 |
10 Oct 12 |
peter |
78 |
test -e stderr || exit_fail |
1539 |
10 Oct 12 |
peter |
79 |
test -s stderr && exit_fail |
1539 |
10 Oct 12 |
peter |
80 |
|
1539 |
10 Oct 12 |
peter |
# lib did not change in latest 'svn update' |
1539 |
10 Oct 12 |
peter |
82 |
grep '^Printing output for .*toy_project/lib' stdout && exit_fail |
1539 |
10 Oct 12 |
peter |
83 |
|
1539 |
10 Oct 12 |
peter |
84 |
grep '^Printing output for .*toy_project' stdout || exit_fail |
1539 |
10 Oct 12 |
peter |
85 |
|
1539 |
10 Oct 12 |
peter |
86 |
exit_success; |