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

Last change on this file since 568 was 568, checked in by Peter Johansson, 14 years ago

using AC_CONFIG_FILES to create shell scripts from *.in files.

  • 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 568 2008-03-12 22:08:49Z peter $
5
6# Copyright (C) 2007 Jari Häkkinen, Peter Johansson
7#
8# This file is part of svndigest, http://trac.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 2 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 this program; if not, write to the Free Software
22# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23# 02111-1307, USA.
24
25# assume test repository and svndigest repository are synchronized
26repository_status=1
27
28# retrieve last revision in test repository
29rev=`cat repo/db/current`
30rev=${rev%% *}
31
32# check if the last test revision is a part of the svndigest repository
33status_return=`svn status -v repo/db/revs/$rev`
34# logic: (file does not exist) || (file exists but not in revision control)
35if [[ ${#status_return} -eq 0 || ${status_return:0:1} = "?" ]]; then
36    repository_status=0
37    echo "ERROR: test repository and svndigest repository are not synchronized:"
38    echo "ERROR: test repository has entries not added to svndigest repository"
39    echo "ERROR:"
40    echo "ERROR: Please resolve issues before committing to svndigest repository"
41    echo "ERROR: test revision(s) needs to be added the svndigest repository."
42    echo "ERROR:"
43    echo "ERROR: Issue these commands:"
44fi
45
46# loop until a test repository revision that is a part of svndigest
47# repository is found, or break the test repository revision 0 is
48# reached.
49while [[ ${#status_return} -eq 0 || ${status_return:0:1} = "?" ]] && [ $rev -ge 0 ]; do
50    echo "ERROR:    svn add test/repo/db/revs/$rev test/repo/db/revprops/$rev"
51    let rev--
52    status_return=`svn status -v repo/db/revs/$rev`
53done
54
55if [ $repository_status -eq 0 ]; then
56    exit -1;    # test failed.
57fi
Note: See TracBrowser for help on using the repository browser.