Skip to content

Commit bbffcd4

Browse files
committed
Merge branch 'fa/p4-error'
P4 update. * fa/p4-error: git-p4: show Perforce error to the user
2 parents 235b9fb + 55702c5 commit bbffcd4

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

git-p4.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3253,17 +3253,19 @@ def streamP4FilesCb(self, marshalled):
32533253
if self.stream_have_file_info:
32543254
if "depotFile" in self.stream_file:
32553255
f = self.stream_file["depotFile"]
3256-
# force a failure in fast-import, else an empty
3257-
# commit will be made
3258-
self.gitStream.write("\n")
3259-
self.gitStream.write("die-now\n")
3260-
self.gitStream.close()
3261-
# ignore errors, but make sure it exits first
3262-
self.importProcess.wait()
3263-
if f:
3264-
die("Error from p4 print for %s: %s" % (f, err))
3265-
else:
3266-
die("Error from p4 print: %s" % err)
3256+
try:
3257+
# force a failure in fast-import, else an empty
3258+
# commit will be made
3259+
self.gitStream.write("\n")
3260+
self.gitStream.write("die-now\n")
3261+
self.gitStream.close()
3262+
# ignore errors, but make sure it exits first
3263+
self.importProcess.wait()
3264+
finally:
3265+
if f:
3266+
die("Error from p4 print for %s: %s" % (f, err))
3267+
else:
3268+
die("Error from p4 print: %s" % err)
32673269

32683270
if 'depotFile' in marshalled and self.stream_have_file_info:
32693271
# start of a new file - output the old one first

0 commit comments

Comments
 (0)