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

git-p4: better message for "git-p4 sync" when not cloned

A common error is to do "git-p4 sync" in a repository that was not initialized by "git-p4 clone". There will be no p4 refs. The error message in this case is a traceback for an assertion, which is confusing. Change it instead to explain the likely problem. Signed-off-by: Pete Wyckoff <pw@padd.com> Acked-By: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pete Wyckoff committed Feb 19, 2011 at 08:17 UTC e32e00dc88948a730b8b1f3b8129f30c313713e7
1 file changed +2
contrib/fast-import/git-p4
+2
@@ -1676,6 +1676,8 @@ class P4Sync(Command):
1676
1677 changes.sort()
1678 else:
1679 + if not self.p4BranchesInGit:
1680 + die("No remote p4 branches. Perhaps you never did \"git p4 clone\" in here.");
1681 if self.verbose:
1682 print "Getting p4 changes for %s...%s" % (', '.join(self.depotPaths),
1683 self.changeRange)