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

Last change on this file since 444 was 439, checked in by Peter Johansson, 16 years ago

Merged patch release 0.6.1 to the trunk. Delta 0.6.1 - 0.6

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