Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find paths with svn:external properties with certain string?

I've a very large subversion repository, it's about 7 GB in size and holds many many files and directories from different projects.

Now I did some major change to one project structure which is actually a library and I'm using it in quite a few other projects within the same repository. Now the documentations is sparse and I don't know which project actually really used this library as external and I'd like to somehow query the subversion server/repository to return me all directories which have a certain string in the svn:export property so I can adjust them.

Ideally without checking out the whole repository, would turn out problematic due all the branches and tags.

Is that possible somehow in a smart way?

thx

like image 443
mark Avatar asked Feb 25 '11 14:02

mark


1 Answers

The quick and dirty way, if it's just a few changes, is to use svn propget with the --recursive flag to get the properties, and make the changes manually (this might take a while to return):

svn propget --recursive svn:externals http://your.svn.server/ | grep -B 5

To do this in a more automated fashion you can script it:

  • recursively retrieve svn:externals for every path in the root

  • check out directories whose externals contain the string you're looking for (you can split the path component by filesystem separator and check out each component with depth=immediate if you want to be really selective about what you check out)

  • make and commit the change

The advantage doing it this way is that because your checkout effectively mirrors your repository (even though it's missing loads of stuff) you can make a single commit at the top level with all the changes made.

HTH.

like image 62
SteveMc Avatar answered Oct 13 '22 19:10

SteveMc