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

e27e10
#!/bin/bash
e27e10
#
e27e10
# svn_copyRepoFile.sh -- This function standardizes the way files
e27e10
# (including directories) are duplicated inside the working copy. This
e27e10
# function is an interface for subversion's `copy' command.
e27e10
#
e27e10
# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project
e27e10
#
e27e10
# This program is free software; you can redistribute it and/or modify
e27e10
# it under the terms of the GNU General Public License as published by
e27e10
# the Free Software Foundation; either version 2 of the License, or (at
e27e10
# your option) any later version.
e27e10
#
e27e10
# This program is distributed in the hope that it will be useful, but
e27e10
# WITHOUT ANY WARRANTY; without even the implied warranty of
e27e10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
e27e10
# General Public License for more details.
e27e10
#
e27e10
# You should have received a copy of the GNU General Public License
e27e10
# along with this program; if not, write to the Free Software
e27e10
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
e27e10
#
e27e10
# ----------------------------------------------------------------------
e27e10
# $Id$
e27e10
# ----------------------------------------------------------------------
e27e10
e27e10
function svn_copyRepoFile {
e27e10
e27e10
    local SOURCE=$(cli_checkRepoDirSource ${1})
e27e10
    local TARGET=$(cli_checkRepoDirSource ${2})
e27e10
e27e10
    # Verify source location absolute path. It should point either to
e27e10
    # existent files or directories both under version control inside
e27e10
    # the working copy.  Otherwise, if it doesn't point to an existent
e27e10
    # file under version control, finish the script execution with an
e27e10
    # error message.
e27e10
    cli_checkFiles ${SOURCE} -e --is-versioned
e27e10
e27e10
    # Print action reference.
e27e10
    cli_printMessage "${TARGET}" --as-creating-line
e27e10
e27e10
    # Copy source location to its target using version control.
e27e10
    ${SVN} copy ${SOURCE} ${TARGET} --quiet
e27e10
e27e10
}