source: trunk/test/check_repo_status.sh.in @ 738

Last change on this file since 738 was 738, checked in by Peter Johansson, 13 years ago

refs #355 - check_repo_status.sh is now skipped when not appropriate

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