How to have TortoiseSVN always freeze svn:externals for tags
Asked Answered
V

8

19

Is this possible with tortoiseSVN?:

Always freeze svn:externals for tags

the scenario is our trunk will always use the 'HEAD' revision for externals, however when we create 'tags' we would like for them to have a revision set for externals to properly 'freeze' them at a specific point in time.

Update

Thanks to everyone for your feedback/info.

Since I could not find anything that would completely meet our needs (tried smartsvn and svncopy.pl) I made a console app that so far has passed all our test cases.

A high level overview: The app takes a repository URL then looks for all externals and adds the last commit revision for them - I do a svn info and get the "commit revision".

The app works with both folder and single file externals.

Here is the source code and complete setup files: http://svnxf.codeplex.com/

Viki answered 30/12, 2009 at 21:15 Comment(2)
What about svncopy.pl did not meet your needs?Mho
Please post solutions as answers, not in questions.Rake
K
7

I found this post today as I looked for a solution to the exact same problem. Eventually I found that TortoiseSVN in their latest version DOES support this desired functionality: TortoiseSVN 1.7 Release Notes.

Hopefully this will help others who find this post when researching the same issue.

Kenlay answered 9/10, 2013 at 17:57 Comment(2)
IMO it is buggy, because it does not freeze externals of externals which renders this functionality effectively useless for tagging and branching to a release branch.Grovergroves
The only workaround for that problem is to use externals only with pegs...Grovergroves
A
6

The recommended best practice is to always use an explicit revision (not HEAD) in externals definitions. From the documentation:

You should seriously consider using explicit revision numbers in all of your externals definitions. Doing so means that you get to decide when to pull down a different snapshot of external information, and exactly which snapshot to pull. … For software projects, this could be the difference between a successful and a failed build of an older snapshot of your complex codebase.

To directly answer your question: no, it’s not possible to automatically change the externals definitions when tagging using TortoiseSVN. It will have to be done manually when creating the tag.

Addressograph answered 30/12, 2009 at 21:30 Comment(3)
I completely agree with this for a tag, however the trunk will always use the latest.Viki
Even the trunk should not use the latest. If a dependency has a breaking change applied to it, then you have several revisions for which your trunk build is broken. Instead, you should used fixed revisions, and then you (a) update the external definition (b) update your code to support the changes in the dependency, all in one fell swoop.Rake
If you should seriously consider, one wonders why it's not the default, and why tracking HEAD is even allowed...Forjudge
C
3

You can try svncopy.pl (find it on google) It is a perl script that answer your need.

Conclude answered 6/1, 2010 at 9:12 Comment(1)
For the lazy: svn.apache.org/repos/asf/subversion/trunk/contrib/client-side/…Mho
I
2

You should try SmartSVN which optionally converts HEAD-externals to fixed externals when creating tags or branches. You can find this option (External Revisions: (o) Leave as is ( ) Fix all ( ) Fix except below) at the bottom of the Add Tag/Add Branch dialogs.

Ingunna answered 31/12, 2009 at 7:51 Comment(2)
tried this and it seems to only work with folder externals and not single file externals support in 1.6+... first client to get this working right will have a nice edge over the rest!Viki
According to syntevo.com/smartsvn/changelog.txt SmartSVN 6.5.2 fixes also file externals.Ingunna
O
1

I would second Michael.

Additionally to recommendation from SVN documentation:

  • Usage non-fixed revisions in svn:externals makes harder to update working copy to a specified revision (e.g. during bug investigation)
  • Log of directory with svn:externals will be incomplete which may provide false information about change sets between revisions
  • Branching and merging may become more complicated

Generally, SVN seems to be designed mostly for code contained in a common directory. svn:externals (even by name) is added for referencing external repositories. So I would expect other problems additionally to mentioned above.

On my experience need for usage of svn:externals for non-fixed revisions frequently comes from wrong structure in repository.

May be it's not your case, I just advise to take into account these points...

Oman answered 6/1, 2010 at 10:30 Comment(0)
V
1

Update

Thanks to everyone for your feedback/info.

Since I could not find anything that would completely meet our needs (tried smartsvn and svncopy.pl) I made a console app that so far has passed all our test cases.

A high level overview: The app takes a repository URL then looks for all externals and adds the last commit revision for them - I do a "svn info" and get the "commit revision".

The app works with both folder and single file externals.

Here is the source code and complete setup files: http://svnxf.codeplex.com/

Viki answered 17/1, 2013 at 3:20 Comment(0)
C
0

You can specify the revision in externals:

third-party/skins -r148        http://svn.example.com/skinproj

See svnbook

Chiaroscuro answered 30/12, 2009 at 21:19 Comment(1)
I don't think there's a way to do that automatically, other then scripting/programming something yourself and always using that for taggingChiaroscuro
S
0

I know this isn't for tortoiseSVN, but if you use eclipse with subversive, you can right click the project and select team->tag. Subversive freezes externals by default and formats the properties quite nicely.

Succedaneum answered 23/12, 2010 at 22:49 Comment(1)
thank you - I was also looking for something we can put in our automated build.Viki

© 2022 - 2024 — McMap. All rights reserved.