简体   繁体   中英

Symbolic link in svn working copy for a switched directory

I work on several (2-20) projects of non-shared-ancestry in a single repo, that share common resources of GBs of binary data stored in the repository at only a single place. These projects utilize svn switch to map their appropriate folder to the single svn URL where they share the binary data.

I want to do the same in my working copies when more than one is checked out, thus avoiding redownloading the same GBs of binary data I already have.

(Note: Another bad news is that the projects also utilize an svn 1.7 executable in order to modify themselves.)

what I did

What I've done is checking out project A , do the switch -es; then check out project B , but instead of regular switch, do svn switch --set-depth=empty --ignore-ancestry http://foobar , so this working copy of project B knows where it should point to. Then, I did mv foobar old_foobar and mklink /D foobar ../project_A/foobar . (1)

the problem now

The problem is now that if I do svn status in the wc with the symbolic link, it lists all the files in "foobar " as non-versioned (as ? status).

I also use TortoiseSVN and it shows the icon overlay as yellow triangular "!" (meaning perhaps confilcted?), but I have no actual conflict (nor tree conflict) in svn status and if I do svn up in "foobar", it says that it is up-to-date.

constraints

The binary file containers do not change very often and even if they do, the changes are usually backward-compatible. Thus it is not a problem (for me, at least) that the working copy has a wrong idea about the file version in them.

I should not change the project or repo structure as I am not allowed to do that "officially".

I use svn 1.7 and since the projects actually utilize a self-contained svn executable binary for work on themselves, I would like to stick to that if possible.

question

Is there a way to utilize symbolic links (or anything else) in order to avoid duplicating the same GBs of data on my hard drive? (Also avoiding downloading it if possible.)


(1): I'm on Windows; for easyness, let's say the that in my file system , folders "project_B" and "project_A" are neighbours ie. share a single common ancestor and that folder foobar is top level in both projects.

We have a situation where multiple projects may be nested inside each other.

The solution we used might work well for you;

  1. For a project, check it out of the repository as normal.
  2. Create a svn:ignore entry for the path that will contain the data, and make sure that path isn't tracked.
  3. Check out the data to that path.
  4. For additional projects, do step 1 and 2, but create a symlink instead.

Now all your projects will just ignore those extra files, but you can still manage the data through svn.

Yes, it means you'll need to remember to svn update && svn update data/ to be sure your project is completely up to date, but it's not much of a hassle.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM