简体   繁体   English

SVN工作副本中已切换目录的符号链接

[英]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. 我在单个存储库中处理了几个(2-20)个非共享祖先项目,这些项目仅在一个地方共享存储在资源库中的GB二进制数据的公共资源。 These projects utilize svn switch to map their appropriate folder to the single svn URL where they share the binary data. 这些项目利用svn switch将其适当的文件夹映射到共享二进制数据的单个svn URL。

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. 当要签出多个副本时,我想在工作副本中执行相同的操作,从而避免重新下载已经拥有的相同GB的二进制数据。

(Note: Another bad news is that the projects also utilize an svn 1.7 executable in order to modify themselves.) (注意:另一个坏消息是,这些项目还利用svn 1.7可执行文件进行修改。)

what I did 我做了什么

What I've done is checking out project A , do the switch -es; 我完成的工作是检出项目A ,执行-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. 然后检出项目B ,而不是常规切换,而不是svn switch --set-depth=empty --ignore-ancestry http://foobar ,因此项目B的此工作副本知道应该指向何处。 Then, I did mv foobar old_foobar and mklink /D foobar ../project_A/foobar . 然后,我做了mv foobar old_foobarmklink /D foobar ../project_A/foobar (1) (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). 现在的问题是,如果我做svn status与符号链接的厕所,它会列出所有文件中的“foobar的”非版本(如?状态)。

I also use TortoiseSVN and it shows the icon overlay as yellow triangular "!" 我也使用TortoiseSVN,它将图标叠加层显示为黄色三角形“!”。 (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. (意味着可能已被混淆?),但我在svn status没有实际冲突(也没有树冲突),如果我确实在“ foobar”中进行了svn up攻击,则表示它是最新的。

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. 我使用的是svn 1.7 ,由于这些项目实际上是使用一个自包含的svn可执行二进制文件来进行自身的工作,因此,我尽可能地坚持这一点。

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? 有没有一种方法可以利用符号链接(或其他方式)来避免在硬盘驱动器上复制相同的GB数据? (Also avoiding downloading it if possible.) (如果可能,也避免下载。)


(1): I'm on Windows; (1):我在Windows上; for easyness, let's say the that in my file system , folders "project_B" and "project_A" are neighbours ie. 为了简便起见,假设在我的文件系统中 ,文件夹“ project_B”和“ project_A”是邻居。 share a single common ancestor and that folder foobar is top level in both projects. 共享一个共同的祖先,并且该文件夹foobar在两个项目中都是顶层。

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. 为将包含数据的路径创建一个svn:ignore条目,并确保未跟踪该路径。
  3. Check out the data to that path. 签出到该路径的数据。
  4. For additional projects, do step 1 and 2, but create a symlink instead. 对于其他项目,请执行步骤1和2,但应创建一个符号链接。

Now all your projects will just ignore those extra files, but you can still manage the data through svn. 现在,您所有的项目都将忽略这些多余的文件,但是您仍然可以通过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. 是的,这意味着您需要记住svn update && svn update data/以确保您的项目是最新的,但这并没有什么麻烦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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