Single Image File to be SVN Externals
Asked Answered
B

2

10

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:

Backus answered 14/10, 2012 at 19:20 Comment(0)
O
11

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.

Oldwife answered 14/10, 2012 at 19:46 Comment(5)
you can't use external files feature between two different repositories - It doesn't make sense to me because the lib folder is an externals and it is imported from repoA. Ahd files under the lib folder are imported without errors. How I've set up the lib folder as svn:externals is described in this question: #12861582Backus
Externals files (direct external on file) is a different feature from Externals folders (with files inside). Maybe this is where you are confused ?Oldwife
Externals files (direct external on file) is a different feature from Externals folders (with files inside). - This is the question. Where does it say a file cannot be an externals but a directory can (also files under the directory can)?Backus
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. Also this page tells that SVN had an issue with file externals in earlier versions prior to v1.6. I ran svn --version and it says svn, version 1.7.6 (r1370777) So the version I'm using seems to be okay.Backus
I presume this is a limitation of the subversion clients, rather than of the subversion server. Where do I look to see if the custodians of subversion are planning of fixing this? Going from 1.8.13 to 1.9.2 did not seem to fix the problem.Conspicuous
S
1

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

Sensual answered 4/5, 2013 at 14:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.