[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn:keywords?

From: Gregory Margo <gmargo_at_pacbell.net>
Date: 2006-02-22 12:18:32 CET

On Wed, Feb 22, 2006 at 09:52:59AM +0100, Bj?rn T Johansen wrote:
> I would like to use svn:keywords but as far as I can tell, I have to run svn propset on every file I want to
> use keywords... Is this correct?
> Is there no other way? If I have 300 files, I need to run svn propset 300 times??

Since I kept having to re-figure the syntax for this every time I
add a file to my project, I wrote this simple shell script, which
I call "add_svn_props":

#!/bin/sh

# Add some properties to a Subversion object.
# G. Margo 2006-01-17

Usage () {
        echo "$0 [-x] filename(s)"
        echo " -x: Add executable property."
        exit 1
}

opt_executable=0
while [ "x$1" != "x" ]; do
    case "$1" in
        -x) opt_executable=1 ;;
        -*) Usage ;;
        *) break 2 ;;
    esac
    shift
done

if [ $# -lt 1 ] ; then
    Usage
fi

#ECHO=echo
ECHO=

add_props () {
    $ECHO svn propset svn:keywords 'Author Date Id Revision' $*
    $ECHO svn propset svn:eol-style native $*
    if [ $opt_executable -eq 1 ] ; then
        $ECHO svn propset svn:executable '*' $*
    fi
}

add_props $*

-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Gregory H. Margo
gmargo at yahoo/com, gmail/com, pacbell/net; greg at margofamily/org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Feb 22 12:20:03 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.