diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-12-17 02:27:50 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-12-17 02:27:50 +0300 |
commit | 2a72b69407c5769db1519f82e7a10d98a3ab0352 (patch) | |
tree | 4fc7cc2a603e82d85ed626c1a29d9f4f7c47c04e | |
parent | 796bd3bb2ac98e6aa4cb9afccc18c3056f795196 (diff) | |
parent | 89a6ecc55b55ae87c39c5d9edb115731550fba95 (diff) |
Merge branch 'ls/p4-retry-thrice'
* ls/p4-retry-thrice:
git-p4: add config to retry p4 commands; retry 3 times by default
-rw-r--r-- | Documentation/git-p4.txt | 4 | ||||
-rwxr-xr-x | git-p4.py | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt index ce40b9a547..bae862ddcb 100644 --- a/Documentation/git-p4.txt +++ b/Documentation/git-p4.txt @@ -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:: @@ -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 |