Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single Image File to be SVN Externals

I'm trying to add an image as svn:externals but TortoiseSVN refuses it somehow.

Currently I have two repositories on my local drive named repoA and repoB. Also there are two checkouts of working directories named workA and workB. workA is a checkout of repoA and workB is a checkout of repoB.

The structure is like this:

Z:\repos\repoA

Z:\repos\repoB

Z:\Projects\workA

Z:\Projects\workB

What I did:

  1. right clicked on Z:\Projects\workB -> TortoiseSVN -> Properties
  2. pressed New -> Externals
  3. pressed New, typed trunk/screenshot.jpg for Local Path and file:///Z:/repos/repoA/trunk/screenshot.jpg for URL.

    enter image description here

    enter image description here

  4. pressed OK to close all setting windows.

  5. right clicked on Z:\Projects\workB -> SVN Commit..
  6. right clicked on Z:\Projects\workB -> SVN Update..

And I get this error:

Z:\Projects\workB\trunk\screenshot.jpg

Unsupported external: url of file external

'file:///Z:/repos/repoA/trunk/screenshot.jpg' is not in repository

'file:///Z:/repos/repoB'

enter image description here

When I commit a new change on workB/trunk, it won't update the image. So performing SVN Update on workB/trunk does not import the image from repoA. I also have a folder imported as svn:externals and the files under it are imported properly. So I suspect a single file cannot be specified. I don't know.

In the repo-browser, the real file is not present there is only the link file.

enter image description here

In repoA there is the real image file although the error says there isn't.

enter image description here

So is it possible to do? Or am I doing it in the wrong way?

Update

According to this article,

Subversion 1.6 also introduced support for external definitions for files. File externals are configured just like externals for directories and appear as a versioned file in the working copy.

For example, let's say you had the file /trunk/bikeshed/blue.html in your repository, and you wanted this file, as it appeared in revision 40, to appear in your working copy of /trunk/www/ as green.html.

So it seems to be possible with v1.6 or above. And I'm using svn, version 1.7.6 (r1370777). Additional references:

  • can we set svn:external for a single file in debian
  • Can we set a single file as external in Subversion?
like image 324
Teno Avatar asked Oct 14 '12 19:10

Teno


2 Answers

I think this is because you can't use external files feature between two different repositories (RepoA and repoB in your example).

Have a look to this limitation in the official doc:
http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-externals.html

Abstract:

The URL for a file external must be in the same repository as the URL that the file external will be inserted into; inter-repository file externals are not supported.

like image 101
TridenT Avatar answered Oct 16 '22 12:10

TridenT


I had the same problem, it seems that you used to be able to have external files in Subversion 1.6 but that 'bug' is now fixed in subversion 1.7! and you can only have external folders from one repo to another, NOT files

like image 41
Dwaindibbley Avatar answered Oct 16 '22 14:10

Dwaindibbley