Blame Scripts/Bash/Functions/Svn/svn.sh

4debce
#!/bin/bash
4debce
#
4debce
# svn.sh -- This function standardizes subversion tasks inside the
4debce
# repository.
4debce
#
4debce
# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project
4debce
#
4debce
# This program is free software; you can redistribute it and/or modify
4debce
# it under the terms of the GNU General Public License as published by
4debce
# the Free Software Foundation; either version 2 of the License, or (at
4debce
# your option) any later version.
4debce
#
4debce
# This program is distributed in the hope that it will be useful, but
4debce
# WITHOUT ANY WARRANTY; without even the implied warranty of
4debce
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4debce
# General Public License for more details.
4debce
#
4debce
# You should have received a copy of the GNU General Public License
4debce
# along with this program; if not, write to the Free Software
4debce
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
4debce
#
4debce
# ----------------------------------------------------------------------
4debce
# $Id$
4debce
# ----------------------------------------------------------------------
4debce
4debce
function svn {
4debce
384602
    local ACTIONNAM=''
384602
    local ACTIONNAMS=''
384602
    local ACTIONVAL=''
384602
384602
    # Define absolute path to Subversion command.
384602
    SVN=/usr/bin/svn
384602
d2147c
    # Interpret arguments and options passed through command-line.
d2147c
    svn_getOptions
d2147c
384602
    # Redefine positional parameters using ARGUMENTS. At this point,
384602
    # option arguments have been removed from ARGUMENTS variable and
384602
    # only non-option arguments remain in it. 
384602
    eval set -- "$ARGUMENTS"
384602
67fdb3
    # Don't realize action value verification here. There are actions
67fdb3
    # like `copy' and `rename' that require two arguments from which
67fdb3
    # the last one doesn't exist at the moment of executing the
67fdb3
    # command. This will provoke the second action value verification
67fdb3
    # to fail when indeed is should not. Thus, go to action names
67fdb3
    # processing directly.
67fdb3
67fdb3
    # Execute action names. This is required in order to realize
67fdb3
    # actions like copy and rename which need two values as argument.
67fdb3
    # Otherwise, it wouldn't be possible to execute them because
67fdb3
    # action values would be processed one a time. Thus, lets work
67fdb3
    # with `$@' instead.
67fdb3
    for ACTIONNAM in $ACTIONNAMS;do
67fdb3
        $ACTIONNAM "$@"
384602
    done
4debce
4debce
}