Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Copies SVN properties from one directory tree to another. Trees may be
- # versioned by different repos. The original tree must be a fresh working copy.
- # The target must have the identical structure as the source.
- err_usage() { echo "Usage: $0 FROM_DIR TO_DIR" ; err "$1"; }
- err() { echo "$1" ; exit 1; }
- FROM_DIR=$2; [ -d "$FROM_DIR" ] || err_usage "'$FROM_DIR': directory not found"
- TO_DIR=$2; [ -d "$TO_DIR" ] || err_usage "'$TO_DIR': directory not found"
- cd "$FROM_DIR"
- FILES=`svn -v status | awk '{print $4}'`
- cd -
- for FILE in $FILES
- do
- FROM="$FROM_DIR/$FILE" ; [ -e "$FROM" ] || err "'$FROM': no such file or directory"
- TO="$TO_DIR/$FILE" ; [ -e "$TO" ] || err "'$TO': no such file or directory"
- for PROP in `svn proplist $FROM | tail -n +2`
- do
- VALUEX=`svn propget "$PROP" "$FROM"; echo -n x`
- echo " '$PROP' '$TO' = '${VALUEX%x}'"
- svn propset "$PROP" "${VALUEX%x}" "$TO" || err "'$TO': propset failed"
- echo
- done
- done
Advertisement
Add Comment
Please, Sign In to add comment