diff options
author | David Pursehouse <dpursehouse@collab.net> | 2020-02-12 14:58:39 +0900 |
---|---|---|
committer | David Pursehouse <dpursehouse@collab.net> | 2020-02-12 06:36:22 +0000 |
commit | abdf7500612f1d115863ba8f026ddbea1e5a1f28 (patch) | |
tree | 2b87f056bdf4fb53a170fc9121c2f5d1557bb48f /git_config.py | |
parent | 0ab95ba6d010abe5d615fa070e404582aca1d90a (diff) | |
download | git-repo-abdf7500612f1d115863ba8f026ddbea1e5a1f28.tar.gz |
Fix indentation issues reported by flake8
- E121 continuation line under-indented for hanging indent
- E122 continuation line missing indentation or outdented
- E125 continuation line with same indent as next logical line
- E126 continuation line over-indented for hanging indent
- E127 continuation line over-indented for visual indent
- E128 continuation line under-indented for visual indent
- E129 visually indented line with same indent as next logical line
- E131 continuation line unaligned for hanging indent
Fixed automatically with autopep8:
git ls-files | grep py$ | xargs autopep8 --in-place \
--select E121,E122,E125,E126,E127,E128,E129,E131
Change-Id: Ifd95fb8e6a1a4d6e9de187b5787d64a6326dd249
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254605
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: David Pursehouse <dpursehouse@collab.net>
Diffstat (limited to 'git_config.py')
-rw-r--r-- | git_config.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/git_config.py b/git_config.py index 6b47456f..13fbda24 100644 --- a/git_config.py +++ b/git_config.py | |||
@@ -104,8 +104,8 @@ class GitConfig(object): | |||
104 | self._json = jsonFile | 104 | self._json = jsonFile |
105 | if self._json is None: | 105 | if self._json is None: |
106 | self._json = os.path.join( | 106 | self._json = os.path.join( |
107 | os.path.dirname(self.file), | 107 | os.path.dirname(self.file), |
108 | '.repo_' + os.path.basename(self.file) + '.json') | 108 | '.repo_' + os.path.basename(self.file) + '.json') |
109 | 109 | ||
110 | def Has(self, name, include_defaults=True): | 110 | def Has(self, name, include_defaults=True): |
111 | """Return true if this configuration file has the key. | 111 | """Return true if this configuration file has the key. |
@@ -269,7 +269,7 @@ class GitConfig(object): | |||
269 | def _ReadJson(self): | 269 | def _ReadJson(self): |
270 | try: | 270 | try: |
271 | if os.path.getmtime(self._json) \ | 271 | if os.path.getmtime(self._json) \ |
272 | <= os.path.getmtime(self.file): | 272 | <= os.path.getmtime(self.file): |
273 | platform_utils.remove(self._json) | 273 | platform_utils.remove(self._json) |
274 | return None | 274 | return None |
275 | except OSError: | 275 | except OSError: |
@@ -422,16 +422,16 @@ def _open_ssh(host, port=None): | |||
422 | return True | 422 | return True |
423 | 423 | ||
424 | if not _ssh_master \ | 424 | if not _ssh_master \ |
425 | or 'GIT_SSH' in os.environ \ | 425 | or 'GIT_SSH' in os.environ \ |
426 | or sys.platform in ('win32', 'cygwin'): | 426 | or sys.platform in ('win32', 'cygwin'): |
427 | # failed earlier, or cygwin ssh can't do this | 427 | # failed earlier, or cygwin ssh can't do this |
428 | # | 428 | # |
429 | return False | 429 | return False |
430 | 430 | ||
431 | # We will make two calls to ssh; this is the common part of both calls. | 431 | # We will make two calls to ssh; this is the common part of both calls. |
432 | command_base = ['ssh', | 432 | command_base = ['ssh', |
433 | '-o', 'ControlPath %s' % ssh_sock(), | 433 | '-o', 'ControlPath %s' % ssh_sock(), |
434 | host] | 434 | host] |
435 | if port is not None: | 435 | if port is not None: |
436 | command_base[1:1] = ['-p', str(port)] | 436 | command_base[1:1] = ['-p', str(port)] |
437 | 437 | ||
@@ -465,7 +465,7 @@ def _open_ssh(host, port=None): | |||
465 | except Exception as e: | 465 | except Exception as e: |
466 | _ssh_master = False | 466 | _ssh_master = False |
467 | print('\nwarn: cannot enable ssh control master for %s:%s\n%s' | 467 | print('\nwarn: cannot enable ssh control master for %s:%s\n%s' |
468 | % (host, port, str(e)), file=sys.stderr) | 468 | % (host, port, str(e)), file=sys.stderr) |
469 | return False | 469 | return False |
470 | 470 | ||
471 | time.sleep(1) | 471 | time.sleep(1) |
@@ -583,7 +583,7 @@ class Remote(object): | |||
583 | self.review = self._Get('review') | 583 | self.review = self._Get('review') |
584 | self.projectname = self._Get('projectname') | 584 | self.projectname = self._Get('projectname') |
585 | self.fetch = list(map(RefSpec.FromString, | 585 | self.fetch = list(map(RefSpec.FromString, |
586 | self._Get('fetch', all_keys=True))) | 586 | self._Get('fetch', all_keys=True))) |
587 | self._review_url = None | 587 | self._review_url = None |
588 | 588 | ||
589 | def _InsteadOf(self): | 589 | def _InsteadOf(self): |
@@ -598,7 +598,7 @@ class Remote(object): | |||
598 | 598 | ||
599 | for insteadOf in insteadOfList: | 599 | for insteadOf in insteadOfList: |
600 | if self.url.startswith(insteadOf) \ | 600 | if self.url.startswith(insteadOf) \ |
601 | and len(insteadOf) > len(longest): | 601 | and len(insteadOf) > len(longest): |
602 | longest = insteadOf | 602 | longest = insteadOf |
603 | longestUrl = url | 603 | longestUrl = url |
604 | 604 | ||