You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by pl...@lanminds.com on 2002/10/22 13:45:04 UTC

Help with svn:externals

Hi,

After reading the svn Handbook section on the svn:externals property 
tag, I find that I'm still a little confused on what it is good for 
and how it is used.

I recently read an article in Linux Journal about someone who kept 
their entire homedir under CVS control and used CVS modules to make 
it a bit more manageable.

svn:externals *seems* to be the analgous to CVS modules.  However,
I know very little about CVS at that level, having simply used it to 
check out from repos managed by others.  As a result, since I don't 
even understand that, I find it difficult to grasp the svn:externals 
stuff as well.

Could someone be so kind as to explain how/why you would use 
svn:externals?  If other docs exist explaining it differently 
than the Handbook, pointers to those would be greatly appreciated as 
well (would it be worth reading the modules section at red bean?).

Thanks,

-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



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

Re: Help with svn:externals

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Nicholas Riley <nj...@uiuc.edu> writes:
> Yes.  But instead of creating a module, you'd just create (svn mkdir)
> another location in the repository with the appropriate svn:externals
> set.

Exactly what I was about to say, yes :-).

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

Re: Help with svn:externals

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: 24 Oct 2002 10:30:58 CDT
Karl Fogel said:

>Paul Lussier <pl...@lanminds.com> writes:
>> then, do I:
>> 
>> 	svn propset svn:externals --file list_of_aliases.txt foo
>
>It's just like any other property.  You set it in the working copy,
>then commit.

Oh, okay.  I think I figured that out yesterday, but I don't remember.

>> Next, how exactly do I use this?  Let's say that 
>> 'list_of_aliases.txt' contains:
>> 
>> 	foo	/path/to/repo/foo
>> 	bar	/path/to/repo/bar
>> 	ff	/path/to/repo/foo/ff
>

>(Is it intentional that you have an external named foo inside a parent
>directory named foo?  You'll end up with foo/foo, and if they're the
>same directory, you might get an infinite recursion of checkouts...)

Well, I definitely discovered the "infinite recursion" aspect of this :)

My expectation here was that the strings on the left were aliases for 
the paths on the right, not that I would end up with a parent and 
child of the same name, but rather that I could check out just a 
subdir of the the parent 'repo' or, have one alias which would allow 
me to checkout certain specified subdirs of the parent 'repo'.

>If you set the externals property on `foo', then you should check out
>a tree containing that directory `foo'.  When you check it out (and
>when you update) it will grab the externals and include them as
>subdirs under `foo'.

Okay, I think that's not what I'm looking to do.

>Paul, have you done any experimenting yet?  I think that would help.

I have, but I'm doing so blindly, since I think I have an incorrect 
expectation of how externals can be used.  I was thinking I could use 
this property to create aliases for groups of subdirs under a parent 
repo, rather than actually populating a tree with subdirs from other 
repos.

Thanks for all the explanations.  I think I understand (at least 
partially) how externals work now. Though, either I don't understand 
them enough to accomplish what I want, or, what I want isn't possible 
with externals.
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



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

Re: Help with svn:externals

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Paul Lussier <pl...@lanminds.com> writes:
> then, do I:
> 
> 	svn propset svn:externals --file list_of_aliases.txt foo

It's just like any other property.  You set it in the working copy,
then commit.

> Next, how exactly do I use this?  Let's say that 
> 'list_of_aliases.txt' contains:
> 
> 	foo	/path/to/repo/foo
> 	bar	/path/to/repo/bar
> 	ff	/path/to/repo/foo/ff
> 
> Can I then just say:
> 
> 	svn co ff

(Is it intentional that you have an external named foo inside a parent
directory named foo?  You'll end up with foo/foo, and if they're the
same directory, you might get an infinite recursion of checkouts...)

If you set the externals property on `foo', then you should check out
a tree containing that directory `foo'.  When you check it out (and
when you update) it will grab the externals and include them as
subdirs under `foo'.

Paul, have you done any experimenting yet?  I think that would
help.

-K

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

Re: Help with svn:externals

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: Tue, 22 Oct 2002 16:25:40 CDT
Nicholas Riley said:

>On Tue, Oct 22, 2002 at 04:57:03PM -0400, Paul Lussier wrote:
>> Can I some how specify I only want to check out bin/, etc/, and lib/ 
>> but not mail/ and .netscape/.  Is there a way to create an alias for 
>> certain combinations of sub-dirs you want grouped together?  Would 
>> that be handled by the 'svn:externals' thing?
>
>Yes.  But instead of creating a module, you'd just create (svn mkdir)
>another location in the repository with the appropriate svn:externals
>set.  This is a common theme of Subversion: lots of separate concepts
>in CVS - tags, branches, modules - are supported in a more free-form
>fashion in Subversion according to the layout of your repository.

Okay, I sorta get it.  But am I setting the svn:externals property on 
the new directory I just made, or on the parent repository itself?

IOW, I start out by:

	svn mkdir foo
	svn commit -m"made new dir foo"

then, do I:

	svn propset svn:externals --file list_of_aliases.txt foo

or:
	svn propset svn:externals --file list_of_aliases.txt /path/to/repo/

or:
	svn propset svn:externals --file list_of_aliases.txt /path/to/repo/foo

Next, how exactly do I use this?  Let's say that 
'list_of_aliases.txt' contains:

	foo	/path/to/repo/foo
	bar	/path/to/repo/bar
	ff	/path/to/repo/foo/ff

Can I then just say:

	svn co ff
?

Thanks,
	
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



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

Re: Help with svn:externals

Posted by Nicholas Riley <nj...@uiuc.edu>.
On Tue, Oct 22, 2002 at 04:57:03PM -0400, Paul Lussier wrote:
> Can I some how specify I only want to check out bin/, etc/, and lib/ 
> but not mail/ and .netscape/.  Is there a way to create an alias for 
> certain combinations of sub-dirs you want grouped together?  Would 
> that be handled by the 'svn:externals' thing?

Yes.  But instead of creating a module, you'd just create (svn mkdir)
another location in the repository with the appropriate svn:externals
set.  This is a common theme of Subversion: lots of separate concepts
in CVS - tags, branches, modules - are supported in a more free-form
fashion in Subversion according to the layout of your repository.

-- 
=Nicholas Riley <nj...@uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
        Pablo Research Group, Department of Computer Science and
  Medical Scholars Program, University of Illinois at Urbana-Champaign

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

Re: Help with svn:externals

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: Tue, 22 Oct 2002 11:45:40 PDT
Julian Fitzell said:

>> Is there some way to do that with svn?  Check out only portions or
>> certain subdirs of a repository ?
>
>Sure:
>
>svn co /path/to/repos/pll/bin

Oh, so I didn't realize it was that easy.  I wonder if I'm not asking 
the right questions then.  In the article I read, the author 
mentioned using CVS modules and aliases.  I'm wondering now, if 
aliases aren't what I'm after.  He mentioned that he could
checkout his home directory but various portions of it by requesting 
to checkout an alias (at least that's what I understood.

So, he would do something like 'cvs co home-nomail', and that would 
checkout everything but his mail dir; or he could do 'cvs co home-dev'
and that would only check out whatever he needed for sw development
(bin/ etc/ .xemacs/ lib/, etc.)

So, if I can simply 'svn co /path/to/repos/pll/bin', is there a way 
to checkout a portion of all subdirs?  If I have say:

	bin/
	etc/
	lib/
	mail/
	.netscape/

Can I some how specify I only want to check out bin/, etc/, and lib/ 
but not mail/ and .netscape/.  Is there a way to create an alias for 
certain combinations of sub-dirs you want grouped together?  Would 
that be handled by the 'svn:externals' thing?

Thanks,
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



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

Re: Help with svn:externals

Posted by Julian Fitzell <ju...@beta4.com>.
Paul Lussier wrote:
> In a message dated: 22 Oct 2002 11:06:09 CDT
> Karl Fogel said:
> 
> 
>>Also, only subdirectories work right now, so you can't list .emacs in
>>that description, unfortunately.  Sorry about that.
> 
> 
> Bummer :(
> 
> 
>>(Is there some reason you don't just put your home dir under
>>Subversion directly?)
> 
> 
> Well, I was only using that as an example.  My home dir isn't under 
> anything right now (with the exception of few critical files under 
> RCS control).
> 
> I was simply using my home dir as an example because it's a structure 
> (most) everyone understands, and, because of the LJ article which 
> explained how the author kept his home dir under CVS and used modules.
> 
> It sounded like a neat idea, and I figured that putting my home dir 
> under Subversion control would be a great excersise for me to learn
> Subversion.  Since I don't really know CVS, I didn't really grasp the 
> references he made to 'modules' and thought svn's 'svn:externals' was 
> similar in concept.
> 
> I believe the author of the article used CVS modules and aliases to
> allow him to check out only portions of his home directory.  For
> instance, when setting up a new server, you may want to bring over
> your ~/bin/ dir, but not your ~/Mail/, so you could do something like:
> 
> 	cvs co home-bin
> 
> where home-bin were defined in the modules file to be:
> 
> 	home-bin home-cvs/home &bin
> 
> (Or something like that.  I'm guessing on the syntax based on my poor 
> memory of the articel)
> 
> Is there some way to do that with svn?  Check out only portions or
> certain subdirs of a repository ?

[...]

Sure:

svn co /path/to/repos/pll/bin

:)

Julian
-- 
julian@beta4.com
Beta4 Productions (http://www.beta4.com)


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

Re: Help with svn:externals

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: 22 Oct 2002 11:06:09 CDT
Karl Fogel said:

>Also, only subdirectories work right now, so you can't list .emacs in
>that description, unfortunately.  Sorry about that.

Bummer :(

>(Is there some reason you don't just put your home dir under
>Subversion directly?)

Well, I was only using that as an example.  My home dir isn't under 
anything right now (with the exception of few critical files under 
RCS control).

I was simply using my home dir as an example because it's a structure 
(most) everyone understands, and, because of the LJ article which 
explained how the author kept his home dir under CVS and used modules.

It sounded like a neat idea, and I figured that putting my home dir 
under Subversion control would be a great excersise for me to learn
Subversion.  Since I don't really know CVS, I didn't really grasp the 
references he made to 'modules' and thought svn's 'svn:externals' was 
similar in concept.

I believe the author of the article used CVS modules and aliases to
allow him to check out only portions of his home directory.  For
instance, when setting up a new server, you may want to bring over
your ~/bin/ dir, but not your ~/Mail/, so you could do something like:

	cvs co home-bin

where home-bin were defined in the modules file to be:

	home-bin home-cvs/home &bin

(Or something like that.  I'm guessing on the syntax based on my poor 
memory of the articel)

Is there some way to do that with svn?  Check out only portions or
certain subdirs of a repository ?

>It's not very much like CVS modules.  I would stay away from CVS
>modules docs if you're trying to understand svn:externals. :-)

Okay, I figured as much  :)

>You use 'svn propset' or better yet 'svn propedit'.

Okay, thanks!
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



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

Re: Help with svn:externals

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Paul Lussier <pl...@lanminds.com> writes:
> I think so, but it doesn't *have* to external o project A, right?
> For instance, using the homedir example, I could have a repository 
> for my home directory:
> 
> 	/path/to/repos/pll
> 
> Then within the "project" pll, I could have sub dirs:
> 
> 			/bin
> 			/etc
> 			/.emacs
> 			/Mail
> 
> I could then apply an svn:externals tag to each one I could then 
> checkout just my ~/bin directory or just my ~/etc directory ?

I'm not sure what you mean, but maybe this will clear things up:

The svn:externals property does *not* live on the externals themselves
(bin, etc, .emacs, and Mail in the above example).  It lives on the
directory into which you want them to be checked out (pll, I guess).
The value of the property is a description of what you want checked
out into pll.

Also, only subdirectories work right now, so you can't list .emacs in
that description, unfortunately.  Sorry about that.

(Is there some reason you don't just put your home dir under
Subversion directly?)

> I think I'm getting it.  I read the CVS modules section, and that 
> seemed pretty straightforward.  So, is there an equivalent of a CVS 
> modules file, or, do I use 'svn propset' to manage the "svn:externals'
> properties of a repository?

It's not very much like CVS modules.  I would stay away from CVS
modules docs if you're trying to understand svn:externals. :-)

You use 'svn propset' or better yet 'svn propedit'.

-K

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

Re: Help with svn:externals

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: 22 Oct 2002 10:03:59 CDT
Karl Fogel said:

>So if you have a project A that depends on some other project X in
>another repository, you could use svn:externals to check out a working
>copy of X *inside* your working copy of A every time.
>
>Does that help?

I think so, but it doesn't *have* to external o project A, right?
For instance, using the homedir example, I could have a repository 
for my home directory:

	/path/to/repos/pll

Then within the "project" pll, I could have sub dirs:

			/bin
			/etc
			/.emacs
			/Mail

I could then apply an svn:externals tag to each one I could then 
checkout just my ~/bin directory or just my ~/etc directory ?

I think I'm getting it.  I read the CVS modules section, and that 
seemed pretty straightforward.  So, is there an equivalent of a CVS 
modules file, or, do I use 'svn propset' to manage the "svn:externals'
properties of a repository?

Thanks,
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



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

Re: Help with svn:externals

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
pll@lanminds.com writes:
> After reading the svn Handbook section on the svn:externals property 
> tag, I find that I'm still a little confused on what it is good for 
> and how it is used.

They're a way of causing a checkout of directory A to trigger
checkouts of "external" directories A/X, A/Y, etc, where "external"
means that X and Y might come from a different repository than A.  The
value of the svn:externals property specifies exactly where X and Y
come from.

Once X and Y are checked out into A, they will be updated whenever you
run 'svn update' from inside or above them.

So if you have a project A that depends on some other project X in
another repository, you could use svn:externals to check out a working
copy of X *inside* your working copy of A every time.

Does that help?

-K

> I recently read an article in Linux Journal about someone who kept 
> their entire homedir under CVS control and used CVS modules to make 
> it a bit more manageable.
> 
> svn:externals *seems* to be the analgous to CVS modules.  However,
> I know very little about CVS at that level, having simply used it to 
> check out from repos managed by others.  As a result, since I don't 
> even understand that, I find it difficult to grasp the svn:externals 
> stuff as well.
> 
> Could someone be so kind as to explain how/why you would use 
> svn:externals?  If other docs exist explaining it differently 
> than the Handbook, pointers to those would be greatly appreciated as 
> well (would it be worth reading the modules section at red bean?).

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