2011-03-14 8 views
5

पर गिट-पी 4 के साथ आयात करने में असमर्थ मैं गिट-पी 4 पायथन लिपि का उपयोग करके गिट के लिए एक पी 4 डिपो पथ आयात करने की कोशिश कर रहा हूं। मेरी पर्यावरण कॉन्फ़िगर करने के बाद (Git 1.7.1, अजगर 2.7, Windwos एक्सपी, p4 env चर) मैं Git-पी 4 स्क्रिप्ट चलाने की कोशिश की, निम्नलिखित ouptut geetting:विंडोज

F:\gitp4>c:\Python27\python.exe git-p4.py clone --destination=master //depot/quake/main/[email protected] 
Reading pipe: git config git-p4.syncFromOrigin 
Importing from //depot/quake/main/[email protected] into master 
Initialized empty Git repository in F:/gitp4/master/.git/ 
Traceback (most recent call last): 
    File "git-p4.py", line 1926, in <module> 
    main() 
    File "git-p4.py", line 1921, in main 
    if not cmd.run(args): 
    File "git-p4.py", line 1798, in run 
    if not P4Sync.run(self, depotPaths): 
    File "git-p4.py", line 1501, in run 
    self.hasOrigin = originP4BranchesExist() 
    File "git-p4.py", line 439, in originP4BranchesExist 
    return gitBranchExists("origin") or gitBranchExists("origin/p4") or gitBranchExists("origin/p4/master") 
    File "git-p4.py", line 332, in gitBranchExists 
    stderr=subprocess.PIPE, stdout=subprocess.PIPE); 
    File "c:\Python27\lib\subprocess.py", line 672, in __init__ 
    errread, errwrite) 
    File "c:\Python27\lib\subprocess.py", line 882, in _execute_child 
    startupinfo) 
WindowsError: [Error 2] The system cannot find the file specified 

किसी को पता है क्या हो रहा है यहाँ? यदि मैं कमांड लाइन खोल से # 332 राज्यों (गिट rev-parse उत्पत्ति) पंक्ति को गिट कमांड चलाने की कोशिश करता हूं, तो आदेश सही तरीके से निष्पादित होता है।

धन्यवाद।

अद्यतन: ऐसा लगता है कि स्क्रिप्ट किसी भी प्रक्रिया को लॉन्च करने में असमर्थ है जिसका निष्पादन फ़ाइल निष्पादन पथ में नहीं है। मुझे लगता है कि खिड़कियों पर अजगर के साथ एक प्रारंभ मुद्दा है ...

+0

ऐसा लगता है कि subprocess.Popen (["git"] का उपयोग ...) PATH चर को अनदेखा करता है। मेरे पास एक वर्कअराउंड है, जो एक पूर्ण-पथ बैच फ़ाइल को कॉल करना है जो गिट निष्पादन फ़ाइल – Tate

+0

पर कॉल करता है धन्यवाद, यह मेरे लिए काम करता है। – Kevin

+0

क्या आप स्पष्ट कर सकते हैं कि आपने वास्तव में क्या किया है, मैं इसे काम नहीं कर सकता :( – Restuta

उत्तर

3

Restuta की टिप्पणी के जवाब में:

  1. मैं एक बैच फ़ाइल कॉल करने के लिए बनाई गई कस्टम पर कार्यकारी फ़ाइल "git.cmd" पथ। मेरी बैच फ़ाइल की सामग्री:
    @ "C: \ Program Files \ Git \ cmd \ git.cmd"% *

  2. मैं बस की कि बैच फ़ाइल कॉल करने के लिए git-p4.py फ़ाइल संशोधित किया बजाय "Git"।
    ईजी। (लाइन 2237) मूल लाइन: init_cmd = [ "Git", "init"]
    से बदले: init_cmd = [ "PATH_TO_BATCH_FILE \ git.bat", "init"]
    उदाहरण के लिए:
    init_cmd = [ "च: \ gitp4 \ git.bat "," init "]

  3. फ़ाइल पर सभी Git कॉल (subprocess.Popen कॉल) (मैं 6 परिवर्तन की कुल है) के लिए भी यही करें

आशा करता हूँ की ये काम करेगा!