0

Is there a way to quickly find all svn:externals references to a URL on-demand, among repositories that we control, using svn, TortoiseSVN, and/or some other tool? (e.g. Plugin/extension, hook scripts, etc.)

If not, would the correct/best way be to create a post-commit hook script that "registers" any added or modified svn:external references in a file or database somewhere, and then finding the external references would reference that info? And we could seed the file/database with svn propget -R svn:externals (perhaps with some text mangling), right?

Details

We're getting ready to start using svn:externals internally among our developer team for shared source libraries. We'll peg our revs1 in any svn:external reference, to ensure that we can roll back to prior repo states. Most of us use TortoiseSVN as our frontend, most of the time.

As a point of comparison, I've heard that the much (and rightly) maligned Visual SourceSafe had such a feature, something like right-click → "where used". With such a feature, when we want to change a shared module, we can see which projects it may potentially affect.


Note: This question is not a duplicate of any of these, because I'm asking about how to do it quickly, which would require having the info cached. It has been noted that svn propget can take hours or even days to return, depending on the repository.


1 Pegging revisions, a.k.a. "us[ing] explicit revision numbers", as in TortoiseSVN's External Items page.

Community
  • 1
  • 1
cp.engr
  • 2,291
  • 4
  • 28
  • 42

1 Answers1

0

Subversion doesn't cross-reference externals metadata. The "external" repository that you're pulling from may not be a system that you have rights to modify, such as pulling in an open-source library into your local project. You're going to need to create some sort of hook script that tracks svn:externals metadata changes and logs them to a database. Note that this will only work for externals references for that one server. If some other server is using 'externals' to pull in your code, then your server won't have any way to know this is happening and your database will be incomplete.

bta
  • 43,959
  • 6
  • 69
  • 99
  • "such as pulling in an open-source library into your local project" - I specified in the question that I'm only aiming to do this "among repositories that we control". – cp.engr Oct 07 '15 at 17:53
  • "Note that this will only work for externals references for that one server." That's the plan. – cp.engr Oct 07 '15 at 17:54
  • I realize that, I'm just explaining Subversion's design from it's point of view. If you have tight control over the environment, then you should be able to do all of this from a post-commit hook script. – bta Oct 07 '15 at 17:59
  • Right - I was mainly wondering if someone had done it already, so we wouldn't have to reinvent the wheel. – cp.engr Oct 07 '15 at 18:07