source: branches/0.7-stable/test/check_repo_status.sh.in @ 1082

Last change on this file since 1082 was 847, checked in by Peter Johansson, 12 years ago

updating copyrights

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1#!@SHELL@
2# @configure_input@
3
4# $Id: check_repo_status.sh.in 847 2009-11-17 01:38:52Z peter $
5
6# Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
7#
8# This file is part of svndigest, http://dev.thep.lu.se/svndigest
9#
10# svndigest is free software; you can redistribute it and/or modify it
11# under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 3 of the License, or
13# (at your option) any later version.
14#
15# svndigest is distributed in the hope that it will be useful, but
16# WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18# General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with svndigest. If not, see <http://www.gnu.org/licenses/>.
22
23wc_found="@wc_found@"
24if test $wc_found = "no"; then
25    exit 77;
26fi
27
28
29# assume test repository and svndigest repository are synchronized
30repository_status=1
31
32# retrieve last revision in test repository
33rev=`cat @srcdir@/repo/db/current`
34rev=${rev%% *}
35
36# check if the last test revision is a part of the svndigest repository
37status_return=`svn status -v @srcdir@/repo/db/revs/$rev`
38# logic: (file does not exist) || (file exists but not in revision control)
39if [[ ${#status_return} -eq 0 || ${status_return:0:1} = "?" ]]; then
40    repository_status=0
41    echo "ERROR: test repository and svndigest repository are not synchronized:"
42    echo "ERROR: test repository has entries not added to svndigest repository"
43    echo "ERROR:"
44    echo "ERROR: Please resolve issues before committing to svndigest repository"
45    echo "ERROR: test revision(s) needs to be added the svndigest repository."
46    echo "ERROR:"
47    echo "ERROR: Issue these commands:"
48fi
49
50# loop until a test repository revision that is a part of svndigest
51# repository is found, or break the test repository revision 0 is
52# reached.
53while [[ ${#status_return} -eq 0 || ${status_return:0:1} = "?" ]] && [ $rev -ge 0 ]; do
54    echo "ERROR:    svn add test/repo/db/revs/$rev test/repo/db/revprops/$rev"
55    let rev--
56    status_return=`svn status -v @srcdir@/repo/db/revs/$rev`
57done
58
59if [ $repository_status -eq 0 ]; then
60    exit -1;    # test failed.
61fi
Note: See TracBrowser for help on using the repository browser.