summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-01-18 15:12:12 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-01-18 15:12:12 -0800
commit74f7427f8a7a6f8ac87e9f1bb1b140cd034f428d (patch)
treea13bab342f4d0161f57d2d0a46456d264a962b77
parentMerge branch 'sb/submodule-rm-absorb' (diff)
parentgit-p4: do not pass '-r 0' to p4 commands (diff)
downloadtgif-74f7427f8a7a6f8ac87e9f1bb1b140cd034f428d.tar.xz
Merge branch 'ls/p4-retry-thrice'
A recent updates to "git p4" was not usable for older p4 but it could be made to work with minimum changes. Do so. * ls/p4-retry-thrice: git-p4: do not pass '-r 0' to p4 commands
-rw-r--r--Documentation/git-p4.txt2
-rwxr-xr-xgit-p4.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt
index bae862ddcb..7436c64a95 100644
--- a/Documentation/git-p4.txt
+++ b/Documentation/git-p4.txt
@@ -479,6 +479,8 @@ git-p4.client::
git-p4.retries::
Specifies the number of times to retry a p4 command (notably,
'p4 sync') if the network times out. The default value is 3.
+ Set the value to 0 to disable retries or if your p4 version
+ does not support retries (pre 2012.2).
Clone and sync variables
~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/git-p4.py b/git-p4.py
index 22e3f57e7d..7bda915bd0 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -83,7 +83,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