Blame Scripts/Functions/cli_syncroRepoChanges.sh

3071b7
#!/bin/bash
3071b7
#
3071b7
# cli_syncroRepoChanges.sh -- This function syncronizes both central
3071b7
# repository and working copy performing a subversion update command
3071b7
# first and a subversion commit command later.
3071b7
#
3071b7
# Copyright (C) 2009-2011 Alain Reguera Delgado
fa95b1
#
fa95b1
# This program is free software; you can redistribute it and/or modify
fa95b1
# it under the terms of the GNU General Public License as published by
fa95b1
# the Free Software Foundation; either version 2 of the License, or
fa95b1
# (at your option) any later version.
fa95b1
#
3071b7
# This program is distributed in the hope that it will be useful, but
3071b7
# WITHOUT ANY WARRANTY; without even the implied warranty of
3071b7
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3071b7
# General Public License for more details.
3071b7
#
3071b7
# You should have received a copy of the GNU General Public License
3071b7
# along with this program; if not, write to the Free Software
3071b7
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
3071b7
# USA.
3071b7
# ----------------------------------------------------------------------
3071b7
# $Id$
3071b7
# ----------------------------------------------------------------------
3071b7
3071b7
function cli_syncroRepoChanges {
3071b7
3071b7
    # Verify don't commit changes flag.
3071b7
    if [[ $FLAG_DONT_COMMIT_CHANGES != 'false' ]];then
3071b7
        return
3071b7
    fi
3071b7
3071b7
    # Define source location the subversion update action will take
3071b7
    # place on. If arguments are provided use them as srouce location.
3071b7
    # Otherwise use action value as default source location.
3071b7
    if [[ "$@" != '' ]];then
3071b7
        LOCATIONS="$@"
3071b7
    else
3071b7
        LOCATIONS="$ACTIONVAL"
3071b7
    fi
3071b7
3071b7
    # Bring changes from the repository into the working copy.
3071b7
    cli_updateRepoChanges "$LOCATIONS"
3071b7
3071b7
    # Check changes in the working copy.
3071b7
    cli_commitRepoChanges "$LOCATIONS"
3071b7
3071b7
}