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

AtliB
  • 1,263
  • 1
  • 18
  • 30
sundar venugopal
  • 3,080
  • 6
  • 39
  • 45
  • 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 – Jaroslav Záruba Mar 21 '10 at 13:09

1 Answers1

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
martin clayton
  • 76,436
  • 32
  • 213
  • 198
Bert Huijben
  • 19,525
  • 4
  • 57
  • 73
  • 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. – Jason Sperske Nov 24 '10 at 00: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. – Dave Gregory Feb 16 '11 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... – Eight-Bit Guru Sep 13 '13 at 09: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... – Alexander Amelkin Aug 12 '15 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) – Bert Huijben Aug 17 '15 at 08:45
  • @AlexanderAmelkin I have an accepted feature request that would address exactly this issue. It would allow you to peg the relative external to the revision of the containing parent folder. Please vote it up here https://issues.apache.org/jira/browse/SVN-4286 – Stefan Dec 20 '15 at 09:21