source: branches/0.6-stable/test/check_repo_status.sh.in @ 764

Last change on this file since 764 was 731, checked in by Peter Johansson, 15 years ago

update copyright statements

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