From 819827a42ddb364f98c3a1a7eae2536dc54bc4cc Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 12 Feb 2020 15:20:19 +0900 Subject: 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 Tested-by: David Pursehouse --- subcmds/sync.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'subcmds/sync.py') 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: try: import resource + def _rlimit_nofile(): return resource.getrlimit(resource.RLIMIT_NOFILE) except ImportError: @@ -81,13 +82,16 @@ from manifest_xml import GitcManifest _ONE_DAY_S = 24 * 60 * 60 + class _FetchError(Exception): """Internal error thrown in _FetchHelper() when we don't want stack trace.""" pass + class _CheckoutError(Exception): """Internal error thrown in _CheckoutOne() when we don't want stack trace.""" + class Sync(Command, MirrorSafeCommand): jobs = 1 common = True @@ -1044,6 +1048,7 @@ later is required to fix a server side protocol bug. file=sys.stderr) sys.exit(1) + def _PostRepoUpgrade(manifest, quiet=False): wrapper = Wrapper() if wrapper.NeedSetupGnuPG(): @@ -1052,6 +1057,7 @@ def _PostRepoUpgrade(manifest, quiet=False): if project.Exists: project.PostRepoUpgrade() + def _PostRepoFetch(rp, no_repo_verify=False, verbose=False): if rp.HasChanges: 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): print('repo version %s is current' % rp.work_git.describe(HEAD), file=sys.stderr) + def _VerifyTag(project): gpg_dir = os.path.expanduser('~/.repoconfig/gnupg') if not os.path.exists(gpg_dir): @@ -1174,6 +1181,8 @@ class _FetchTimes(object): # and supporting persistent-http[s]. It cannot change hosts from # request to request like the normal transport, the real url # is passed during initialization. + + class PersistentTransport(xmlrpc.client.Transport): def __init__(self, orig_host): self.orig_host = orig_host -- cgit v1.2.3-54-g00ecf