summaryrefslogtreecommitdiffstats
path: root/subcmds
diff options
context:
space:
mode:
authorDavid Pursehouse <dpursehouse@collab.net>2020-02-12 14:31:05 +0900
committerDavid Pursehouse <dpursehouse@collab.net>2020-02-12 06:00:16 +0000
commit54a4e6007ab8be5738525b440cd6836c613517df (patch)
tree4e13a2ed3775463c0459754452b3888b7bb98b28 /subcmds
parent42339d7e52d6de6c702b78be7f5014e13646cc1b (diff)
downloadgit-repo-54a4e6007ab8be5738525b440cd6836c613517df.tar.gz
Fix various whitespace issues reported by pyflakes
- E201 whitespace after '[' - E202 whitespace before '}' - E221 multiple spaces before operator - E222 multiple spaces after operator - E225 missing whitespace around operator - E226 missing whitespace around arithmetic operator - E231 missing whitespace after ',' - E261 at least two spaces before inline comment - E271 multiple spaces after keyword Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place \ --select E201,E202,E221,E222,E225,E226,E231,E261,E271 Change-Id: I367113eb8c847eb460532c7c2f8643f33040308c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254601 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/abandon.py8
-rw-r--r--subcmds/branches.py6
-rw-r--r--subcmds/cherry_pick.py2
-rw-r--r--subcmds/forall.py2
-rw-r--r--subcmds/info.py2
-rw-r--r--subcmds/init.py2
-rw-r--r--subcmds/list.py2
-rw-r--r--subcmds/start.py2
-rw-r--r--subcmds/sync.py6
9 files changed, 16 insertions, 16 deletions
diff --git a/subcmds/abandon.py b/subcmds/abandon.py
index cd1d0c40..ba4ef099 100644
--- a/subcmds/abandon.py
+++ b/subcmds/abandon.py
@@ -79,10 +79,10 @@ It is equivalent to "git branch -D <branchname>".
79 79
80 if err: 80 if err:
81 for br in err.keys(): 81 for br in err.keys():
82 err_msg = "error: cannot abandon %s" %br 82 err_msg = "error: cannot abandon %s" % br
83 print(err_msg, file=sys.stderr) 83 print(err_msg, file=sys.stderr)
84 for proj in err[br]: 84 for proj in err[br]:
85 print(' '*len(err_msg) + " | %s" % proj.relpath, file=sys.stderr) 85 print(' ' * len(err_msg) + " | %s" % proj.relpath, file=sys.stderr)
86 sys.exit(1) 86 sys.exit(1)
87 elif not success: 87 elif not success:
88 print('error: no project has local branch(es) : %s' % nb, 88 print('error: no project has local branch(es) : %s' % nb,
@@ -95,5 +95,5 @@ It is equivalent to "git branch -D <branchname>".
95 result = "all project" 95 result = "all project"
96 else: 96 else:
97 result = "%s" % ( 97 result = "%s" % (
98 ('\n'+' '*width + '| ').join(p.relpath for p in success[br])) 98 ('\n' + ' ' * width + '| ').join(p.relpath for p in success[br]))
99 print("%s%s| %s\n" % (br,' '*(width-len(br)), result),file=sys.stderr) 99 print("%s%s| %s\n" % (br, ' ' * (width - len(br)), result), file=sys.stderr)
diff --git a/subcmds/branches.py b/subcmds/branches.py
index b8958848..b4894ec8 100644
--- a/subcmds/branches.py
+++ b/subcmds/branches.py
@@ -23,7 +23,7 @@ class BranchColoring(Coloring):
23 def __init__(self, config): 23 def __init__(self, config):
24 Coloring.__init__(self, config, 'branch') 24 Coloring.__init__(self, config, 'branch')
25 self.current = self.printer('current', fg='green') 25 self.current = self.printer('current', fg='green')
26 self.local = self.printer('local') 26 self.local = self.printer('local')
27 self.notinproject = self.printer('notinproject', fg='red') 27 self.notinproject = self.printer('notinproject', fg='red')
28 28
29class BranchInfo(object): 29class BranchInfo(object):
@@ -170,11 +170,11 @@ is shown, then the branch appears in all projects.
170 fmt = out.current if i.IsCurrent else out.write 170 fmt = out.current if i.IsCurrent else out.write
171 for p in paths: 171 for p in paths:
172 out.nl() 172 out.nl()
173 fmt(width*' ' + ' %s' % p) 173 fmt(width * ' ' + ' %s' % p)
174 fmt = out.write 174 fmt = out.write
175 for p in non_cur_paths: 175 for p in non_cur_paths:
176 out.nl() 176 out.nl()
177 fmt(width*' ' + ' %s' % p) 177 fmt(width * ' ' + ' %s' % p)
178 else: 178 else:
179 out.write(' in all projects') 179 out.write(' in all projects')
180 out.nl() 180 out.nl()
diff --git a/subcmds/cherry_pick.py b/subcmds/cherry_pick.py
index bd396fab..8d81be33 100644
--- a/subcmds/cherry_pick.py
+++ b/subcmds/cherry_pick.py
@@ -97,7 +97,7 @@ change id will be added.
97 97
98 def _StripHeader(self, commit_msg): 98 def _StripHeader(self, commit_msg):
99 lines = commit_msg.splitlines() 99 lines = commit_msg.splitlines()
100 return "\n".join(lines[lines.index("")+1:]) 100 return "\n".join(lines[lines.index("") + 1:])
101 101
102 def _Reformat(self, old_msg, sha1): 102 def _Reformat(self, old_msg, sha1):
103 new_msg = [] 103 new_msg = []
diff --git a/subcmds/forall.py b/subcmds/forall.py
index 131ba676..97067605 100644
--- a/subcmds/forall.py
+++ b/subcmds/forall.py
@@ -195,7 +195,7 @@ without iterating through the remaining projects.
195 cmd.append(cmd[0]) 195 cmd.append(cmd[0])
196 cmd.extend(opt.command[1:]) 196 cmd.extend(opt.command[1:])
197 197
198 if opt.project_header \ 198 if opt.project_header \
199 and not shell \ 199 and not shell \
200 and cmd[0] == 'git': 200 and cmd[0] == 'git':
201 # If this is a direct git command that can enable colorized 201 # If this is a direct git command that can enable colorized
diff --git a/subcmds/info.py b/subcmds/info.py
index cff97fbd..a6faf16a 100644
--- a/subcmds/info.py
+++ b/subcmds/info.py
@@ -204,7 +204,7 @@ class Info(PagedCommand):
204 204
205 for commit in commits: 205 for commit in commits:
206 split = commit.split() 206 split = commit.split()
207 self.text('{0:38}{1} '.format('','-')) 207 self.text('{0:38}{1} '.format('', '-'))
208 self.sha(split[0] + " ") 208 self.sha(split[0] + " ")
209 self.text(" ".join(split[1:])) 209 self.text(" ".join(split[1:]))
210 self.out.nl() 210 self.out.nl()
diff --git a/subcmds/init.py b/subcmds/init.py
index a7950069..191f02b2 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -349,7 +349,7 @@ to update the working directory files.
349 349
350 while True: 350 while True:
351 print() 351 print()
352 name = self._Prompt('Your Name', mp.UserName) 352 name = self._Prompt('Your Name', mp.UserName)
353 email = self._Prompt('Your Email', mp.UserEmail) 353 email = self._Prompt('Your Email', mp.UserEmail)
354 354
355 print() 355 print()
diff --git a/subcmds/list.py b/subcmds/list.py
index 231da941..1cd971ef 100644
--- a/subcmds/list.py
+++ b/subcmds/list.py
@@ -76,7 +76,7 @@ This is similar to running: repo forall -c 'echo "$REPO_PATH : $REPO_PROJECT"'.
76 lines = [] 76 lines = []
77 for project in projects: 77 for project in projects:
78 if opt.name_only and not opt.path_only: 78 if opt.name_only and not opt.path_only:
79 lines.append("%s" % ( project.name)) 79 lines.append("%s" % (project.name))
80 elif opt.path_only and not opt.name_only: 80 elif opt.path_only and not opt.name_only:
81 lines.append("%s" % (_getpath(project))) 81 lines.append("%s" % (_getpath(project)))
82 else: 82 else:
diff --git a/subcmds/start.py b/subcmds/start.py
index 6ec0b2ce..9b810865 100644
--- a/subcmds/start.py
+++ b/subcmds/start.py
@@ -60,7 +60,7 @@ revision specified in the manifest.
60 if not opt.all: 60 if not opt.all:
61 projects = args[1:] 61 projects = args[1:]
62 if len(projects) < 1: 62 if len(projects) < 1:
63 projects = ['.',] # start it in the local project by default 63 projects = ['.'] # start it in the local project by default
64 64
65 all_projects = self.GetProjects(projects, 65 all_projects = self.GetProjects(projects,
66 missing_ok=bool(self.gitc_manifest)) 66 missing_ok=bool(self.gitc_manifest))
diff --git a/subcmds/sync.py b/subcmds/sync.py
index df23034b..9e4c7750 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -217,7 +217,7 @@ later is required to fix a server side protocol bug.
217 p.add_option('-l', '--local-only', 217 p.add_option('-l', '--local-only',
218 dest='local_only', action='store_true', 218 dest='local_only', action='store_true',
219 help="only update working tree, don't fetch") 219 help="only update working tree, don't fetch")
220 p.add_option('--no-manifest-update','--nmu', 220 p.add_option('--no-manifest-update', '--nmu',
221 dest='mp_update', action='store_false', default='true', 221 dest='mp_update', action='store_false', default='true',
222 help='use the existing manifest checkout as-is. ' 222 help='use the existing manifest checkout as-is. '
223 '(do not update to the latest revision)') 223 '(do not update to the latest revision)')
@@ -1136,7 +1136,7 @@ class _FetchTimes(object):
1136 old = self._times.get(name, t) 1136 old = self._times.get(name, t)
1137 self._seen.add(name) 1137 self._seen.add(name)
1138 a = self._ALPHA 1138 a = self._ALPHA
1139 self._times[name] = (a*t) + ((1-a) * old) 1139 self._times[name] = (a * t) + ((1 - a) * old)
1140 1140
1141 def _Load(self): 1141 def _Load(self):
1142 if self._times is None: 1142 if self._times is None:
@@ -1208,7 +1208,7 @@ class PersistentTransport(xmlrpc.client.Transport):
1208 if proxy: 1208 if proxy:
1209 proxyhandler = urllib.request.ProxyHandler({ 1209 proxyhandler = urllib.request.ProxyHandler({
1210 "http": proxy, 1210 "http": proxy,
1211 "https": proxy }) 1211 "https": proxy})
1212 1212
1213 opener = urllib.request.build_opener( 1213 opener = urllib.request.build_opener(
1214 urllib.request.HTTPCookieProcessor(cookiejar), 1214 urllib.request.HTTPCookieProcessor(cookiejar),