2011-05-11 55 views
5

使用subrepositories試圖推動一個subrepository到到位桶時,我也遇到了這個錯誤:與到位桶

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://[email protected]/the_drow/agile.crm.framework 
pushing subrepo Logging to https://[email protected]/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 
+0

你可以發佈你的'.hgsub'文件的內容嗎? – 2011-05-11 17:05:09

+0

我認爲除了你標記爲正確的答案之外的答案是更好的答案。根據某些網站的限制,您不必決定將儲存庫放在哪裏。只需使用特殊用途的重寫規則來適應該網站的特定限制即可。 – Omnifarious 2016-12-31 12:17:07

回答

13

正如你發佈的鏈接指出,的內容,「你必須做出subrepositories作爲主存儲庫的兄弟姐妹。 「

於是就到位桶,你需要以下結構:

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

然後你.hgsubagile.crm.framework需要包含以下內容:

Logging = ../Logging

+2

所以我必須打開另一個存儲庫?這有點違背了這裏的目的。 – 2011-05-11 19:11:48

+6

@the_drow:添加一個subrepo意味着subrepo是一個獨立的[project |庫|無論]有自己的歷史。如果你不打算在多個項目中使用你的'Logging'回購,那麼它首先不應該是一個subrepo。如果你想在很多項目之間分享它,那麼它需要有自己的空間。 – 2011-05-11 19:17:46

9

我會碰到一個老問題,因爲我認爲我有更好的解決方案。我明白爲什麼@the_drow與原始接受的答案有關,因爲Logging = ../Logging您的本地計算機必須將Logging子報告作爲包含/主回購的對等方。這種從組織的角度來看打敗了subrepos的目的。但是,如果使用subpaths feature,你可以得到水銀改寫URI爲你推送:

external/my_subrepo = external/my_subrepo 

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

現在我本地的my_subrepo子庫的副本存儲在內部my_project不如預期,但是當我推到位桶,它重新轉向了真實的東西。事實上,自Mercurial瞭解Git和SVN以來,您可以使用該重寫功能指向任何地方。我有更多的Bitbucket存儲庫有其他使用Github的作者的subrepos。

+1

小心!這讓我難住了:期間只在第一個URL中逃脫!等號左邊:bitbucket \ .org - 右邊等號:bitbucket.org – martind2112 2017-03-14 09:13:43

+0

好點。是的,這很難得到完全正確的。 :+1: – moswald 2017-03-14 14:52:43