diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-05-13 10:19:48 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-05-13 10:19:48 -0700 |
| commit | bbffcd45145592350652ef937b12f591fa52808f (patch) | |
| tree | bc49182d2c70479ed7abba4f16b0075ee38cc92e /git-p4.py | |
| parent | Merge branch 'ps/ci-fuzzers-at-gitlab-fix' (diff) | |
| parent | git-p4: show Perforce error to the user (diff) | |
| download | git-bbffcd45145592350652ef937b12f591fa52808f.tar.gz git-bbffcd45145592350652ef937b12f591fa52808f.zip | |
Merge branch 'fa/p4-error'
P4 update.
* fa/p4-error:
git-p4: show Perforce error to the user
Diffstat (limited to 'git-p4.py')
| -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 |
