views:

1802

answers:

4

I'm using tortoise svn in Windows.

How can I branch in SVN and have it branch my svn:external folders as well?

+4  A: 

When you create a branch within Subversion you are simply creating a cheap copy of the trunk, branch, or tag that you are branching from. This cheap copy will contain all of the same files and properties as the trunk, branch, or tag that you branched from until you begin to modify the properties or files of the new branch.

However, you may be able to modify one of the 'commit' hooks to modify settings automatically once you commit your branch. http://svnbook.red-bean.com/en/1.1/ch05s02.html

Otherwise if you want your externals to be modified on the branch you will need to do so manually.

Noah Goodrich
Modifying an svn-commit transaction via hook scripts is not advisable and not supported by the svn community. It will result in serious workingcopy desynchronisations!
Peter Parker
+2  A: 

You'll have to manually create a branch in your external repository and then change your svn:external property to point to the correct branch.

nickf
this is not feasible for me because I have a lot of svn:externals in my project
Brian R. Bondy
+10  A: 

You should use svn:externals as external references from different repositories. So svn:externals should refer to components, modules, 3rd party tools, etc.

You should not use svn:externals to emulate a "symbolic link"-behaviour by using externals to point into the same repository. You can solve such issues most of the time by modifying your build-structure, or use checkout-scripts and sparse checkout feature.

svn:externals have a lot of problems most of them are difficult to see, track and repair: see an example here

  • commits cannot span over externals(no atomic commits)
  • branches will not branch their externals(as you pointed out)
  • tags will not "freeze" their externals so latter builds may result in different/broken builds
  • merging and reeintegrate merge will not work on externals

If you use externals to point to other repositories, you will most of the time do not have these problems.

Peter Parker
A: 

Isn't there some way to define one of those svn:externals symbols to define "same relative path to the root on a different repository" ... ?