将子存储库与bitbucket和ToritoiseHg一起使用 [英] Using subrepositories with bitbucket and ToritoiseHg

查看:119
本文介绍了将子存储库与bitbucket和ToritoiseHg一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在TortoiseHg中具有以下子存储库结构:

I have subrepository structure as following in TortoiseHg:

/MainFolder/
/MainFolder/SubFolder1
/MainFolder/SubFolder2

MainFolder是bitbucket上的私有存储库 SubFolder1是bitbucket上的私有存储库 SubFolder2是bitbucket上的私有存储库

MainFolder is a private repository on bitbucket SubFolder1 is a private repository on bitbucket SubFolder2 is a private repository on bitbucket

MainFolder中的.hgsub文件如下所示:

The file .hgsub inside MainFolder looks like this:

SubFolder1 = SubFolder1
SubFolder2 = SubFolder2

MainFolder中的文件.hgsubstat也具有有效的向导和子存储库名称.

The file .hgsubstat inside MainFolder also have valid guids and subrepository names.

问题是,每当我尝试为MainFolder推送到Bitbucket时,首先先推送MainFolder,然后再推送SubFolder1,但是当它到达SubFolder2时,TortoiseHg会抛出错误中止:存储库无关".

The problem is whenever I try to push to bitbucket for MainFolder, first it pushes the MainFolder, then SubFolder1, but when it gets to SubFolder2, TortoiseHg throws error "abort: repository is unrelated".

当我在bitbucket上检查MainFolder存储库时,它实际上具有SubFolder1的内容(应该在此处作为子存储库列出).

When i check my MainFolder repository on bitbucket, it has actually contents of SubFolder1 (it should be listed there as subrepository).

如何解决此问题,以便正确将MainFolder作为父存储库上载,并将SubFolder1和SubFolder2列为其在Bitbucket上的子存储库?

How can I fix this so that the MainFolder is correctly uploaded as parent repository and SubFolder1 and SubFolder2 are listed as its sub-repository on bitbucket?

推荐答案

bitbucket中显示的示例文档要求重命名存储库,以便所有存储库都命名为 MainRepository-SubRepository .我不想重命名所有存储库,因此修改了正则表达式,如下面的示例所示,它现在可以正常工作.此版本不需要在存储库名称中使用破折号,主存储库和子存储库可以独立命名.示例.hgsub看起来像这样:

The example shown in bitbucket documentation requires to rename repositories so that all the repositories are named as MainRepository-SubRepository. I didn't want to rename all my repositories so modified the regular expression as shown in following example and it works correctly now. This version doesn't require the dash separator in repository name, Main repository and sub repositories can be named independently. The example .hgsub looks like this:

SubFolder1 = SubFolder1
SubFolder2 = SubFolder2
[subpaths]
(https://(?:[^@]+@)?bitbucket\.org/[^/]+)(/[^/]+)/(.*) = \1/\3

这篇关于将子存储库与bitbucket和ToritoiseHg一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆