乌龟和子存储库
我无法让 Tortoisehg (1.0) 与子存储库一起工作
我有一个这样的目录结构:
root
.hg
.hgsub
.hgsubstate
Customer1
Project1
.hg
foo.txt
Project2
.hg
Customer2
Project3
.hg
根目录下的 .hgsub 文件看起来像
Customer1\Project1=Customer1\Project1
Customer1\Project2=Customer1\Project2
Customer2\Project3=Customer2\Project3
如果修改文件 Customer1\Project1\foo.txt
并提交它在 Tortoisehg customer1\project1
中工作的根
>hg ci -m "command line commit"
committing subrepository customer1\project1
显示状态为 S
(subrepo) 但是在提交时我收到一条消息
abort: customer1/project1: no match under directory!
是否不支持这种情况或者我做错了什么?
医生说:
“TortoiseHg 1.0 引入了对子存储库的基本支持,并且仅在提交/状态工具中提供。当 Mercurial 认为子存储库为脏时,它将作为文件列表中的特殊条目出现在文件列表中,状态为 S。如果某个子存储库包含在提交的文件列表中,则该子存储库将与其他更改一起提交,从而更新主存储库根目录中的 .hgsubstate 文件。”
I can't get Tortoisehg (1.0) to work with subrepos
I have a directory structure like this:
root
.hg
.hgsub
.hgsubstate
Customer1
Project1
.hg
foo.txt
Project2
.hg
Customer2
Project3
.hg
the .hgsub file under root looks like
Customer1\Project1=Customer1\Project1
Customer1\Project2=Customer1\Project2
Customer2\Project3=Customer2\Project3
If modify the file Customer1\Project1\foo.txt
and commit from the root it works
>hg ci -m "command line commit"
committing subrepository customer1\project1
in Tortoisehg customer1\project1
is displayed with status S
(subrepo)
but when commiting I get a message
abort: customer1/project1: no match under directory!
Is this scenario not supported or am I doing something wrong?
The doc says:
"TortoiseHg 1.0 introduced rudimentary support for subrepositories, and only in the commit / status tool. When Mercurial considers a subrepo as dirty, it will appear in the commit tool as a special entry in the file list with a status of S. If a subrepo is included in the file list of a commit, the subrepo is committed along with the other changes, updating the .hgsubstate file in the main repository root."
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我遇到了几乎相同的问题,并开始尝试一大堆变体,最终通过在等号两侧使用正斜杠(/)而不是在任何地方使用反斜杠(\),它对我有用。
所以尝试...
另外,当它不起作用时,我的 .hgsubstate 文件中只有一堆零。当它开始工作时,里面有一个真正的 GUID。
I had pretty much the same problem and started trying a whole bunch of variations and I finally got it working for me by using a forward-slash (/) on both sides of the equals sign and not a back-slash (\) anywhere.
So try...
Also, when it was not working, my .hgsubstate file only had a bunch of zeros in it. When it started working, it had a genuine GUID in it.
通过使用主存储库的命令行提交,我能够解决这个问题。
I was able to get past this problem by committing using the command line for the main repo.
我遇到了同样的问题:
在我的一个存储库中,提交更改的子存储库模块之一失败并显示消息
原因:
TortoiseHG 无法提交到子存储库,因为它处理文件夹名称区分大小写!
例子:
您的原始存储库:
通过命令行将其作为子存储库克隆到另一个存储库
中将在您的父存储库中创建一个子存储库文件夹mysubrepo。
像往常一样将其添加到 .hgsub 文件中(我总是使用独立于平台的“/”而不是“\”,所以我认为这不是错误的原因)。
尝试使用 --subrepos TortoiseHG 提交将最终得到“目录下不匹配!”错误。但是,通过命令行提交是有效的。
重命名 subrepo 文件夹 mysubrepo 为 MySubRepo(与大写的原始文件夹一样)后,TortoiseHg 就可以成功提交!
也许您还必须在 hgrc 文件中编辑文件夹名称,但我不确定这是否真的有必要,因为我在弄清楚之前在文件中重命名了它,有 canse-sensitive文件夹名称本身的差异。还可能需要从 TortoiseHg Workbench 的存储库注册表中删除存储库并读取它(和/或重新启动工作台)。
I had the same problem:
In one of my repositories committing of one of my changed subrepo modules failed with message
The reason:
TortoiseHG fails to commit to the subrepository because it handles folder names case-sensitive!
Example:
Your original repository:
Cloning this as a subrepo into another repository by command line
will create a subrepo folder mysubrepo inside your parent repository.
Adding it to the .hgsub file as usual (I always use the platform independent '/' instead of '\', so I don't think that's the reason for the error).
Trying to commit with --subrepos TortoiseHG will end up with the "no match under directory!" error. However, commiting by command line works.
After renaming the subrepo folder mysubrepo to MySubRepo (as the original folder with upper cases) TortoiseHg could commit successfully!
Maybe you have to edit the folder name also in the hgrc file, but I'm not sure if this is really neccessary, because I renamed it in the file before figuring out, that there are canse-sensitive differences in the folder name iteself. Also removing the repository from TortoiseHg Workbench's repository registry and readding it may be needed (and/or restart of the Workbench as well).
我认为您的问题在于将 "Customer1\Project1" 指定为子存储库,因为 Customer1 也应该是嵌套存储库。
Customer1 和 Customer2 都应具有描述其中子存储库的“.hgsub”文件 (Project1/2)
重新制作您的 Customer1Project1 和 Project2 克隆到其他地方。将 Project1 和 Project2 条目添加到 Customer1 内的“.hgsub”文件中。
然后对 Customer2 存储库执行相同的操作。
请记住,嵌套存储库本身可以嵌套,因此创建一个“根”存储库,然后将 Customer1 和 Customer2 克隆到其中,记住将条目添加到.hgsub 文件。
提交“root”,你应该没问题。
关键是将更改从子存储库的所有实例推送到其克隆主机,以便包含该子存储库的其他克隆能够在需要时提取该修订版。
我将所有主存储库都放在计算机上的同一父文件夹中,因此可以将相对路径放入“.hgsub”文件(例如“../Project1”或“../Customer1”)中,从而将更改推送到本地克隆的简单方法来自我们的中央服务器。
就使用 TortoiseHG 而言,您可以使用 v1.0,因为它会在嵌套存储库中创建和管理“.hgsubstate”文件只要您已经创建了“.hgsub”文件!
I think your problem is with specifying "Customer1\Project1" as a sub repository because Customer1 should be a nested repository as well.
Customer1 and Customer2 should both have '.hgsub' files describing the subrepos inside them (Project1/2)
Remake your Customer1 repository elsewhere and clone Project1 and Project2 into it. Add Project1 and Project2 entries to the '.hgsub' file within Customer1.
Then do the same for a Customer2 repository.
Remember that nested repositories can themselves be nested so create a 'root' repository and then clone Customer1 and Customer2 into it remembering to add entries to the .hgsub file.
Commit 'root' and you should be fine.
The key is to push changes from all instances of a subrepos to its clone master so that other clones that include that subrepos are able to pull that revision if needed.
I have all master repos in the same parent folder on my machine so it makes putting relative paths inside '.hgsub' files such as '../Project1' or '../Customer1' a simple way to push changes to my local clones from our central server.
As far as using TortoiseHG, you will be fine with v1.0 as it will create and manage the '.hgsubstate' file in a nested repository as long as you have already created the '.hgsub' file!
添加我的 2 美分。
在以下情况下,我在 Windows 上收到此错误
abort: customer1/project1: no match under directory
:MyFolder
的文件夹中(注意大写)myfolder/filename.ext
提交(注意小写)一切正常,命令行提交工作正常,但乌龟抱怨道。
重命名文件(使用
hg status --all
找到小写文件,就可以了)Adding my 2 cents.
I was receiving this error
abort: customer1/project1: no match under directory
on Windows in the following scenario:MyFolder
(note the upper case)myfolder/filename.ext
(note the lowercase)Everything works fine, commandline commits work fine, but Tortoise complains.
Rename the files (find the lowercase ones using
hg status --all
and you're fine)