You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Olivier Mascia <om...@tipgroup.com> on 2004/07/15 14:36:23 UTC

Does SubVersion allows to share a file/revision among multiple paths ?

Hello !

In a single repository, say I have:

sub1/mls.cpp
sub2/mls.cpp
sub3/mls.cpp

All three paths (projects) need that mls.cpp file. Is there a way to
have 'mls.cpp' appear in all three paths but being a single entity ?
That is: if mls.cpp is modified by a commit touching path "sub1", the
mls.cpp in sub2 and sub3 are instantly in synch too ?

It looks to me all I can do is move that file to some:

common/mls.cpp

and have all other projects refer to that single copy. But this is not
as handy as the above 'link'.

Is this achievable with current version 1.0x ?
Is this part of 1.1 ?
What are the plans ?
Is this even a good idea ?
Should I consider other ways of doing that ?

Thanks for any advice,

-- 
Olivier Mascia



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

Re: Does SubVersion allows to share a file/revision among multiple paths ?

Posted by Toby Johnson <to...@etjohnson.us>.
Olivier Mascia wrote:

>Wouldn't it be conceptually simpler using an export from repository to
>shadow folder than an update? It wouldn't require the initial checkout
>as I understand.
>
It just depends on which one suits you better. The benefit of having the 
shadow folder being a working copy rather than an exported directory is 
that the server would only need to send deltas after each commit, rather 
than the entire directory. If you want to "shadow" your entire 
repository, that's definitely a concern.

If using export, you would also need to delete the entire shadow 
directory before re-exporting it each time, which of course would cause 
problems if someone was currently visiting part of the shadow directory 
in a DOS prompt or was otherwise holding a lock on any file or directory 
within it.

Of course, since the post-commit hook receives the new revision number 
as one of its parameters, you could always have it do "svn diff" against 
the repository and then apply that diff to your shadow folder, thereby 
removing the need to delete it beforehand. But if you're looking for 
"conceptually simpler", that's definitely not the way to go. :)

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

Re: Does SubVersion allows to share a file/revision among multiple paths ?

Posted by Olivier Mascia <om...@tipgroup.com>.
On Thu, 15 Jul 2004 12:26:34 -0400,
Toby Johnson <to...@etjohnson.us> wrote:

TJ> They sure are, just create "post-commit.bat" in the "hooks" directory of 
TJ> your repository. Should be a one-liner -- "svn up 
TJ> c:\path\to\shadow\folder" -- as long as Subversion is in the System Path 
TJ> on the server machine. (You would need to manually "svn co 
TJ> c:\path\to\shadow\folder URL" before the first time this script is used, 
TJ> after which it would just work each time).

Wouldn't it be conceptually simpler using an export from repository to
shadow folder than an update? It wouldn't require the initial checkout
as I understand.

-- 
Olivier Mascia



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

Re: Does SubVersion allows to share a file/revision among multiple paths ?

Posted by Toby Johnson <to...@etjohnson.us>.
Olivier Mascia wrote:

>That will be perfect for the job. I'll now dig documentation a bit more
>on this topic. I hope those hook scripts techniques are supported on
>Win32 versions of SubVersion. I'll see.
>  
>
They sure are, just create "post-commit.bat" in the "hooks" directory of 
your repository. Should be a one-liner -- "svn up 
c:\path\to\shadow\folder" -- as long as Subversion is in the System Path 
on the server machine. (You would need to manually "svn co 
c:\path\to\shadow\folder URL" before the first time this script is used, 
after which it would just work each time).


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

Re: Does SubVersion allows to share a file/revision among multiple paths ?

Posted by Olivier Mascia <om...@tipgroup.com>.
On Thu, 15 Jul 2004 11:41:50 -0400,
Toby Johnson <to...@etjohnson.us> wrote:

TJ> Your description of "shadow" folders here isn't entirely accurate, 
TJ> because _nothing_ happens "server side" in VSS, as there is no VSS server!

Indeed! ;-) 

TJ> A very simple way to accomplish this would be to create a "post-commit" 
TJ> hook script which does an "svn update" (or "svn export", if you don't 
TJ> want the .svn maintenance directories) on the directory of your choice.

That will be perfect for the job. I'll now dig documentation a bit more
on this topic. I hope those hook scripts techniques are supported on
Win32 versions of SubVersion. I'll see.

Thanks!

-- 
Olivier Mascia



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

Re: Does SubVersion allows to share a file/revision among multiple paths ?

Posted by Toby Johnson <to...@etjohnson.us>.
Olivier Mascia wrote:

>While we're at this, is there some way to setup something equivalent to
>the concept of "shadow" found in Visual SourceSafe ? A shadow is a copy
>of HEAD revision for a whole repository (or sub-projects of it) stored
>in some external location and held incrementally up-to-date by the
>versioning engine on each commit to the repository.
>
>That is pretty much what you get by 'exporting', but it is handled,
>server-side, at each ommit.
>
Your description of "shadow" folders here isn't entirely accurate, 
because _nothing_ happens "server side" in VSS, as there is no VSS server!

A very simple way to accomplish this would be to create a "post-commit" 
hook script which does an "svn update" (or "svn export", if you don't 
want the .svn maintenance directories) on the directory of your choice.

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

Re: Does SubVersion allows to share a file/revision among multiple paths ?

Posted by Robert Guthrie <rg...@pobox.com>.

Olivier Mascia wrote:
> On Thu, 15 Jul 2004 10:43:35 -0400,
> Toby Johnson <to...@etjohnson.us> wrote:
> 
> While we're at this, is there some way to setup something equivalent to
> the concept of "shadow" found in Visual SourceSafe ? A shadow is a copy
> of HEAD revision for a whole repository (or sub-projects of it) stored
> in some external location and held incrementally up-to-date by the
> versioning engine on each commit to the repository.

It's supported server-side with "hook scripts", so you could have 
another repository that is updated after every commit to the main 
repository.  It's not really documented in the book, but the sample 
scripts should give you something to work with.  I haven't tried it myself.

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

Re: Does SubVersion allows to share a file/revision among multiple paths ?

Posted by Olivier Mascia <om...@tipgroup.com>.
On Thu, 15 Jul 2004 10:43:35 -0400,
Toby Johnson <to...@etjohnson.us> wrote:

TJ> You can't do this for individual files. You can use "externals" 
TJ> definitions (look up svn:externals in the book) to have one folder 
TJ> always pull in folders from another location (even another repository). 
TJ> In that case you probably still would want to create a "common" 
TJ> location, and have the projects that use it define that "common" folder 
TJ> as an external.

That sounds as a possibility, indeed. I will experiment a bit.

TJ> The only version control system I know of which supports what you're 
TJ> talking about is Visual SourceSafe's "Links", but I would argue this is 
TJ> a dangerous feature to use. I know it has created much confusion for my 
TJ> team at work.

They call it "shares". Yes it created confusion sometimes here too, but
team finally got used to them and we have to re-organize things a bit
now as part of our transition from VSS to SVN. ;-)

While we're at this, is there some way to setup something equivalent to
the concept of "shadow" found in Visual SourceSafe ? A shadow is a copy
of HEAD revision for a whole repository (or sub-projects of it) stored
in some external location and held incrementally up-to-date by the
versioning engine on each commit to the repository.

That is pretty much what you get by 'exporting', but it is handled,
server-side, at each ommit. All in all this what you can see through the
http view when using SubVersion with Apache. I suppose I could actually
mount the repository using a WebFolder to get that concept of an
up-to-date-after-each-commit global view on the repository. But is there
some other way of doing this ? Some scripting on the server-side acting
on each commit ?

I have read (quickly) the Book but obviously need to dive deeper.

TJ> In 1.1, you can version symlinks if you're using a Unix-type system, but 
TJ> I doubt that is really what you're looking for. They're filesystem 
TJ> symlinks, not symlinks within the repository itself.

Right, this is not what I was looking for.

Thanks Toby,

-- 
Olivier Mascia



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

Re: Does SubVersion allows to share a file/revision among multiple paths ?

Posted by Toby Johnson <to...@etjohnson.us>.
Olivier Mascia wrote:

>All three paths (projects) need that mls.cpp file. Is there a way to
>have 'mls.cpp' appear in all three paths but being a single entity ?
>That is: if mls.cpp is modified by a commit touching path "sub1", the
>mls.cpp in sub2 and sub3 are instantly in synch too ?
>  
>
You can't do this for individual files. You can use "externals" 
definitions (look up svn:externals in the book) to have one folder 
always pull in folders from another location (even another repository). 
In that case you probably still would want to create a "common" 
location, and have the projects that use it define that "common" folder 
as an external.

>Is this achievable with current version 1.0x ?
>Is this part of 1.1 ?
>What are the plans ?
>Is this even a good idea ?
>  
>
The only version control system I know of which supports what you're 
talking about is Visual SourceSafe's "Links", but I would argue this is 
a dangerous feature to use. I know it has created much confusion for my 
team at work.

In 1.1, you can version symlinks if you're using a Unix-type system, but 
I doubt that is really what you're looking for. They're filesystem 
symlinks, not symlinks within the repository itself.

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