source: trunk/test/repo_status_test.sh @ 1087

Last change on this file since 1087 was 978, checked in by Peter Johansson, 12 years ago

refs #429. Convert copyright statements to UTF-8

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1#!/bin/sh
2
3# $Id: repo_status_test.sh 978 2009-12-12 20:09:41Z peter $
4
5# Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
6# Copyright (C) 2009 Peter Johansson
7#
8# This file is part of svndigest, http://dev.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 3 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 svndigest. If not, see <http://www.gnu.org/licenses/>.
22
23required="wc"
24. ./init.sh
25
26set -e
27
28# assume test repository and svndigest repository are synchronized
29repository_status=1
30
31# retrieve last revision in test repository
32rev=`cat ${repo}/db/current`
33rev=${rev%% *}
34
35# check if the last test revision is a part of the svndigest repository
36status_return=`$SVN status -v ${repo}/db/revs/$rev`
37# logic: (file does not exist) || (file exists but not in revision control)
38if [[ ${#status_return} -eq 0 || ${status_return:0:1} = "?" ]]; then
39    repository_status=0
40    echo "ERROR: test repository and svndigest repository are not synchronized:"
41    echo "ERROR: test repository has entries not added to svndigest repository"
42    echo "ERROR:"
43    echo "ERROR: Please resolve issues before committing to svndigest repository"
44    echo "ERROR: test revision(s) needs to be added the svndigest repository."
45    echo "ERROR:"
46    echo "ERROR: Issue these commands:"
47fi
48
49# loop until a test repository revision that is a part of svndigest
50# repository is found, or break the test repository revision 0 is
51# reached.
52while [[ ${#status_return} -eq 0 || ${status_return:0:1} = "?" ]] && [ $rev -ge 0 ]; do
53    echo "ERROR:    svn add test/repo/db/revs/$rev test/repo/db/revprops/$rev"
54    let rev--
55    status_return=`$SVN status -v ${repo}/db/revs/$rev`
56done
57
58if [ $repository_status -eq 0 ]; then
59    exit_fail;    # test failed.
60fi
61
62exit_success
Note: See TracBrowser for help on using the repository browser.