mirror of
https://github.com/git/git
synced 2024-11-04 16:17:49 +00:00
git-p4: show Perforce error to the user
During "git p4 clone" if p4 process returns an error from the server, it will store the message in the 'err' variable. Then it will send a text command "die-now" to git-fast-import. However, git-fast-import raises an exception: "fatal: Unsupported command: die-now" and err is never displayed. This patch ensures that err is shown to the end user. Signed-off-by: Fahad Alrashed <fahad@keylock.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
786a3e4b8d
commit
55702c543e
1 changed files with 13 additions and 11 deletions
24
git-p4.py
24
git-p4.py
|
@ -3253,17 +3253,19 @@ def streamP4FilesCb(self, marshalled):
|
||||||
if self.stream_have_file_info:
|
if self.stream_have_file_info:
|
||||||
if "depotFile" in self.stream_file:
|
if "depotFile" in self.stream_file:
|
||||||
f = self.stream_file["depotFile"]
|
f = self.stream_file["depotFile"]
|
||||||
# force a failure in fast-import, else an empty
|
try:
|
||||||
# commit will be made
|
# force a failure in fast-import, else an empty
|
||||||
self.gitStream.write("\n")
|
# commit will be made
|
||||||
self.gitStream.write("die-now\n")
|
self.gitStream.write("\n")
|
||||||
self.gitStream.close()
|
self.gitStream.write("die-now\n")
|
||||||
# ignore errors, but make sure it exits first
|
self.gitStream.close()
|
||||||
self.importProcess.wait()
|
# ignore errors, but make sure it exits first
|
||||||
if f:
|
self.importProcess.wait()
|
||||||
die("Error from p4 print for %s: %s" % (f, err))
|
finally:
|
||||||
else:
|
if f:
|
||||||
die("Error from p4 print: %s" % err)
|
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:
|
if 'depotFile' in marshalled and self.stream_have_file_info:
|
||||||
# start of a new file - output the old one first
|
# start of a new file - output the old one first
|
||||||
|
|
Loading…
Reference in a new issue