tags:

views:

29

answers:

2

Hi,

I have a development directory that contains checkouts from svn repositories that stays in non svn directories. I would like to update all of dirs being in the svns.

Dir structure is similar to one below:

alt text

How would you solve the issue?

I am came with "brute force" solution, but it is not very much intelligent:

for i in `find . -mindepth 1 -maxdepth 3 -type d | grep -v .svn`; do svn up $i; done

It would be nice to have sth like to have:

svn --recursive update development_dir.
+1  A: 

Unfortunately, svn does not support this feature. What you can do, however, is to optimize your command by eliminating for loop and piping to grep. The command should look like this:

find . -mindepth 1 -maxdepth 3 -name "*.svn" -type d -exec svn up {}/.. \;

To make life easier, you can set up a Bash alias, for example:

alias svn_up_recusrive='find . -mindepth 1 \
-maxdepth 3 -name "*.svn" -type d -exec svn up {}/.. \;'

... and invoke the whole script with svn_up_recusrive command. Or create a shell script and put in into your bin directory. I personally prefer shell scripts as it is easier to support, extend them, process command line arguments etcetera.

Vlad Lazarenko
i would argue that this is a no feature because check-ins are atomic operations, how would you handle check-in failures for different repositories? would you have to revert the ones that have succeeded? what if reverting fails? :)
akonsu
@akonsu: Checkin and update are two different things.
Vlad Lazarenko
yes, my eyes are not seeing today :)
akonsu
A: 

How about create a dummy branch/repository and set the externals to the required branches. this way svn update at the top level will do a update in all subfolders. May be you can skip the non svn dir/files.

You can also cheat svn by having a .svn/entries file in the non-svn folders, which will lie to subversion that the non-svn folder is versioned. As long as you do not change the folder names, you will also not have any problem in commits in this approach.

Version Control Buddy