diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-06-28 15:53:10 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-06-28 15:53:11 -0700 |
| commit | 0d23421e2a30fb15c5b701c36a2c7b37b9aec58a (patch) | |
| tree | 02c29e9454e008c62c4025aa9d2380e05844f9a1 | |
| parent | 6840423c6fa27085aad8b091fc73ea1d9bcdadd6 (diff) | |
| parent | 55702c543ea39230847dfc635ea1b604d66d9b83 (diff) | |
| download | git-0d23421e2a30fb15c5b701c36a2c7b37b9aec58a.tar.xz | |
Merge branch 'fa/p4-error' into maint-2.45
P4 update.
* fa/p4-error:
git-p4: show Perforce error to the user
| -rwxr-xr-x | git-p4.py | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -3253,17 +3253,19 @@ class P4Sync(Command, P4UserMap): 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 |
