Home About. Go to the root of the folder you want to add the externals too. You will now see the subversion properties dialog. Click the N ew.. You will now see the Add properties dialog. Select svn:externals from the property name drop down list. Enter the name you want to give to the external folder followed by the path to your tools repository in property value text area. Be aware, too, that if you need to reparent your working copy using svn relocate , externals definitions will not also be reparented.
Subversion 1. As mentioned earlier, the URLs used in the new externals definition format can be relative, and Subversion provides syntax magic for specifying multiple flavors of URL relativity. Relative to the URL of the directory on which the svn:externals property is set. Relative to the root of the repository in which the svn:externals property is versioned.
Relative to the scheme of the URL of the directory on which the svn:externals property is set. Relative to the root URL of the server on which the svn:externals property is versioned. Relative to a sibling repository beneath the same SVNParentPath location as the repository in which the svn:externals is defined. So, looking a fourth time at our previous externals definition example, and making use of the new absolute URL syntax in various ways, we might now see:.
First, it added a quoting and escape mechanism to the syntax so that the path of the external working copy may contain whitespace.
This was previously problematic, of course, because whitespace is used to delimit the fields in an externals definition. Of course, if you have spaces in the URL portion of the external definition, you should use the standard URI-encoding mechanism to represent those. File externals are configured just like externals for directories and appear as a versioned file in the working copy.
As you can see in the previous output, Subversion denotes file externals with the letter E when they are fetched into the working copy, and with the letter X when showing the working copy status.
While directory externals can place the external directory at any depth, and any missing intermediate directories will be created, file externals must be placed into a working copy that is already checked out. When examining the file external with svn info , you can see the URL and revision the external is coming from:. Because file externals appear in the working copy as versioned files, they can be modified and even committed if they reference a file at the HEAD revision.
The committed changes will then appear in the external as well as the file referenced by the external. However, in our example, we pinned the external to an older revision, so attempting to commit the external fails:.
Keep this in mind when defining file externals. If you need the external to refer to a certain revision of a file you will not be able to modify the external. If you want to be able to modify the external, you cannot specify a revision other than the HEAD revision, which is implied if no revision is specified. Unfortunately, the support which exists for externals definitions in Subversion remains less than ideal.
Besides the common sense aspect of not being surprised by changes to third-party repositories that you might not have any control over, using explicit revision numbers also means that as you backdate your working copy to a previous revision, your externals definitions will also revert to the way they looked in that previous revision, which in turn means that the external working copies will be updated to match the way they looked back when your repository was at that previous revision.
For software projects, this could be the difference between a successful and a failed build of an older snapshot of your complex code base. The edit dialog for svn:externals properties allows you to select the externals and automatically set them explicitly to the HEAD revision.
If the external project is in the same repository, any changes you make there will be included in the commit list when you commit your main project. If the external project is in a different repository, any changes you make to the external project will be shown or indicated when you commit the main project, but you have to commit those external changes separately. If you use absolute URLs in svn:externals definitions and you have to relocate your working copy i.
To avoid such problems, Subversion clients version 1. Four different methods of specifying a relative URL are supported.
These URLs always begin with the string.. Note that the URL is relative to the URL of the directory with the svn:externals property, not to the directory where the external is written to disk. You can easily refer to other repositories with the same SVNParentPath a common directory holding several repositories.
For example:. Find centralized, trusted content and collaborate around the technologies you use most. Connect and share knowledge within a single location that is structured and easy to search. I already know how to use them in a basic way myself, but I want a good article that I can link to when answering questions like this one that come up recently:.
What to do with multiple projects depending on the same source? I'd do it myself, but I don't use them often enough to want to stick my neck out and write a tutorial on it. Google was surprisingly unhelpful with this topic. This is the svnbook page on svn:externals. It is the most useful resource on the subject. This one explains four ways to include sub-projects in the workflow and in the process misses a fifth one: symlinks. And this last one is a TortoiseSVN-specific page on how to import stuff in a repository not directly related to svn:externals.
In case it isn't clear from the links provided above, the way you set the svn:externals property that is tied to a particular revision pinning , here it is:. There is a Red Bean article that suggests using propedit since the svn:externals can be a multi-line value.
0コメント