1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-07 20:06:10 +02:00

Merge branch 'ls/p4-retry-thrice'

* ls/p4-retry-thrice:
  git-p4: add config to retry p4 commands; retry 3 times by default
This commit is contained in:
Junio C Hamano 2016-12-16 15:27:50 -08:00
commit 2a72b69407
2 changed files with 9 additions and 0 deletions

View File

@ -476,6 +476,10 @@ git-p4.client::
Client specified as an option to all p4 commands, with
'-c <client>', including the client spec.
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.
Clone and sync variables
~~~~~~~~~~~~~~~~~~~~~~~~
git-p4.syncFromOrigin::

View File

@ -78,6 +78,11 @@ def p4_build_cmd(cmd):
if len(client) > 0:
real_cmd += ["-c", client]
retries = gitConfigInt("git-p4.retries")
if retries is None:
# Perform 3 retries by default
retries = 3
real_cmd += ["-r", str(retries)]
if isinstance(cmd,basestring):
real_cmd = ' '.join(real_cmd) + ' ' + cmd