You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Karl Wagner <kw...@zetex.com> on 2008/07/31 15:44:22 UTC

Externals with Branches etc

Hi there

I have a fairly complicated setup with subversion, keeping both source
and binaries, with separate trunk/branches/tags directories for each
project, along the lines of:

REPO
  |-/bin
  |    |
  |    |-PROJECT1
  |    |      |-trunk
  |    |      |     |-dir1
  |    |      |     |-dir2
  |    |      |     |  ...
  |    |      |
  |    |      |-branches
  |    |            |-mybranch
  |    |            |      |-dir1
  |    |            |      |-dir2
  |    |            |      |  ...
  |    |-PROJECT1
  |        ... (as above)
  |
  |-/src
  |    |
  |    |-PROJECT1
  |    |      |-trunk
  |    |      |-branches
  |    |            |-mybranch

Etc

Basicaly the src directory mirrors the bin directory in structure. Each
project in source calls in the subdirectories from the binaries as
externals (because our particular development needs them).

However, maintenance of these is a bit of a pain, especialy when it
comes to branches. I was wondering if there was any way to cause
subversion to use part of the current directory name in the externals
definition.

Here are the options I have though of so far, but I am unsure how to
implement them.

1) Using a PHP script + Apache's mod_rewrite / mod_proxy to 'override'
the externals definition. I.e. when svn calls for the externals
property, Apache proxy-forwards this to a PHP script which takes the URL
and generates the externals definition automagicaly. How does svn ask
for properties? Is there some documentation on it somewhere?

2) Assign the externals definition to a php script. I.e. svn:externals=
	Dir1 http://mysvnserver/external/PROJECT1/Dir1
	Dir2 http://mysvnserver/external/PROJECT1/Dir2
	...

	Use mod_rewrite / mod_proxy again to redirect these to a PHP
script, which looks at the referer (if svn sets it) to determine the
correct location and return the right files.

3) A pre-commit script which modifies the externals definition on the
transaction before allowing it to complete, or a post-commit which
performs a check out, modifies the externals, and commits. The second
form of this seems very wasteful, as it would end up creating extra
revisions, but I cannot find anything which lets you modify a
transaction.

4) Teach my users what to do and hope they aren't too lazy... On second
thought scratch that, it'll never work.

These are pretty much in order of preference, but I may have missed a
simpler solution. Any ideas anyone?

Cheers in advance
Mouse


_________________________________________________________

Zetex Semiconductors - Solutions for an analog world.

http://www.zetex.com
http://www.zetex.cn

E-MAILS are susceptible to interference.  You should not assume that
the contents originated from the sender or the Zetex Group or that they 
have been accurately reproduced from their original form.
Zetex accepts no responsibility for information, errors or omissions in
this e-mail nor for its use or misuse nor for any act committed or
omitted in connection with this communication.
If in doubt, please verify the authenticity with the sender.
_________________________________________________________

 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Externals with Branches etc

Posted by Blair Zajac <bl...@orcaware.com>.
Karl Wagner wrote:
> Hi there
> 
> I have a fairly complicated setup with subversion, keeping both source
> and binaries, with separate trunk/branches/tags directories for each
> project, along the lines of:

See the new relative externals feature:

http://subversion.tigris.org/svn_1.5_releasenotes.html#externals

> 3) A pre-commit script which modifies the externals definition on the
> transaction before allowing it to complete, or a post-commit which
> performs a check out, modifies the externals, and commits. The second
> form of this seems very wasteful, as it would end up creating extra
> revisions, but I cannot find anything which lets you modify a
> transaction.

You can't modify a transaction on the server because the client assumes that 
what it sends to the server is what will be committed.  If you modify the 
transaction, then it may mess up further communication between the client and 
the server because the two have different ideas on what is in the revision.

Regards,
Blair

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org