3

I am working on a number of projects simultaneously. Each project has a Subversion repository. The repositories are not all hosted on the same server. When I start my day, I find myself having to do an svn update for each of the individual projects.

My local working copies are all stored under one parent directory Projects.

My question: Is there a command that can be issued from the Projects directory that will search for working copies among the descendants in the file system and issue an svn update command for each of them?

I'm on Ubuntu with Subversion version 1.7.5.

thekbb
  • 7,668
  • 1
  • 36
  • 61
sammy34
  • 5,312
  • 5
  • 29
  • 42

4 Answers4

5

cd to Projects and then:

svn up `ls -d ./*`

(note those are backticks, not single quotes.)

svn will happily skip non-svn dirs. You could add an alias in your .bashrc

alias up-svn='svn up `ls -d ./*`'
thekbb
  • 7,668
  • 1
  • 36
  • 61
  • What does the `ls -d ./*` portion do exactly? – aschipfl Oct 05 '16 at 07:10
  • the `-d` prevents recursive listing of dirs. from the manual: "Directories are listed as plain files (not searched recursively)." – thekbb Oct 10 '16 at 02:34
  • it does not matter if the projects are on the same server, right? I mean: what if yes? is there any better way? (I know that works perfectly, I'm just thinking about something simpler) – Line Feb 01 '19 at 08:36
2

You could just write

svn update *

That's it... Subversion will automatically recognize the working copies and do the update

0

One more suggestion similar to @thekbb answer

svn up `find ~/svn -maxdepth 3 -type d`

Explanation: '~/svn' is my directory all checked out repositories are in '-maxdepth 3' some repositories are nested (3 levels deep) e.g. companyname/projectname/branch '-type d' only directories

Knutz
  • 21
  • 3
-1

no, but you can easily write a script/batch file that calls "svn update" on each subdirectory.

gbjbaanb
  • 51,617
  • 12
  • 104
  • 148