35

Is there any way to use Relative path when configuring subversion externals.

For example

 Trunk
      - directoryA
      - directoryB
      - projectA {external DirectoryB}

For configuring ProjectA we have to configure full path in the external property which is causing problems or forcing us to do change the properties when we do branches.

Any way to automate the branching process or fix with absolute path will be useful

1
  • 2
    the big news for me is that the syntax has been changed (inverted that is)... that explains why i was never able to make relative externals work thanks for the link, Bert Mar 21, 2010 at 13:09

1 Answer 1

60

Subversion 1.5 clients support relative urls:

See the Subversion 1.5 release notes and the subversion manual for more details

Some examples: (Note that the comment syntax is not supported)

# Repository root relative
^/projectX/trunk/src/ projectX

# Relative to current directory
../../dependency/X X

# Server root relative
/svn/repos/projectX/trunk/src projectX

# Schema relative
//svn.collab.net/repos/svn/trunk svn
6
  • I learned that relative paths weren't supported a few years ago, and never updated my knowledge on this. I'm glad I searched again just to be sure. Nov 24, 2010 at 0:50
  • 13
    If you're "upgrading" a set of externals from pre-1.5 to use relative URLs, note that the format of the property has changed (from "path [revision] target" to "[revision] target path"). The old syntax is still supported, but not when using any of the new url schemes. Feb 16, 2011 at 16:44
  • +1 on the comment describing the reversal of the externals syntax for relative URL upgrades - this is NOT highlighted in the SVN manual, and should be! Now, all I need is a script to burn through a 50GB dumpfile finding externals props, changing them to relative URLs and switching the syntax around... <sigh> Sep 13, 2013 at 9:33
  • It's a pity that, as it seems, subversion always checks out the latest revision of an external for un-pegged externals, even if they are relative and you're explicitly checking out a specific revision of a directory having an svn:externals property. I would expect it to also fetch relative externals at the same revision, but alas... Aug 12, 2015 at 11:24
  • 2
    @AlexanderAmelkin Perhaps svn copy --pin-externals (new in Subversion 1.9) can help you here. This will peg all externals for you in the copy (typically a tag or branch) Aug 17, 2015 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.