summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--event_log.py2
-rw-r--r--git_command.py2
-rw-r--r--git_config.py10
-rw-r--r--git_refs.py10
-rw-r--r--gitc_utils.py2
-rwxr-xr-xmain.py2
-rw-r--r--manifest_xml.py4
-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
16 files changed, 32 insertions, 32 deletions
diff --git a/event_log.py b/event_log.py
index 315d752d..45800a59 100644
--- a/event_log.py
+++ b/event_log.py
@@ -138,7 +138,7 @@ class EventLog(object):
138 Returns: 138 Returns:
139 A dictionary of the event added to the log. 139 A dictionary of the event added to the log.
140 """ 140 """
141 event['status'] = self.GetStatusString(success) 141 event['status'] = self.GetStatusString(success)
142 event['finish_time'] = finish 142 event['finish_time'] = finish
143 return event 143 return event
144 144
diff --git a/git_command.py b/git_command.py
index 34efda7d..5034ae12 100644
--- a/git_command.py
+++ b/git_command.py
@@ -101,7 +101,7 @@ class _GitCall(object):
101 return _git_version 101 return _git_version
102 102
103 def __getattr__(self, name): 103 def __getattr__(self, name):
104 name = name.replace('_','-') 104 name = name.replace('_', '-')
105 def fun(*cmdv): 105 def fun(*cmdv):
106 command = [name] 106 command = [name]
107 command.extend(cmdv) 107 command.extend(cmdv)
diff --git a/git_config.py b/git_config.py
index 8311d9f0..8cc52dab 100644
--- a/git_config.py
+++ b/git_config.py
@@ -75,7 +75,7 @@ def _key(name):
75 parts = name.split('.') 75 parts = name.split('.')
76 if len(parts) < 2: 76 if len(parts) < 2:
77 return name.lower() 77 return name.lower()
78 parts[ 0] = parts[ 0].lower() 78 parts[0] = parts[0].lower()
79 parts[-1] = parts[-1].lower() 79 parts[-1] = parts[-1].lower()
80 return '.'.join(parts) 80 return '.'.join(parts)
81 81
@@ -430,7 +430,7 @@ def _open_ssh(host, port=None):
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)]
@@ -439,13 +439,13 @@ def _open_ssh(host, port=None):
439 # ...but before actually starting a master, we'll double-check. This can 439 # ...but before actually starting a master, we'll double-check. This can
440 # be important because we can't tell that that 'git@myhost.com' is the same 440 # be important because we can't tell that that 'git@myhost.com' is the same
441 # as 'myhost.com' where "User git" is setup in the user's ~/.ssh/config file. 441 # as 'myhost.com' where "User git" is setup in the user's ~/.ssh/config file.
442 check_command = command_base + ['-O','check'] 442 check_command = command_base + ['-O', 'check']
443 try: 443 try:
444 Trace(': %s', ' '.join(check_command)) 444 Trace(': %s', ' '.join(check_command))
445 check_process = subprocess.Popen(check_command, 445 check_process = subprocess.Popen(check_command,
446 stdout=subprocess.PIPE, 446 stdout=subprocess.PIPE,
447 stderr=subprocess.PIPE) 447 stderr=subprocess.PIPE)
448 check_process.communicate() # read output, but ignore it... 448 check_process.communicate() # read output, but ignore it...
449 isnt_running = check_process.wait() 449 isnt_running = check_process.wait()
450 450
451 if not isnt_running: 451 if not isnt_running:
@@ -467,7 +467,7 @@ def _open_ssh(host, port=None):
467 except Exception as e: 467 except Exception as e:
468 _ssh_master = False 468 _ssh_master = False
469 print('\nwarn: cannot enable ssh control master for %s:%s\n%s' 469 print('\nwarn: cannot enable ssh control master for %s:%s\n%s'
470 % (host,port, str(e)), file=sys.stderr) 470 % (host, port, str(e)), file=sys.stderr)
471 return False 471 return False
472 472
473 time.sleep(1) 473 time.sleep(1)
diff --git a/git_refs.py b/git_refs.py
index debd4cbf..02b98cba 100644
--- a/git_refs.py
+++ b/git_refs.py
@@ -18,12 +18,12 @@ import os
18from repo_trace import Trace 18from repo_trace import Trace
19import platform_utils 19import platform_utils
20 20
21HEAD = 'HEAD' 21HEAD = 'HEAD'
22R_CHANGES = 'refs/changes/' 22R_CHANGES = 'refs/changes/'
23R_HEADS = 'refs/heads/' 23R_HEADS = 'refs/heads/'
24R_TAGS = 'refs/tags/' 24R_TAGS = 'refs/tags/'
25R_PUB = 'refs/published/' 25R_PUB = 'refs/published/'
26R_M = 'refs/remotes/m/' 26R_M = 'refs/remotes/m/'
27 27
28 28
29class GitRefs(object): 29class GitRefs(object):
diff --git a/gitc_utils.py b/gitc_utils.py
index 8b5b007e..a2b04d98 100644
--- a/gitc_utils.py
+++ b/gitc_utils.py
@@ -121,7 +121,7 @@ def generate_gitc_manifest(gitc_manifest, manifest, paths=None):
121 index = 0 121 index = 0
122 while index < len(projects): 122 while index < len(projects):
123 _set_project_revisions( 123 _set_project_revisions(
124 projects[index:(index+NUM_BATCH_RETRIEVE_REVISIONID)]) 124 projects[index:(index + NUM_BATCH_RETRIEVE_REVISIONID)])
125 index += NUM_BATCH_RETRIEVE_REVISIONID 125 index += NUM_BATCH_RETRIEVE_REVISIONID
126 126
127 if gitc_manifest is not None: 127 if gitc_manifest is not None:
diff --git a/main.py b/main.py
index b2845d8a..7dbdbfa5 100755
--- a/main.py
+++ b/main.py
@@ -476,7 +476,7 @@ def init_http():
476 n = netrc.netrc() 476 n = netrc.netrc()
477 for host in n.hosts: 477 for host in n.hosts:
478 p = n.hosts[host] 478 p = n.hosts[host]
479 mgr.add_password(p[1], 'http://%s/' % host, p[0], p[2]) 479 mgr.add_password(p[1], 'http://%s/' % host, p[0], p[2])
480 mgr.add_password(p[1], 'https://%s/' % host, p[0], p[2]) 480 mgr.add_password(p[1], 'https://%s/' % host, p[0], p[2])
481 except netrc.NetrcParseError: 481 except netrc.NetrcParseError:
482 pass 482 pass
diff --git a/manifest_xml.py b/manifest_xml.py
index d24dbcea..9df03c06 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -224,7 +224,7 @@ class XmlManifest(object):
224 if self.notice: 224 if self.notice:
225 notice_element = root.appendChild(doc.createElement('notice')) 225 notice_element = root.appendChild(doc.createElement('notice'))
226 notice_lines = self.notice.splitlines() 226 notice_lines = self.notice.splitlines()
227 indented_notice = ('\n'.join(" "*4 + line for line in notice_lines))[4:] 227 indented_notice = ('\n'.join(" " * 4 + line for line in notice_lines))[4:]
228 notice_element.appendChild(doc.createTextNode(indented_notice)) 228 notice_element.appendChild(doc.createTextNode(indented_notice))
229 229
230 d = self.default 230 d = self.default
@@ -855,7 +855,7 @@ class XmlManifest(object):
855 if clone_depth: 855 if clone_depth:
856 try: 856 try:
857 clone_depth = int(clone_depth) 857 clone_depth = int(clone_depth)
858 if clone_depth <= 0: 858 if clone_depth <= 0:
859 raise ValueError() 859 raise ValueError()
860 except ValueError: 860 except ValueError:
861 raise ManifestParseError('invalid clone-depth %s in %s' % 861 raise ManifestParseError('invalid clone-depth %s in %s' %
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),