A new attempt at fixing the child-fast-import-process-not-finished race condition in the clone command
A new attempt at fixing the child-fast-import-process-not-finished race condition in the clone command Signed-off-by: Simon Hausmann <simon@lst.de>
Simon Hausmann committed
Apr 15, 2007 at 09:34 UTC
90865adc01213520980459ddc261a019f673cce8
1 file changed
+5
-2
contrib/fast-import/git-p4
+5
-2
@@ -907,7 +907,10 @@ class P4Sync(Command):
907
908
self.tz = "%+03d%02d" % (- time.timezone / 3600, ((- time.timezone % 3600) / 60))
909
910
- self.gitOutput, self.gitStream, self.gitError = popen2.popen3("git fast-import")
910
+ importProcess = popen2.Popen3("git fast-import", capturestderr = True)
911
+ self.gitOutput = importProcess.fromchild
912
+ self.gitStream = importProcess.tochild
913
+ self.gitError = importProcess.childerr
914
915
if len(self.revision) > 0:
916
print "Doing initial import of %s from revision %s" % (self.globalPrefix, self.revision)
@@ -1028,6 +1031,7 @@ class P4Sync(Command):
1031
self.gitStream.close()
1032
self.gitOutput.close()
1033
self.gitError.close()
1034
+ importProcess.wait()
1035
1036
os.popen("git repo-config p4.depotpath %s" % self.globalPrefix).read()
1037
if len(self.initialTag) > 0:
@@ -1096,7 +1100,6 @@ class P4Clone(P4Sync):
1100
system("git init")
1101
if not P4Sync.run(self, [depotPath]):
1102
return False
1099
- os.wait()
1103
if self.branch != "master":
1104
system("git branch master p4")
1105
system("git checkout -f")