Help in understanding SVN Externals

心不动则不痛 提交于 2019-11-30 21:09:36

What you have to watch out for with svn:externals is that you need to explicitly specify the revision if you want something other than trunk. Google "pinning svn:externals" for the details. If you are using a fairly modern version, 1.5 or newer IIRC, then relative externals are at least supported. Older versions, like the one that I am currently using, requires us to explicitly pin the revision using the -rNNNNN option on the svn:externals property for every damned folder.

We ended up using a modification of a perl script named svncopy.pl from tigris.org to do all of our branching and tagging. It's not that bad but I wish that we had known how much work it was before we decided to use them so heavily.

You can use date specifiers to ensure you get corresponding revisions when you update.

We've done it for a tool that runs PC-Lint; we like to run it on each revision so that we can diff the results.

It's a bit obnoxious in its implementation -- we:

  • determine what rev the working copy is at (using svnversion)
  • determine what rev the HEAD is at (using svn info)
  • grab the timestamps for all revisions up to and including head (using svn log)
  • bump the timestamps by .999 seconds to be "sure" we get the rev (yay magic!)
  • update to each revision (using svn update -r {sometimestamp})
  • run PC-Lint on the working copy, diff, mailout, trigger klaxons, whatever

(Complexity worthy of Rube Goldberg, isn't it? Upvotes and undying gratitude for anyone who can suggest a better solution.)

You may also be interested in the svn book's section on Peg and Operative Revisions, which I've just discovered -- this seems to be a relatively new addition.

You should read up on dependency managers - I'm not sure what your platform is, but ivy and maven solve this problem in a much cleaner manner.

svn:externals are not versioned in subversion. if someone changes the revision or tag of one of your externals you have no way of knowing what it was prior to the change.

Yes it will, assuming you provide an explicit revision number in your externals, as suggested in the docs. Otherwise it will use HEAD revision of externals referenced.

Just watch out for file based svn:externals in 1.6. They look very useful, but I just hit this bug today :(

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!