git-p4: fix key error for p4 problem
[gitweb.git] / contrib / fast-import / git-p4
index 04ce7e3b020f489d59fe103970fc989d7b351127..2fefea4de5ee644d6cc1c6cf8a3e5d8524396743 100755 (executable)
@@ -1440,10 +1440,13 @@ class P4Sync(Command):
                                            % (p, revision)
                                            for p in self.depotPaths])):
 
-            if info['code'] == 'error':
+            if 'code' in info and info['code'] == 'error':
                 sys.stderr.write("p4 returned an error: %s\n"
                                  % info['data'])
                 sys.exit(1)
+            if 'p4ExitCode' in info:
+                sys.stderr.write("p4 exitcode: %s\n" % info['p4ExitCode'])
+                sys.exit(1)
 
 
             change = int(info["change"])