@matheusbsbs / matheus-bagliano / commits / d88e707f17
Fork 0

git-p4: reinterpret confusing p4 message

Error output will look like this: glom$ git p4 clone //deopt Importing from //deopt into . Reinitialized existing Git repository in /tmp/x/.git/ Doing initial import of //deopt from revision #head into refs/remotes/p4/master p4 returned an error: //deopt/... - must refer to client glom. This particular p4 error is misleading. Perhaps the depot path was misspelled. Depot path: //deopt Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pete Wyckoff committed Feb 19, 2011 at 08:17 UTC d88e707f17ddcf3f789ec7fb1eb33121cecdcd67
1 file changed +4
contrib/fast-import/git-p4
+4
@@ -1445,6 +1445,10 @@ class P4Sync(Command):
1445 if 'code' in info and info['code'] == 'error':
1446 sys.stderr.write("p4 returned an error: %s\n"
1447 % info['data'])
1448 + if info['data'].find("must refer to client") >= 0:
1449 + sys.stderr.write("This particular p4 error is misleading.\n")
1450 + sys.stderr.write("Perhaps the depot path was misspelled.\n");
1451 + sys.stderr.write("Depot path: %s\n" % " ".join(self.depotPaths))
1452 sys.exit(1)
1453 if 'p4ExitCode' in info:
1454 sys.stderr.write("p4 exitcode: %s\n" % info['p4ExitCode'])