2011-11-13 27 views
12

विफल रहता है मैं hg push का उपयोग गिट भंडार में करने की कोशिश कर रहा हूं, लेकिन यह चुपचाप विफल रहता है। मुझे a single post on the mailing list और a registered hg-git issue मिला, लेकिन दोनों बिना गतिविधि के लगभग आधा साल पुराना है। तो मैंने सोचना शुरू कर दिया कि मैं कुछ गलत समझ/गलत कॉन्फ़िगर करता हूं। मेरे ~/.hgrc शामिलएचजी-गीट पुश चुपचाप

[extensions] 
hgext.bookmarks = 
hgext.git = 
#hggit = /path/to/hg-git-0.3.1/hggit 
[bookmarks] 
track.current = True 

यह स्निपेट समस्या reproduces:

mkdir /tmp/Git 
cd /tmp/Git 
git init 
echo 'something' > myfile 
git add . 
git commit -m 'Started' 
cd .. 
hg clone /tmp/Git /tmp/Hg 
cd /tmp/Hg 
echo 'another thing' >> myfile 
hg ci -m 'Working' 
hg log 
# Two items listed 
hg push 
cd ../Git 
git log 
# Only one item listed, but two expected 

मैं दोनों hg-git 0.2.6-2 उबंटू 11.10 के साथ भेज दिया, और नवीनतम टैग संस्करण, 0.3.1 की कोशिश की। मेरा Mercurial संस्करण 1.9.1

मैंने आने से पहले दो प्रस्तावित वर्कअराउंड, hg update master भी कोशिश की, और hg bookmark -f master आने के बाद, लेकिन दोनों ने एक त्रुटि दी।

अद्यतन:

मैं एक new issue for this

उत्तर

19

बनाई यहां दो मुद्दे हैं: धक्का स्पष्ट रूप से असफल चाहिए, और Hg-Git यह रिपोर्ट करना चाहिए (लेकिन यह नहीं है)।

पुशिंग विफल होना चाहिए, "abort: git remote error: refs/heads/master failed to update" when pushing to local clone दे रहा है, क्योंकि यह एक गैर-नंगे भंडार को धक्का देता है (more on that from a mercurial user's perspective देखें)। उपरोक्त स्निपेट का एक कार्य संस्करण यह है (Bare भंडार का उपयोग नोट करें)।

mkdir /tmp/Git 
cd /tmp/Git 
git init 
echo 'something' > myfile 
git add . 
git commit -m 'Started' 
cd .. 
git clone --bare -l /tmp/Git /tmp/Bare 
hg clone /tmp/Bare/ /tmp/Hg 
cd /tmp/Hg 
echo 'another thing' >> myfile 
hg ci -m 'Working' 
hg log 
# Two items listed 
hg push 
cd ../Bare 
git log 
# Two items listed 
के बारे में

, क्यों hg-git इस त्रुटि को छुपाता है, मुझे लगता है यह सबसे हाल ही में उबंटू के साथ भेज दिया संस्करणों के साथ एक समस्या है। क्या मैंने किया था

apt-get remove mercurial-git python-dulwich 
easy_install hg-git 

था यह dulwich 0.7.1 हटाया, और 0.8 जो hg-git साइट के अनुसार आवश्यक है स्थापित। अब, यह मेरे लिए काम करता है। Mercurial संस्करण (1.9.1) ठीक काम करता प्रतीत होता है।

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