Use the subprocess module instead of popen2 to make it work on Windows.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
Simon Hausmann committed
May 15, 2007 at 14:31 UTC
084835805565726c825f0853626a33a0263066bf
1 file changed
+5
-5
contrib/fast-import/git-p4
+5
-5
@@ -8,7 +8,7 @@
8
# License: MIT <http://www.opensource.org/licenses/mit-license.php>
9
#
10
11
-import optparse, sys, os, marshal, popen2, shelve
11
+import optparse, sys, os, marshal, popen2, subprocess, shelve
12
import tempfile, getopt, sha, os.path, time
13
from sets import Set;
14
@@ -926,10 +926,10 @@ class P4Sync(Command):
926
927
self.tz = "%+03d%02d" % (- time.timezone / 3600, ((- time.timezone % 3600) / 60))
928
929
- importProcess = popen2.Popen3("git fast-import", capturestderr = True)
930
- self.gitOutput = importProcess.fromchild
931
- self.gitStream = importProcess.tochild
932
- self.gitError = importProcess.childerr
929
+ importProcess = subprocess.Popen(["git", "fast-import"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE);
930
+ self.gitOutput = importProcess.stdout
931
+ self.gitStream = importProcess.stdin
932
+ self.gitError = importProcess.stderr
933
934
if len(self.revision) > 0:
935
print "Doing initial import of %s from revision %s" % (self.depotPath, self.revision)