Most of our projects use a lot of common code. We are (finally) moving towards a system where we are managing that shared code in a uniform way. We treat the shared code as a separate project in SVN, then reference it as an external. However, we tend to point the external libraries to development branches or even the trunk while the project is under development, due to the inevitable gotchas from porting the libraries from one usage to another.
As a result, we have been making mistakes when tagging files for release or internal milestones. Once in a while we will tag a project without ensuring that all the externals have been tagged first. How can we solve this problem? I'm looking for ways to reduce the possibility of a mistake or to recover/repair after making a sloppy tag like this. Ideally the solution would be a way to make SVN enforce the current policy, but I'm interested in any experience with problems like this.
As such, to checkout a tag, you check out with your URL referencing the directory. To commit back that tag, you do a normal commit. To commit back to a different tag, you svn copy the files into the new "correct" tag directory, which you might have to mkdir ...; svn add (dir) prior to the svn copy.
Select the folder in your working copy which you want to copy to a branch or tag, then select the command TortoiseSVN → Branch/Tag.... If you can't remember the naming convention you used last time, click the button on the right to open the repository browser so you can view the existing repository structure.
There is no difference between branches and tags in Subversion. The only difference is in what the user then does with the directory. Branches are typically created, edited, and then merged back into the trunk. Alternatively, tags are created as a snapshot of the project at a point in time and then never changed.
What are externals definitions? Externals definitions map a local directory to the URL of a versioned resource. The svn:externals property can be set on any versioned directory and its value is a multi-line table of subdirectories and absolute repository URLs.
I would use two strategies to deal with that problem
In addition, you can also come up with a pre-commit hook that checks whether a tag is being created, and whether all externals point to fixed revisions, rejecting the commit if this is not the case.
Subversion client version 1.9 has a --pin-externals
option for svn copy
that looks like it will do exactly what is wanted here.
Thanks to danielsh
(Daniel Shahaf) on freenode IRC channel #svn
for this answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With