diff options
author | David Pursehouse <dpursehouse@collab.net> | 2020-02-12 15:20:19 +0900 |
---|---|---|
committer | David Pursehouse <dpursehouse@collab.net> | 2020-02-12 06:36:40 +0000 |
commit | 819827a42ddb364f98c3a1a7eae2536dc54bc4cc (patch) | |
tree | fe6bdca5ff7e44d53595a6da76d2b56ea659eee1 /subcmds/sync.py | |
parent | abdf7500612f1d115863ba8f026ddbea1e5a1f28 (diff) | |
download | git-repo-819827a42ddb364f98c3a1a7eae2536dc54bc4cc.tar.gz |
Fix blank line issues reported by flake8
- E301 expected 1 blank line
- E302 expected 2 blank lines
- E303 too many blank lines
- E305 expected 2 blank lines after class or function definition
- E306 expected 1 blank line before a nested definition
Fixed automatically with autopep8:
git ls-files | grep py$ | xargs autopep8 --in-place \
--select E301,E302,E303,E305,E306
Manually fix issues in project.py caused by misuse of block comments.
Change-Id: Iee840fcaff48aae504ddac9c3e76d2acd484f6a9
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254599
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: David Pursehouse <dpursehouse@collab.net>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 1ea102c0..c433ce6f 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -53,6 +53,7 @@ except ImportError: | |||
53 | 53 | ||
54 | try: | 54 | try: |
55 | import resource | 55 | import resource |
56 | |||
56 | def _rlimit_nofile(): | 57 | def _rlimit_nofile(): |
57 | return resource.getrlimit(resource.RLIMIT_NOFILE) | 58 | return resource.getrlimit(resource.RLIMIT_NOFILE) |
58 | except ImportError: | 59 | except ImportError: |
@@ -81,13 +82,16 @@ from manifest_xml import GitcManifest | |||
81 | 82 | ||
82 | _ONE_DAY_S = 24 * 60 * 60 | 83 | _ONE_DAY_S = 24 * 60 * 60 |
83 | 84 | ||
85 | |||
84 | class _FetchError(Exception): | 86 | class _FetchError(Exception): |
85 | """Internal error thrown in _FetchHelper() when we don't want stack trace.""" | 87 | """Internal error thrown in _FetchHelper() when we don't want stack trace.""" |
86 | pass | 88 | pass |
87 | 89 | ||
90 | |||
88 | class _CheckoutError(Exception): | 91 | class _CheckoutError(Exception): |
89 | """Internal error thrown in _CheckoutOne() when we don't want stack trace.""" | 92 | """Internal error thrown in _CheckoutOne() when we don't want stack trace.""" |
90 | 93 | ||
94 | |||
91 | class Sync(Command, MirrorSafeCommand): | 95 | class Sync(Command, MirrorSafeCommand): |
92 | jobs = 1 | 96 | jobs = 1 |
93 | common = True | 97 | common = True |
@@ -1044,6 +1048,7 @@ later is required to fix a server side protocol bug. | |||
1044 | file=sys.stderr) | 1048 | file=sys.stderr) |
1045 | sys.exit(1) | 1049 | sys.exit(1) |
1046 | 1050 | ||
1051 | |||
1047 | def _PostRepoUpgrade(manifest, quiet=False): | 1052 | def _PostRepoUpgrade(manifest, quiet=False): |
1048 | wrapper = Wrapper() | 1053 | wrapper = Wrapper() |
1049 | if wrapper.NeedSetupGnuPG(): | 1054 | if wrapper.NeedSetupGnuPG(): |
@@ -1052,6 +1057,7 @@ def _PostRepoUpgrade(manifest, quiet=False): | |||
1052 | if project.Exists: | 1057 | if project.Exists: |
1053 | project.PostRepoUpgrade() | 1058 | project.PostRepoUpgrade() |
1054 | 1059 | ||
1060 | |||
1055 | def _PostRepoFetch(rp, no_repo_verify=False, verbose=False): | 1061 | def _PostRepoFetch(rp, no_repo_verify=False, verbose=False): |
1056 | if rp.HasChanges: | 1062 | if rp.HasChanges: |
1057 | print('info: A new version of repo is available', file=sys.stderr) | 1063 | print('info: A new version of repo is available', file=sys.stderr) |
@@ -1070,6 +1076,7 @@ def _PostRepoFetch(rp, no_repo_verify=False, verbose=False): | |||
1070 | print('repo version %s is current' % rp.work_git.describe(HEAD), | 1076 | print('repo version %s is current' % rp.work_git.describe(HEAD), |
1071 | file=sys.stderr) | 1077 | file=sys.stderr) |
1072 | 1078 | ||
1079 | |||
1073 | def _VerifyTag(project): | 1080 | def _VerifyTag(project): |
1074 | gpg_dir = os.path.expanduser('~/.repoconfig/gnupg') | 1081 | gpg_dir = os.path.expanduser('~/.repoconfig/gnupg') |
1075 | if not os.path.exists(gpg_dir): | 1082 | if not os.path.exists(gpg_dir): |
@@ -1174,6 +1181,8 @@ class _FetchTimes(object): | |||
1174 | # and supporting persistent-http[s]. It cannot change hosts from | 1181 | # and supporting persistent-http[s]. It cannot change hosts from |
1175 | # request to request like the normal transport, the real url | 1182 | # request to request like the normal transport, the real url |
1176 | # is passed during initialization. | 1183 | # is passed during initialization. |
1184 | |||
1185 | |||
1177 | class PersistentTransport(xmlrpc.client.Transport): | 1186 | class PersistentTransport(xmlrpc.client.Transport): |
1178 | def __init__(self, orig_host): | 1187 | def __init__(self, orig_host): |
1179 | self.orig_host = orig_host | 1188 | self.orig_host = orig_host |