aboutsummaryrefslogtreecommitdiff
path: root/git-p4.py
diff options
context:
space:
mode:
authorIgor Kushnir <igorkuo@gmail.com>2016-12-29 12:22:23 +0200
committerJunio C Hamano <gitster@pobox.com>2016-12-29 13:54:05 -0800
commitbc233524c96518c04650d297ad81a9c948fc2e41 (patch)
treecfe5250988723b077956526129b9157b6afeb05a /git-p4.py
parent89a6ecc55b55ae87c39c5d9edb115731550fba95 (diff)
downloadgit-bc233524c96518c04650d297ad81a9c948fc2e41.tar.gz
git-bc233524c96518c04650d297ad81a9c948fc2e41.tar.xz
git-p4: do not pass '-r 0' to p4 commands
git-p4 crashes when used with a very old p4 client version that does not support the '-r <number>' option in its commands. Allow making git-p4 work with old p4 clients by setting git-p4.retries to 0. Alternatively git-p4.retries could be made opt-in. But since only very old, barely maintained p4 versions don't support the '-r' option, the setting-retries-to-0 workaround would do. The "-r retries" option is present in Perforce 2012.2 Command Reference, but absent from Perforce 2012.1 Command Reference. Signed-off-by: Igor Kushnir <igorkuo@gmail.com> Acked-by: Lars Schneider <larsxschneider@gmail.com> Reviewed-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-p4.py b/git-p4.py
index 242217821..2d39d1012 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -82,7 +82,9 @@ def p4_build_cmd(cmd):
if retries is None:
# Perform 3 retries by default
retries = 3
- real_cmd += ["-r", str(retries)]
+ if retries > 0:
+ # Provide a way to not pass this option by setting git-p4.retries to 0
+ real_cmd += ["-r", str(retries)]
if isinstance(cmd,basestring):
real_cmd = ' '.join(real_cmd) + ' ' + cmd