Skip to content

Commit

Permalink
Fixed a bug were the err message does not show because git-fast-impor…
Browse files Browse the repository at this point in the history
…t exits with an exception: fatal: Unsupported command: die-now
  • Loading branch information
alrashedf committed Feb 7, 2024
1 parent 235986b commit 4ae24ea
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions git-p4.py
Original file line number Diff line number Diff line change
Expand Up @@ -3253,17 +3253,19 @@ def streamP4FilesCb(self, marshalled):
if self.stream_have_file_info:
if "depotFile" in self.stream_file:
f = self.stream_file["depotFile"]
# force a failure in fast-import, else an empty
# commit will be made
self.gitStream.write("\n")
self.gitStream.write("die-now\n")
self.gitStream.close()
# ignore errors, but make sure it exits first
self.importProcess.wait()
if f:
die("Error from p4 print for %s: %s" % (f, err))
else:
die("Error from p4 print: %s" % err)
try:
# force a failure in fast-import, else an empty
# commit will be made
self.gitStream.write("\n")
self.gitStream.write("die-now\n")
self.gitStream.close()
# ignore errors, but make sure it exits first
self.importProcess.wait()
finally:
if f:
die("Error from p4 print for %s: %s" % (f, err))
else:
die("Error from p4 print: %s" % err)

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

0 comments on commit 4ae24ea

Please sign in to comment.