【问题标题】:Using subrepositories with bitbucket将子存储库与 bitbucket 一起使用
【发布时间】:2011-05-11 16:27:32
【问题描述】:

我在尝试将子存储库推送到 bitbucket 时遇到此错误:

D:\Work\agile.crm.framework>hg push
warning: bitbucket.org certificate with fingerprint 81:2b:08:90:dc:d3:71:ee:e0:7
c:b4:75:ce:9b:6c:48:94:56:a1:fe not verified (check hostfingerprints or web.cace
rts config setting)
http authorization required
realm: Bitbucket.org HTTP
user: the_drow
password:
warning: bitbucket.org certificate with fingerprint 81:2b:08:90:dc:d3:71:ee:e0:7
c:b4:75:ce:9b:6c:48:94:56:a1:fe not verified (check hostfingerprints or web.cace
rts config setting)
pushing to https://the_drow@bitbucket.org/the_drow/agile.crm.framework
pushing subrepo Logging to https://the_drow@bitbucket.org/the_drow/agile.crm.fra
mework/Logging
warning: bitbucket.org certificate with fingerprint 81:2b:08:90:dc:d3:71:ee:e0:7
c:b4:75:ce:9b:6c:48:94:56:a1:fe not verified (check hostfingerprints or web.cace
rts config setting)
abort: HTTP Error 404: NOT FOUND

我遇到过这个link,它描述了如何解决问题,但我不明白该怎么做。
我应该将我的 Logging 子存储库放在 D:\Work\ 中吗?
我究竟应该如何处理 mercurial 子路径?这能让我在本地克隆吗?

编辑: 根据要求,这是我的 .hgsub 文件的内容

Logging = Logging

【问题讨论】:

  • 你能发布你的.hgsub文件的内容吗?
  • 我认为除了您标记为正确的答案之外,答案是更好的答案。您不必根据某些站点的限制来决定将存储库放在哪里。只需使用特殊用途的重写规则来适应该站点的特定限制即可。

标签: mercurial bitbucket mercurial-subrepos


【解决方案1】:

如您发布的链接中所述,“您必须将子存储库作为主存储库的兄弟。”

所以在BitBucket上,你需要如下结构:

https://bitbucket.org/the_drow/agile.crm.framework
https://bitbucket.org/the_drow/Logging

那么你的.hgsub 里面的agile.crm.framework 需要包含以下内容:

Logging = ../Logging

【讨论】:

  • 所以我必须打开另一个存储库?这有点违背这里的目的。
  • @the_drow:添加子存储库意味着子存储库是一个单独的 [项目 |图书馆 |不管] 有它自己的历史。如果您不打算在多个项目中使用 Logging 存储库,那么它首先不应该是子存储库。如果您确实想在多个项目之间共享它,那么它需要自己的空间。
【解决方案2】:

我要提出一个老问题,因为我认为我有更好的解决方案。我理解为什么@the_drow 对原始接受的答案有问题,因为对于Logging = ../Logging,您的本地计算机必须将 Logging 子存储库作为包含/主存储库的对等方。从组织的角度来看,这种方式违背了 subrepos 的目的。但是,如果您使用subpaths feature,您可以让 Mercurial 在推送时为您重写 URI:

external/my_subrepo = external/my_subrepo

[subpaths]
([https://|ssh://hg@])bitbucket\.org/moswald/my_project/external/my_subrepo = \1bitbucket.org/moswald/my_subrepo

现在我的 my_subrepo 子存储库的本地副本按预期存储在 my_project 中,但是当我推送到 Bitbucket 时,它被重新路由到真实的东西。事实上,由于 Mercurial 了解 Git 和 SVN,因此您几乎可以使用该重写功能来指向任何地方。我有多个 Bitbucket 存储库,其中包含其他使用 Github 的作者的子存储库。

【讨论】:

  • 小心!这让我很难过:句号仅在第一个 URL 中转义!等号左边:bitbucket\.org - 等号右边:​​bitbucket.org
  • 好点。是的,这很难完全正确。 :+1:
猜你喜欢
  • 1970-01-01
  • 2015-03-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-02-24
  • 2013-11-12
  • 2013-04-08
相关资源
最近更新 更多