Is it possible to commit a single file to multiple directories which share the same parent directory using subversion

StackOverflow https://stackoverflow.com/questions/4003707

  •  25-09-2019
  •  | 
  •  

Question

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?

Was it helpful?

Solution

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" 

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top