source: trunk/test/repo_status_test.sh @ 955

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

closes #418

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