在Windows中使用SVN设置SVN:Externals [英] Setting Up SVN:Externals with TortoiseSVN in Windows
问题描述
我正在尝试在Windows计算机上使用TortoiseSVN设置svn:externals
.我有两个项目,并且两个存储库都已在同一本地计算机上创建.
I'm trying to set up svn:externals
with TortoiseSVN on a Windows machine. I have two projects and both repositories have been already created on the same local machine.
当前结构如下所示.我为存储库创建了repoA
,repoB
,并为工作目录(检出)创建了workA
和workB
.
The current structure looks like this. I created repoA
, repoB
for repositories and workA
and workB
for working directories (checkouts).
存储库
Z:\ repos \ repoA
Z:\repos\repoA
Z:\ repos \ repoB
Z:\repos\repoB
工作目录
Z:\ Projects \ workA \ trunk \ core.php
Z:\Projects\workA\trunk\core.php
Z:\ Projects \ workA \ trunk \ lib \ lib01.php
Z:\Projects\workA\trunk\lib\lib01.php
Z:\ Projects \ workB \ trunk \ core_mod.php
Z:\Projects\workB\trunk\core_mod.php
Z:\ Projects \ workB \ trunk \ lib \
Z:\Projects\workB\trunk\lib\
(有tags
和branches
文件夹,但为使问题简单起见,省略了它们.)
(there are tags
and branches
folders but they are omitted to keep the question simple.)
我要实现的是在这种情况下lib01.php
下的workA\trunk\lib\
下的文件,这些文件会自动复制到workB\trunk\lib\
目录中.
What I'd like to achieve is the file(s) under workA\trunk\lib\
in this case lib01.php
to be automatically copied into the workB\trunk\lib\
directory.
为了进行设置,我要做的如下:
In order to set this up, what I've done is as follows:
- 检出
workA
并将其分配给repoA
,检出workB
并将其分配给repoB
- 提交了
workA\trunk
文件夹,以便repoA
是最新的. - 在oreder中为
workB\trunk\lib
分配导入位置,右键单击workB
文件夹并选择TortoiseSVN -> Properties
. - 点击
New -> Externals
并点击New...
-
在
Local path
表单字段中键入./trunk/lib
.对于URL
字段,键入file:///Z:/repos/repoA/trunk/lib
.按下...
按钮,浏览器浏览器打开,并帮助选择目标文件夹.
- Checked out
workA
and assigned it torepoA
and checked outworkB
and assigned it torepoB
- Comitted the
workA\trunk
folder so therepoA
is up to date. - In oreder to assign an import location for
workB\trunk\lib
, right clicked on theworkB
folder and choseTortoiseSVN -> Properties
. - Clicked on
New -> Externals
and clickedNew...
typed
./trunk/lib
in theLocal path
form field. For theURL
field, typedfile:///Z:/repos/repoA/trunk/lib
. By pressing the...
button, repo-browser opened and helped to select the target folder.
单击Ok
几次以关闭设置窗口.我以为外部设置已经完成.
Clicked Ok
a few times to close the settings windows. I assumed the externals setting was done.
我期望此时,lib01.php将自动导入到Z:\Projects\workB\trunk\lib
文件夹中,但不会复制任何内容.我还通过右键单击workB\trunk
文件夹来尝试SVN Update
.但是workB\trunk\lib
文件夹保持为空.
I expected at this point, the lib01.php would be automatically imported in the Z:\Projects\workB\trunk\lib
folder but nothing is copied. I also tried SVN Update
by right clicking on the workB\trunk
folder. But the workB\trunk\lib
folder kept empty.
我怀疑相对路径./trunk/lib
一定是错误的.我不知道.如果您能指出我做错了什么,将不胜感激.
I suspect the relative path ./trunk/lib
must be mistaken. I don't know. If you can point out what I'm doing wrong, it would be appreciated.
更新
6a-提交将工作副本WorkB更改为回购
6a - commit changed Working Copy WorkB to repo
对我来说这是一个盲点.我右键单击Z:\Projects\workB
并选择SVN Commit...
,它给出了以下错误.
This was a blind spot for me. I right clicked on Z:\Projects\workB
and selected SVN Commit...
and it gave the following error.
立即单击确定"按钮后,出现一个对话框,询问是否更新文件夹,然后单击确定".然后TortoiseSVN开始更新Z:\Projects\workB
,并且出现此错误.但是在此之后,当我重新提交Z:\Projects\workB
时,它没有出现错误.
After clicking the OK button immediately I got a dialog window asking whether to update the folder and I clicked OK. Then TortoiseSVN started updating Z:\Projects\workB
and I got this error. But after this, when I re-commited Z:\Projects\workB
, it went through without an error.
(我想,"trunk/lib"在您的情况下会更防弹).
("trunk/lib" in your case will be more bulletproof, I suppose).
谢谢,当我重新选择workB
文件夹的Property
并单击svn:externals
的Edit
按钮时,TortoiseSVN自动将./trunk/lib
调整为trunk/lib
.现在将是这样.
Thanks, when I reselected Property
of the workB
folder and clicked on the Edit
button for the svn:externals
, TortoiseSVN automatically adjusted ./trunk/lib
to trunk/lib
. Now it is set to be so.
6b-在RepoB上用repobrowser测试(这是最快的方法),定义正确
6b - test with repobrowser on RepoB (just fastest way), that definition is correct
我右键单击Z:\repos\repoB
,然后选择TortoiseSVN -> repo-browser
,然后向下浏览到主干文件夹.看起来如下.看起来对不对?我真的不知道,因为我从未从事过此任务.主干文件夹下的lib文件夹在回购浏览器中为空.
I right clicked on Z:\repos\repoB
and chose TortoiseSVN -> repo-browser
and browsed down to the trunk folder. It looks as follows. Does it look right? I really don't know since I never had worked on this task. The lib folder under the trunk folder is empty in the repo-browser.
Z:\Projects\workB\trunk\lib
文件夹仍然为空.该错误消息建议重新定位"Z:\ Projects \ workB",但我不确定它的含义.
The Z:\Projects\workB\trunk\lib
folder is still empty. The error message suggests to relocate 'Z:\Projects\workB' but I'm not sure what it means.
推荐答案
您忘记了至少一项强制性操作
You forgot at least one mandatory action
6a-提交将工作副本WorkB更改为回购
6a - commit changed Working Copy WorkB to repo
和一个可选的检查点
6b-在RepoB上用repobrowser测试(这是最快的方法),定义正确
6b - test with repobrowser on RepoB (just fastest way), that definition is correct
不记得为什么,但是我从来没有在TSVN中的URL的路径规范中使用./(我想在您的情况下,"trunk/lib"会更安全).和纯粹的个人习惯-我在安装时定义了外部,即使结果是在回购中得到了多个定义,而不是在根中聚合了一个
Can't recall why, but I never use ./ in path-spec for URLs in TSVN ("trunk/lib" in your case will be more bulletproof, I suppose). And pure personal habits - I define external at the point of mount, even if as result I get multiple definitions inside repo instead one aggregated in root
在树中显示外部和定义的回购浏览器
Repo-browser with external in tree and definition shown
这篇关于在Windows中使用SVN设置SVN:Externals的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!