From: Simon Hausmann Date: Sat, 10 Feb 2007 08:25:22 +0000 (+0100) Subject: Minor code cleanups. X-Git-Tag: v1.5.3-rc0~65^2^2~216 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b41507a42769c9e40d024593c6924769d9cb961b;p=git.git Minor code cleanups. Signed-off-by: Simon Hausmann --- diff --git a/contrib/fast-import/p4-fast-export.py b/contrib/fast-import/p4-fast-export.py index c44292473..d1faa7c29 100755 --- a/contrib/fast-import/p4-fast-export.py +++ b/contrib/fast-import/p4-fast-export.py @@ -183,6 +183,8 @@ tzsign = ("%s" % tz)[0] if tzsign != '+' and tzsign != '-': tz = "+" + ("%s" % tz) +gitOutput, gitStream, gitError = popen2.popen3("git-fast-import") + if len(revision) > 0: print "Doing initial import of %s from revision %s" % (prefix, revision) @@ -207,15 +209,11 @@ if len(revision) > 0: details["change"] = newestRevision - gitOutput, gitStream, gitError = popen2.popen3("git-fast-import") try: commit(details) except: print gitError.read() - gitStream.close() - gitOutput.close() - gitError.close() else: output = os.popen("p4 changes %s...%s" % (prefix, changeRange)).readlines() @@ -230,8 +228,6 @@ else: print "no changes to import!" sys.exit(1) - gitOutput, gitStream, gitError = popen2.popen3("git-fast-import") - cnt = 1 for change in changes: description = p4Cmd("describe %s" % change) @@ -246,12 +242,12 @@ else: print gitError.read() sys.exit(1) - gitStream.close() - gitOutput.close() - gitError.close() - print "" +gitStream.close() +gitOutput.close() +gitError.close() + os.popen("git-repo-config p4.depotpath %s" % prefix).read() sys.exit(0)