3

I would like to know as how to commit a file/folder to multiple folders in one go using subversion tool. I can place the file in multiple folders and then do commit, but i just want to place it is a single folder and it should create copies in the required folders. Is it possible?

user475685
  • 8,041
  • 7
  • 26
  • 24
  • It sounds somehow possible to do this for the initial commit, but do these files also need to be linked afterwards (i.e. change in one place, modify all of them)? For that I think you need trickery like SVN externals or local symlinks. – Thilo Oct 23 '10 at 11:25
  • Its only for the initial commit i.e. place it in one of the required folders and then it should get committed to multiple folders. – user475685 Oct 23 '10 at 11:37

3 Answers3

2

No, subversion supports only one main repository. But you can update from many locations. Commit one place, update from other places like web server directory. If you make change there you can also commit from there.

nerkn
  • 1,867
  • 1
  • 20
  • 36
0

Something like Apache Ant or Maven will help you accomplish this task.

Edit: maybe something like this in a pre-commit hook (create a file 'pre-commit' in your repository/hooks dir)(draft version):

#!/bin/bash

REPOS="$1"
TXN="$2"
SVNDIR=""
SVNLOOK="/usr/bin/svnlook"
NEWPATH="/path"

CHANGED=`$SVNLOOK changed -t "$TXN" "$REPOS" | $GREP "^[U|A]" | $AWK '{print $2}'`

for FILE in $CHANGED
do 
cp "$FILE" "$NEWPATH/$FILE" 
done

svn add -force "$SVNDIR" 
Brandon Frohbieter
  • 17,563
  • 3
  • 40
  • 62
0

If you're trying to reuse a central file, you can use the svn:externals property. Commit the file to some central place in your repository tree, and then create an svn:externals property to the file (or maybe better its parent directory). That way you can commit it from everywhere (also the locations where its being pulled in by svn:externals), and reuse it.

Sander Rijken
  • 21,376
  • 3
  • 61
  • 85