You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by André Hänsel <an...@webkr.de> on 2011/08/02 03:54:23 UTC

Do svn:externals changes need to be committed to work?

I am trying to add an svn:externals definition to a working copy. I set the
property on a directory and ran svn update on that directory, but nothing is
fetched.

I found this article:
http://blogs.gnome.org/johannes/2008/02/20/svnexternals-for-noobs/
However, from other documentation it's unclear to me if a commit is really
necessary for svn:external to work. Of course, I don't want to commit an
untested external definition.

I am using TortoiseSVN 1.6.15 built with Subversion 1.6.16.


AW: Do svn:externals changes need to be committed to work?

Posted by André Hänsel <an...@webkr.de>.
Stefan Sperling wrote:
> 
> On Tue, Aug 02, 2011 at 03:54:23AM +0200, André Hänsel wrote:
> > I am trying to add an svn:externals definition to a working copy. I
> > set the property on a directory and ran svn update on that directory,
> > but nothing is fetched.
> >
> > I found this article:
> > http://blogs.gnome.org/johannes/2008/02/20/svnexternals-for-noobs/
> > However, from other documentation it's unclear to me if a commit is
> > really necessary for svn:external to work. Of course, I don't want to
> > commit an untested external definition.
> >
> > I am using TortoiseSVN 1.6.15 built with Subversion 1.6.16.
> 
> With Subversion 1.6, if you put the svn:externals property on a locally
> added directory you'll need to commit the directory before 'svn update'
> will fetch the externals.
> 
> This has been fixed in Subversion 1.7, see:
> http://subversion.tigris.org/issues/show_bug.cgi?id=2267

Uh, thanks. That's it, I didn't commit the folder before creationg the
property.



Re: Do svn:externals changes need to be committed to work?

Posted by Stefan Sperling <st...@elego.de>.
On Tue, Aug 02, 2011 at 03:54:23AM +0200, André Hänsel wrote:
> I am trying to add an svn:externals definition to a working copy. I set the
> property on a directory and ran svn update on that directory, but nothing is
> fetched.
> 
> I found this article:
> http://blogs.gnome.org/johannes/2008/02/20/svnexternals-for-noobs/
> However, from other documentation it's unclear to me if a commit is really
> necessary for svn:external to work. Of course, I don't want to commit an
> untested external definition.
> 
> I am using TortoiseSVN 1.6.15 built with Subversion 1.6.16.

With Subversion 1.6, if you put the svn:externals property on a locally
added directory you'll need to commit the directory before 'svn update'
will fetch the externals.

This has been fixed in Subversion 1.7, see:
http://subversion.tigris.org/issues/show_bug.cgi?id=2267

You can try out a pre-release version of 1.7 if you need this feature ASAP.
http://subversion.apache.org/packages.html#pre-release
If you do so, please help improve the final 1.7.0 release by reporting
any problems you find while using the pre-release version. Thanks!

Re: Do svn:externals changes need to be committed to work?

Posted by Geoff Hoffman <gh...@cardinalpath.com>.
Hey André,

On Mon, Aug 1, 2011 at 6:54 PM, André Hänsel <an...@webkr.de> wrote:

> I am trying to add an svn:externals definition to a working copy. I set the
> property on a directory and ran svn update on that directory, but nothing
> is
> fetched.
>

One of my favorite topics.

svn:externals is tricky to understand and use at first but very powerful and
worth learning.

The syntax is

svn propset svn:externals 'A B' C

Where:
 A is the name of the folder you want your external reference checked out
into (created);
 B is the URL to the external repository dir you want to reference in the
current working dir;
 C is the path to the local working dir folder on which you want to set the
svn:externals property

I think you created the folder first - let your externals definition create
the folder 'A'.

An example (from [2])

svn propset svn:externals 'akismet
http://plugins.svn.wordpress.org/akismet/trunk' .


Note the dot at the end. In this example, the svn:externals property is
being set on the current folder (probably htdocs/wp-plugins - just a hunch)

What most examples don't show you is to cd into the directory you want to
set the property on first then call it '.'  (no quotes, dot = current dir)

Also the SVN Book[1] says because this property is multi-line, better off
using svn editor (vi) versus trying it all on the command line as it is
"extra tricky" to do this way.

You can see why this is important; if you wanted to load all the wp-plugins
from their source repos you would need multiple svn:externals set on the
wp-plugins dir, one for akismet, another for w3 total cache, and so on. It
is *very* easy to accidentally erase all of the previously set externals
definitions if you try this on the command line.

Due to this I strongly recommend to use your IDE to load the existing
property value, edit it as desired, then save/set/apply/update.


I found this article:
> http://blogs.gnome.org/johannes/2008/02/20/svnexternals-for-noobs/
> However, from other documentation it's unclear to me if a commit is really
> necessary for svn:external to work. Of course, I don't want to commit an
> untested external definition.
>
> I am using TortoiseSVN 1.6.15 built with Subversion 1.6.16.
>


The order is, you apply the property with propset (you have just modified
only the property of the directory, nothing else.)
Svn status shows you '.' is modified. or 'wp-plugins' is modified.
Next, do an svn update. Your content from external repo defined, comes
streaming down, and `akismet` folder is created in
htdocs/wp-plugins/akismet.
Svn status still shows you only '.' is modified. or 'wp-plugins' is
modified.
Now, commit - only the dir props are commited

If your external code is also your own code (your own shared library in
another repo you control, for example) be very careful when changing stuff
in [working copy] and [external code] in same commit. Most IDEs will let you
do this, but warn 'You're about to commit to multiple repositories...' This
may be exactly what you want, but often it is not.


I recommend reading these

[1] http://svnbook.red-bean.com/en/1.5/svn.advanced.externals.html

[2]
http://beerpla.net/2009/06/20/how-to-properly-set-svn-svnexternals-property-in-svn-command-line/

HTH -

RE: Do svn:externals changes need to be committed to work?

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Markus Schaber [mailto:m.schaber@3s-software.com]
> Sent: dinsdag 2 augustus 2011 10:27
> To: André Hänsel; users@subversion.apache.org
> Subject: AW: Do svn:externals changes need to be committed to work?
> 
> Hi, André,
> 
> Von: André Hänsel [mailto:andre@webkr.de]
> > I am trying to add an svn:externals definition to a working copy. I set
> > the property on a directory and ran svn update on that directory, but
> > nothing is fetched.
> >
> > I found this article:
> > http://blogs.gnome.org/johannes/2008/02/20/svnexternals-for-noobs/
> > However, from other documentation it's unclear to me if a commit is
really
> > necessary for svn:external to work. Of course, I don't want to commit an
> > untested external definition.
> >
> > I am using TortoiseSVN 1.6.15 built with Subversion 1.6.16.
> 
> From my experience with Subversion 1.6, the directory needs to be
> committed, but not the svn:external definition itsself.
> 
> So maybe you can commit the empty directory, and then add the externals
> properties and test them before committing them.

In Subversion 1.7 externals definitions don't have to be committed to work
correctly. In 1.6 I would recommend committing them before applying, but in
many cases it will work if you don't do that.


We integrated the tracking of which externals a working copy has in the new
working copy store. The next 'svn update' will apply the changes even if the
directory on which they are defined was never committed.

	Bert



AW: Do svn:externals changes need to be committed to work?

Posted by Markus Schaber <m....@3s-software.com>.
Hi, André,

Von: André Hänsel [mailto:andre@webkr.de]
> I am trying to add an svn:externals definition to a working copy. I set
> the property on a directory and ran svn update on that directory, but
> nothing is fetched.
> 
> I found this article:
> http://blogs.gnome.org/johannes/2008/02/20/svnexternals-for-noobs/
> However, from other documentation it's unclear to me if a commit is really
> necessary for svn:external to work. Of course, I don't want to commit an
> untested external definition.
> 
> I am using TortoiseSVN 1.6.15 built with Subversion 1.6.16.

>From my experience with Subversion 1.6, the directory needs to be committed, but not the svn:external definition itsself.

So maybe you can commit the empty directory, and then add the externals properties and test them before committing them.

Best regards

Markus Schaber

___________________________
We software Automation.

3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50

Email: m.schaber@3s-software.com | Web: http://www.3s-software.com 
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects

Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915