You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by John <Jo...@DMJ-Consultancy.co.uk> on 2006/10/23 09:53:53 UTC

Confused about svn:externals

SVN 1.2.3 on SuSE 10.1

I'm in the process of upgrading from M$ VSS and have encountered a problem.

I keep various aspects of my web site in separate directories and wish
to have a common file (index.php) in each directory. Under VSS, this was
easy using shares.

I have established that I need to set up SVN:Externals for this nut each
combination that I try results in an error:

svn: Error parsing svn:externals property on 'Web Site/Site Root'

My structure in SVN is:

'Web Site'
|
|-index
|    --index.php
|
--'Site Root'
     |
     |-functions
     |   |-function1.php
     |   |-function2.php
     |   --(index.php)
     |
     |-source
     |
     --images

and I'd like to have index.php included in Site Root, functions and
images. (the index directory has been set because I understand that I
can not share individual files so I've out the 'master' index.php in its
own directory.)  As illustrated in functions, there will be other files
in each directory.

I'm trying to set, for example:

svn propset svn:externals "file:///repos/Web Site/index" "Web Site/Site
Root" from the directory which contains the working copy of the Web Site
structure.

What am I doing wrong to get the error above?

TIA

John




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

Re: Confused about svn:externals

Posted by Thomas Harold <tg...@tgharold.com>.
John wrote:
> SVN 1.2.3 on SuSE 10.1
> 
> I'm in the process of upgrading from M$ VSS and have encountered a problem.
> 
> I keep various aspects of my web site in separate directories and wish
> to have a common file (index.php) in each directory. Under VSS, this was
> easy using shares.

Not really possible to share individual files between projects in SVN (I 
know, because this is an issue for us as well as we migrate from VSS to 
SVN).  There's been continual rumors of file sharing for the past few 
years, but most suggestions are "use symbolic links in unix and store 
them in SVN" which isn't helpful in a Windows environment.

What we've done to minimize the issue is that we have a very standard 
index.asp file (and other ASP files that do other things) that are 
nothing but includes.  The common code gets put in a central include 
folder, and any customizations are done via include files in that 
directory (or parent directory).

We'll probably use svn:externals for media files that are shared between 
  URLs.  (i.e. the large graphics and multimedia files will be kept in a 
sub-folder under the URL called "media".

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

Re: Confused about svn:externals

Posted by John <Jo...@DMJ-Consultancy.co.uk>.
Jeremy Pereira wrote:
>
> On 23 Oct 2006, at 12:06, John wrote:
>
>> Jeremy Pereira wrote:
>>>
>>> On 23 Oct 2006, at 10:53, John wrote:
>>>
>>>> SVN 1.2.3 on SuSE 10.1
>>>>
>>>> [snip]
>>>
>>>
>>> I don't think you can get what you really want using svn externals 
>>> since you will end up with a directory in Web Site/Site Root called 
>>> index which contains index.php.
>> Can you suggest another way to achieve this?
>
> On Unix you could use symlinks.
That certainly works. However, they need to be manually setup after the 
update per your comment on Windoze below.
>
> On Windows, you'd have a problem.  You could write a script to copy 
> index.php to the right place but it'd have to run manually after every 
> update or commit.
sort of a post update hook?


BTW, a command line like

      svn propset svn:externals "Site.Root file:///repos/Web.Site/index" .

sets up to use the files used in the external directory 'index' and puts 
them into Site.Root, not Site.Root/index

but if that directory exists from an associated checkout, externals can 
not be added and you get the error:

       Site.Root is already a working copy for a different URL


Now, how do we get round that error?

John

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

Re: Confused about svn:externals

Posted by Jeremy Pereira <je...@jeremyp.net>.
On 23 Oct 2006, at 12:06, John wrote:

> Jeremy Pereira wrote:
>>
>> On 23 Oct 2006, at 10:53, John wrote:
>>
>>> SVN 1.2.3 on SuSE 10.1
>>>
>>> [snip]
>>
>>
>> I don't think you can get what you really want using svn externals  
>> since you will end up with a directory in Web Site/Site Root  
>> called index which contains index.php.
> Can you suggest another way to achieve this?

On Unix you could use symlinks.

On Windows, you'd have a problem.  You could write a script to copy  
index.php to the right place but it'd have to run manually after  
every update or commit.

>>
>> btw, spaces are not legal in URLs, so you must encode them using %  
>> notation.
> i.e. Web%20Site/Site%20Root?

That'd do it.

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

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

Re: Confused about svn:externals

Posted by John <Jo...@DMJ-Consultancy.co.uk>.
Jeremy Pereira wrote:
>
> On 23 Oct 2006, at 10:53, John wrote:
>
>> SVN 1.2.3 on SuSE 10.1
>>
>> [snip]
>
>
> I don't think you can get what you really want using svn externals 
> since you will end up with a directory in Web Site/Site Root called 
> index which contains index.php.
Can you suggest another way to achieve this?
>
> btw, spaces are not legal in URLs, so you must encode them using % 
> notation.
i.e. Web%20Site/Site%20Root?
>
>>
>> TIA
>>
>> John
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>> For additional commands, e-mail: users-help@subversion.tigris.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>

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

Re: Confused about svn:externals

Posted by Jeremy Pereira <je...@jeremyp.net>.
On 23 Oct 2006, at 10:53, John wrote:

> SVN 1.2.3 on SuSE 10.1
>
> I'm in the process of upgrading from M$ VSS and have encountered a  
> problem.
>
> I keep various aspects of my web site in separate directories and wish
> to have a common file (index.php) in each directory. Under VSS,  
> this was
> easy using shares.
>
> I have established that I need to set up SVN:Externals for this nut  
> each
> combination that I try results in an error:
>
> svn: Error parsing svn:externals property on 'Web Site/Site Root'
>
> My structure in SVN is:
>
> 'Web Site'
> |
> |-index
> |    --index.php
> |
> --'Site Root'
>     |
>     |-functions
>     |   |-function1.php
>     |   |-function2.php
>     |   --(index.php)
>     |
>     |-source
>     |
>     --images
>
> and I'd like to have index.php included in Site Root, functions and
> images. (the index directory has been set because I understand that I
> can not share individual files so I've out the 'master' index.php  
> in its
> own directory.)  As illustrated in functions, there will be other  
> files
> in each directory.
>
> I'm trying to set, for example:
>
> svn propset svn:externals "file:///repos/Web Site/index" "Web Site/ 
> Site
> Root" from the directory which contains the working copy of the Web  
> Site
> structure.
>
> What am I doing wrong to get the error above?

your syntax is wrong. The svn:externals property expects a newline  
separated list of directory url pairs.

e.g.
foo             http://example.com/repos/zig
foo/bar -r 1234 http://example.com/repos/zag

(from the svn help)

This is pretty much impossible to do on the command line unless you  
only have one external to set, so put them in a temp file and use the  
-F option.

I don't think you can get what you really want using svn externals  
since you will end up with a directory in Web Site/Site Root called  
index which contains index.php.

btw, spaces are not legal in URLs, so you must encode them using %  
notation.

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

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