955 |
06 Dec 09 |
peter |
#!/bin/sh |
568 |
12 Mar 08 |
peter |
2 |
|
328 |
18 May 07 |
jari |
# $Id$ |
328 |
18 May 07 |
jari |
4 |
|
978 |
12 Dec 09 |
peter |
# Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson |
1635 |
30 Mar 23 |
peter |
# Copyright (C) 2009, 2012, 2020 Peter Johansson |
328 |
18 May 07 |
jari |
7 |
# |
687 |
04 Aug 08 |
peter |
# This file is part of svndigest, http://dev.thep.lu.se/svndigest |
328 |
18 May 07 |
jari |
9 |
# |
328 |
18 May 07 |
jari |
# svndigest is free software; you can redistribute it and/or modify it |
328 |
18 May 07 |
jari |
# under the terms of the GNU General Public License as published by |
693 |
11 Sep 08 |
jari |
# the Free Software Foundation; either version 3 of the License, or |
328 |
18 May 07 |
jari |
# (at your option) any later version. |
328 |
18 May 07 |
jari |
14 |
# |
328 |
18 May 07 |
jari |
# svndigest is distributed in the hope that it will be useful, but |
328 |
18 May 07 |
jari |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
328 |
18 May 07 |
jari |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
328 |
18 May 07 |
jari |
# General Public License for more details. |
328 |
18 May 07 |
jari |
19 |
# |
328 |
18 May 07 |
jari |
# You should have received a copy of the GNU General Public License |
693 |
11 Sep 08 |
jari |
# along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
328 |
18 May 07 |
jari |
22 |
|
952 |
06 Dec 09 |
peter |
23 |
required="wc" |
1525 |
01 Oct 12 |
peter |
24 |
. test/init.sh || exit 99 |
738 |
15 Dec 08 |
peter |
25 |
|
952 |
06 Dec 09 |
peter |
26 |
set -e |
738 |
15 Dec 08 |
peter |
27 |
|
328 |
18 May 07 |
jari |
# assume test repository and svndigest repository are synchronized |
328 |
18 May 07 |
jari |
29 |
repository_status=1 |
328 |
18 May 07 |
jari |
30 |
|
328 |
18 May 07 |
jari |
# retrieve last revision in test repository |
952 |
06 Dec 09 |
peter |
32 |
rev=`cat ${repo}/db/current` |
328 |
18 May 07 |
jari |
33 |
rev=${rev%% *} |
328 |
18 May 07 |
jari |
34 |
|
328 |
18 May 07 |
jari |
# check if the last test revision is a part of the svndigest repository |
952 |
06 Dec 09 |
peter |
36 |
status_return=`$SVN status -v ${repo}/db/revs/$rev` |
1608 |
14 Jul 20 |
peter |
37 |
echo "status_return:$status_return" |
328 |
18 May 07 |
jari |
# logic: (file does not exist) || (file exists but not in revision control) |
1608 |
14 Jul 20 |
peter |
39 |
if test x"${status_return}" = x"" || echo "${status_return}" | $GREP -q '^?'; then |
328 |
18 May 07 |
jari |
40 |
repository_status=0 |
328 |
18 May 07 |
jari |
41 |
echo "ERROR: test repository and svndigest repository are not synchronized:" |
328 |
18 May 07 |
jari |
42 |
echo "ERROR: test repository has entries not added to svndigest repository" |
328 |
18 May 07 |
jari |
43 |
echo "ERROR:" |
328 |
18 May 07 |
jari |
44 |
echo "ERROR: Please resolve issues before committing to svndigest repository" |
328 |
18 May 07 |
jari |
45 |
echo "ERROR: test revision(s) needs to be added the svndigest repository." |
328 |
18 May 07 |
jari |
46 |
echo "ERROR:" |
328 |
18 May 07 |
jari |
47 |
echo "ERROR: Issue these commands:" |
328 |
18 May 07 |
jari |
48 |
fi |
328 |
18 May 07 |
jari |
49 |
|
328 |
18 May 07 |
jari |
# loop until a test repository revision that is a part of svndigest |
328 |
18 May 07 |
jari |
# repository is found, or break the test repository revision 0 is |
328 |
18 May 07 |
jari |
# reached. |
1608 |
14 Jul 20 |
peter |
53 |
while {test x"${status_return}" = x"" || echo "${status_return}" | $GREP -q '^?'} && test $rev -ge 0; do |
328 |
18 May 07 |
jari |
54 |
echo "ERROR: svn add test/repo/db/revs/$rev test/repo/db/revprops/$rev" |
328 |
18 May 07 |
jari |
55 |
let rev-- |
952 |
06 Dec 09 |
peter |
56 |
status_return=`$SVN status -v ${repo}/db/revs/$rev` |
328 |
18 May 07 |
jari |
57 |
done |
328 |
18 May 07 |
jari |
58 |
|
328 |
18 May 07 |
jari |
59 |
if [ $repository_status -eq 0 ]; then |
952 |
06 Dec 09 |
peter |
60 |
exit_fail; # test failed. |
328 |
18 May 07 |
jari |
61 |
fi |
952 |
06 Dec 09 |
peter |
62 |
|
1608 |
14 Jul 20 |
peter |
63 |
exit_success |