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

Last change on this file since 693 was 693, checked in by Jari Häkkinen, 13 years ago

Fixes #339. Change to GPLv3.

  • 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 693 2008-09-11 20:42:56Z jari $
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
24# assume test repository and svndigest repository are synchronized
25repository_status=1
26
27# retrieve last revision in test repository
28rev=`cat @srcdir@/repo/db/current`
29rev=${rev%% *}
30
31# check if the last test revision is a part of the svndigest repository
32status_return=`svn status -v @srcdir@/repo/db/revs/$rev`
33# logic: (file does not exist) || (file exists but not in revision control)
34if [[ ${#status_return} -eq 0 || ${status_return:0:1} = "?" ]]; then
35    repository_status=0
36    echo "ERROR: test repository and svndigest repository are not synchronized:"
37    echo "ERROR: test repository has entries not added to svndigest repository"
38    echo "ERROR:"
39    echo "ERROR: Please resolve issues before committing to svndigest repository"
40    echo "ERROR: test revision(s) needs to be added the svndigest repository."
41    echo "ERROR:"
42    echo "ERROR: Issue these commands:"
43fi
44
45# loop until a test repository revision that is a part of svndigest
46# repository is found, or break the test repository revision 0 is
47# reached.
48while [[ ${#status_return} -eq 0 || ${status_return:0:1} = "?" ]] && [ $rev -ge 0 ]; do
49    echo "ERROR:    svn add test/repo/db/revs/$rev test/repo/db/revprops/$rev"
50    let rev--
51    status_return=`svn status -v @srcdir@/repo/db/revs/$rev`
52done
53
54if [ $repository_status -eq 0 ]; then
55    exit -1;    # test failed.
56fi
Note: See TracBrowser for help on using the repository browser.