2011-09-30 16 views
5

को संदर्भित करता है हम एक Mercurial भंडार ए क्लोन करने की कोशिश कर रहे हैं जहां यह एक subrepository बी संदर्भित करता है कि मेजबान मेजबान है। हम बी के नए स्थान को इंगित करने के लिए ए में एचएसबीयूबी अपडेट करना चाहते हैं, लेकिन अगर हम पहली जगह क्लोन ए नहीं कर सकते हैं तो यह एक चिकन और अंडे की समस्या है।एक Mercurial भंडार क्लोनिंग, .hgsub एक मृत बाहरी subrepo

क्या किसी को पता है कि इस के आसपास कैसे काम करना है?

उत्तर

5

पहले ध्यान दें कि क्लोन init + pull + update है और subrepo क्लोनिंग अद्यतन चरण का हिस्सा है, पुल चरण नहीं है। इसका मतलब यह है कि आप अद्यतन चरण को छोड़ने से बस में नाकाम रहने के क्लोन से बच सकते हैं: "मैं कैसे एक समस्याग्रस्त .hgsub/.hgsubstate फ़ाइल के साथ एक संशोधन को अपडेट करते हैं"

$ hg clone -U <url> 

अब समस्या का कम हो जाता है

  • remap [उपपथ] सुविधा का उपयोग कर subrepos

  • मैनुअल अद्यतन (Hg मदद subrepo और एचजी मदद config देखें) और मरम्मत

ए 'के मैनुअल: वहाँ दो संभावनाएं यहाँ हैं अद्यतन "इस तरह किया जा सकता है:

$ hg revert -a -r default -X problematic-file 
[adding a bunch of files] 
$ hg debugrebuildstate -r default 

अब आप मैन्युअल रूप से अपने उपरोक्त को ठीक कर सकते हैं और .hgsub और प्रतिबद्ध। इसे दबाए रखने से पहले क्लोन के साथ अपने फिक्स का परीक्षण करना सुनिश्चित करें।

इसके अलावा, विषय पर इस मेलिंग सूची धागा देखें: http://markmail.org/thread/ktxd2rsm7avkexzr

4
$ hg help subrepos 
... 

    Remapping Subrepositories Sources 
    --------------------------------- 

    A subrepository source location may change during a project life, 
    invalidating references stored in the parent repository history. To fix 
    this, rewriting rules can be defined in parent repository "hgrc" file or 
    in Mercurial configuration. See the "[subpaths]" section in hgrc(5) for 
    more details. 

$ man hgrc 
... 

    subpaths 
     Defines subrepositories source locations rewriting rules of the form: 

     <pattern> = <replacement> 

     Where pattern is a regular expression matching the source and replacement is the replacement string used to 
     rewrite it. Groups can be matched in pattern and referenced in replacements. For instance: 

     http://server/(.*)-hg/ = http://hg.server/\1/ 

     rewrites http://server/foo-hg/ into http://hg.server/foo/. 

     All patterns are applied in definition order. 

... 

तो, आप एक [subpaths] खंड में .hgrc में कर सकते हैं।

+0

मैं कैसे या तो यह करने के लिए पता नहीं था, इसलिए जवाब से पता चलता वास्तव में कैसे मुझे मिल गया। 'एचजी सहायता 'और' मैन 'महान उपयोगिताएं हैं। –

संबंधित मुद्दे