@matheusbsbs / matheus-bagliano / commits / b41507a427
Fork 0

Minor code cleanups.

Signed-off-by: Simon Hausmann <simon@lst.de>

Simon Hausmann committed Feb 10, 2007 at 09:25 UTC b41507a42769c9e40d024593c6924769d9cb961b
1 file changed +6 -10
contrib/fast-import/p4-fast-export.py
+6 -10
@@ -183,6 +183,8 @@ tzsign = ("%s" % tz)[0]
183 if tzsign != '+' and tzsign != '-':
184 tz = "+" + ("%s" % tz)
185
186 +gitOutput, gitStream, gitError = popen2.popen3("git-fast-import")
187 +
188 if len(revision) > 0:
189 print "Doing initial import of %s from revision %s" % (prefix, revision)
190
@@ -207,15 +209,11 @@ if len(revision) > 0:
209
210 details["change"] = newestRevision
211
210 - gitOutput, gitStream, gitError = popen2.popen3("git-fast-import")
212 try:
213 commit(details)
214 except:
215 print gitError.read()
216
216 - gitStream.close()
217 - gitOutput.close()
218 - gitError.close()
217 else:
218 output = os.popen("p4 changes %s...%s" % (prefix, changeRange)).readlines()
219
@@ -230,8 +228,6 @@ else:
228 print "no changes to import!"
229 sys.exit(1)
230
233 - gitOutput, gitStream, gitError = popen2.popen3("git-fast-import")
234 -
231 cnt = 1
232 for change in changes:
233 description = p4Cmd("describe %s" % change)
@@ -246,12 +242,12 @@ else:
242 print gitError.read()
243 sys.exit(1)
244
249 - gitStream.close()
250 - gitOutput.close()
251 - gitError.close()
252 -
245 print ""
246
247 +gitStream.close()
248 +gitOutput.close()
249 +gitError.close()
250 +
251 os.popen("git-repo-config p4.depotpath %s" % prefix).read()
252
253 sys.exit(0)