Question

We have some shared libraries, and these are referenced as static externals in all tagged versions of our different projects.

After reorganizing the directory structure of our shared libraries, I see that all tagged versions now gives an error. I realised that the externals should have been referenced by using peg revision (@X) instead of operative revision (-r X).

We have hundreds of tagged versions, and inside these there are two-three different external references.

How can I recursively change the external definitions from operative to peg in my /main/projectX/tags/ folders? I imagine I will need some sort of shell script to do the job.

Was it helpful?

Solution

We solved this by running:

svn propget svn:externals -R http://repoURL

The output was used as a starting point for creating a svnmucc control file with the following content:

propset
svn:externals
^/external-source external-target
http://repoURL
propset
svn:externals
^/external-source2 external-target2
http://repoURL

And this was applied to the repo by running:

svnmucc -m 'Changing externals from operative to peg' -X controlfile.txt

The output of propget was quite different from the svnmucc format, so I had to do some manual work, and wrote a little PHP script to do most of the repetative work.

The only thing I was not able to do using svnmucc, was multiple externals on the same folder. Apparently, svnmucc cannot set multi-line properties on the same target. But we only had a few of those in our repo, so that was OK to fix manually using the TortoiceSVN repo browser.

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