Skip to content

Commit 74f7427

Browse files
committed
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
2 parents 3ccd681 + bc23352 commit 74f7427

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Documentation/git-p4.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,8 @@ git-p4.client::
479479
git-p4.retries::
480480
Specifies the number of times to retry a p4 command (notably,
481481
'p4 sync') if the network times out. The default value is 3.
482+
Set the value to 0 to disable retries or if your p4 version
483+
does not support retries (pre 2012.2).
482484

483485
Clone and sync variables
484486
~~~~~~~~~~~~~~~~~~~~~~~~

git-p4.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ def p4_build_cmd(cmd):
8383
if retries is None:
8484
# Perform 3 retries by default
8585
retries = 3
86-
real_cmd += ["-r", str(retries)]
86+
if retries > 0:
87+
# Provide a way to not pass this option by setting git-p4.retries to 0
88+
real_cmd += ["-r", str(retries)]
8789

8890
if isinstance(cmd,basestring):
8991
real_cmd = ' '.join(real_cmd) + ' ' + cmd

0 commit comments

Comments
 (0)