Browse Source

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>
David Pursehouse 6 years ago
parent
commit
abdf750061
19 changed files with 133 additions and 133 deletions
  1. 3 3
      editor.py
  2. 4 4
      git_command.py
  3. 10 10
      git_config.py
  4. 1 1
      gitc_utils.py
  5. 8 8
      main.py
  6. 13 13
      manifest_xml.py
  7. 18 18
      progress.py
  8. 1 1
      project.py
  9. 1 1
      subcmds/__init__.py
  10. 1 1
      subcmds/abandon.py
  11. 20 20
      subcmds/forall.py
  12. 4 4
      subcmds/help.py
  13. 5 5
      subcmds/info.py
  14. 5 5
      subcmds/init.py
  15. 3 3
      subcmds/rebase.py
  16. 1 1
      subcmds/start.py
  17. 4 4
      subcmds/status.py
  18. 20 20
      subcmds/sync.py
  19. 11 11
      subcmds/upload.py

+ 3 - 3
editor.py

@@ -57,7 +57,7 @@ class Editor(object):
 
 
     if os.getenv('TERM') == 'dumb':
     if os.getenv('TERM') == 'dumb':
       print(
       print(
-"""No editor specified in GIT_EDITOR, core.editor, VISUAL or EDITOR.
+          """No editor specified in GIT_EDITOR, core.editor, VISUAL or EDITOR.
 Tried to fall back to vi but terminal is dumb.  Please configure at
 Tried to fall back to vi but terminal is dumb.  Please configure at
 least one of these before using this command.""", file=sys.stderr)
 least one of these before using this command.""", file=sys.stderr)
       sys.exit(1)
       sys.exit(1)
@@ -104,10 +104,10 @@ least one of these before using this command.""", file=sys.stderr)
         rc = subprocess.Popen(args, shell=shell).wait()
         rc = subprocess.Popen(args, shell=shell).wait()
       except OSError as e:
       except OSError as e:
         raise EditorError('editor failed, %s: %s %s'
         raise EditorError('editor failed, %s: %s %s'
-          % (str(e), editor, path))
+                          % (str(e), editor, path))
       if rc != 0:
       if rc != 0:
         raise EditorError('editor failed with exit status %d: %s %s'
         raise EditorError('editor failed with exit status %d: %s %s'
-          % (rc, editor, path))
+                          % (rc, editor, path))
 
 
       with open(path, mode='rb') as fd2:
       with open(path, mode='rb') as fd2:
         return fd2.read().decode('utf-8')
         return fd2.read().decode('utf-8')

+ 4 - 4
git_command.py

@@ -57,16 +57,16 @@ def ssh_sock(create=True):
     if not os.path.exists(tmp_dir):
     if not os.path.exists(tmp_dir):
       tmp_dir = tempfile.gettempdir()
       tmp_dir = tempfile.gettempdir()
     _ssh_sock_path = os.path.join(
     _ssh_sock_path = os.path.join(
-      tempfile.mkdtemp('', 'ssh-', tmp_dir),
-      'master-%r@%h:%p')
+        tempfile.mkdtemp('', 'ssh-', tmp_dir),
+        'master-%r@%h:%p')
   return _ssh_sock_path
   return _ssh_sock_path
 
 
 def _ssh_proxy():
 def _ssh_proxy():
   global _ssh_proxy_path
   global _ssh_proxy_path
   if _ssh_proxy_path is None:
   if _ssh_proxy_path is None:
     _ssh_proxy_path = os.path.join(
     _ssh_proxy_path = os.path.join(
-      os.path.dirname(__file__),
-      'git_ssh')
+        os.path.dirname(__file__),
+        'git_ssh')
   return _ssh_proxy_path
   return _ssh_proxy_path
 
 
 def _add_ssh_client(p):
 def _add_ssh_client(p):

+ 10 - 10
git_config.py

@@ -104,8 +104,8 @@ class GitConfig(object):
     self._json = jsonFile
     self._json = jsonFile
     if self._json is None:
     if self._json is None:
       self._json = os.path.join(
       self._json = os.path.join(
-        os.path.dirname(self.file),
-        '.repo_' + os.path.basename(self.file) + '.json')
+          os.path.dirname(self.file),
+          '.repo_' + os.path.basename(self.file) + '.json')
 
 
   def Has(self, name, include_defaults=True):
   def Has(self, name, include_defaults=True):
     """Return true if this configuration file has the key.
     """Return true if this configuration file has the key.
@@ -269,7 +269,7 @@ class GitConfig(object):
   def _ReadJson(self):
   def _ReadJson(self):
     try:
     try:
       if os.path.getmtime(self._json) \
       if os.path.getmtime(self._json) \
-      <= os.path.getmtime(self.file):
+              <= os.path.getmtime(self.file):
         platform_utils.remove(self._json)
         platform_utils.remove(self._json)
         return None
         return None
     except OSError:
     except OSError:
@@ -422,16 +422,16 @@ def _open_ssh(host, port=None):
       return True
       return True
 
 
     if not _ssh_master \
     if not _ssh_master \
-    or 'GIT_SSH' in os.environ \
-    or sys.platform in ('win32', 'cygwin'):
+            or 'GIT_SSH' in os.environ \
+            or sys.platform in ('win32', 'cygwin'):
       # failed earlier, or cygwin ssh can't do this
       # failed earlier, or cygwin ssh can't do this
       #
       #
       return False
       return False
 
 
     # We will make two calls to ssh; this is the common part of both calls.
     # We will make two calls to ssh; this is the common part of both calls.
     command_base = ['ssh',
     command_base = ['ssh',
-                     '-o', 'ControlPath %s' % ssh_sock(),
-                     host]
+                    '-o', 'ControlPath %s' % ssh_sock(),
+                    host]
     if port is not None:
     if port is not None:
       command_base[1:1] = ['-p', str(port)]
       command_base[1:1] = ['-p', str(port)]
 
 
@@ -465,7 +465,7 @@ def _open_ssh(host, port=None):
     except Exception as e:
     except Exception as e:
       _ssh_master = False
       _ssh_master = False
       print('\nwarn: cannot enable ssh control master for %s:%s\n%s'
       print('\nwarn: cannot enable ssh control master for %s:%s\n%s'
-             % (host, port, str(e)), file=sys.stderr)
+            % (host, port, str(e)), file=sys.stderr)
       return False
       return False
 
 
     time.sleep(1)
     time.sleep(1)
@@ -583,7 +583,7 @@ class Remote(object):
     self.review = self._Get('review')
     self.review = self._Get('review')
     self.projectname = self._Get('projectname')
     self.projectname = self._Get('projectname')
     self.fetch = list(map(RefSpec.FromString,
     self.fetch = list(map(RefSpec.FromString,
-                      self._Get('fetch', all_keys=True)))
+                          self._Get('fetch', all_keys=True)))
     self._review_url = None
     self._review_url = None
 
 
   def _InsteadOf(self):
   def _InsteadOf(self):
@@ -598,7 +598,7 @@ class Remote(object):
 
 
       for insteadOf in insteadOfList:
       for insteadOf in insteadOfList:
         if self.url.startswith(insteadOf) \
         if self.url.startswith(insteadOf) \
-        and len(insteadOf) > len(longest):
+                and len(insteadOf) > len(longest):
           longest = insteadOf
           longest = insteadOf
           longestUrl = url
           longestUrl = url
 
 

+ 1 - 1
gitc_utils.py

@@ -52,7 +52,7 @@ def _set_project_revisions(projects):
                                        project.remote.url,
                                        project.remote.url,
                                        project.revisionExpr],
                                        project.revisionExpr],
                                       capture_stdout=True, cwd='/tmp'))
                                       capture_stdout=True, cwd='/tmp'))
-      for project in projects if not git_config.IsId(project.revisionExpr)]
+                     for project in projects if not git_config.IsId(project.revisionExpr)]
   for proj, gitcmd in project_gitcmds:
   for proj, gitcmd in project_gitcmds:
     if gitcmd.Wait():
     if gitcmd.Wait():
       print('FATAL: Failed to retrieve revisionExpr for %s' % proj)
       print('FATAL: Failed to retrieve revisionExpr for %s' % proj)

+ 8 - 8
main.py

@@ -188,7 +188,7 @@ class _Repo(object):
       copts = cmd.ReadEnvironmentOptions(copts)
       copts = cmd.ReadEnvironmentOptions(copts)
     except NoManifestException as e:
     except NoManifestException as e:
       print('error: in `%s`: %s' % (' '.join([name] + argv), str(e)),
       print('error: in `%s`: %s' % (' '.join([name] + argv), str(e)),
-        file=sys.stderr)
+            file=sys.stderr)
       print('error: manifest missing or unreadable -- please run init',
       print('error: manifest missing or unreadable -- please run init',
             file=sys.stderr)
             file=sys.stderr)
       return 1
       return 1
@@ -211,9 +211,9 @@ class _Repo(object):
       cmd.ValidateOptions(copts, cargs)
       cmd.ValidateOptions(copts, cargs)
       result = cmd.Execute(copts, cargs)
       result = cmd.Execute(copts, cargs)
     except (DownloadError, ManifestInvalidRevisionError,
     except (DownloadError, ManifestInvalidRevisionError,
-        NoManifestException) as e:
+            NoManifestException) as e:
       print('error: in `%s`: %s' % (' '.join([name] + argv), str(e)),
       print('error: in `%s`: %s' % (' '.join([name] + argv), str(e)),
-        file=sys.stderr)
+            file=sys.stderr)
       if isinstance(e, NoManifestException):
       if isinstance(e, NoManifestException):
         print('error: manifest missing or unreadable -- please run init',
         print('error: manifest missing or unreadable -- please run init',
               file=sys.stderr)
               file=sys.stderr)
@@ -346,7 +346,7 @@ class _BasicAuthHandler(urllib.request.HTTPBasicAuthHandler):
   def http_error_401(self, req, fp, code, msg, headers):
   def http_error_401(self, req, fp, code, msg, headers):
     _AddPasswordFromUserInput(self, msg, req)
     _AddPasswordFromUserInput(self, msg, req)
     return urllib.request.HTTPBasicAuthHandler.http_error_401(
     return urllib.request.HTTPBasicAuthHandler.http_error_401(
-      self, req, fp, code, msg, headers)
+        self, req, fp, code, msg, headers)
 
 
   def http_error_auth_reqed(self, authreq, host, req, headers):
   def http_error_auth_reqed(self, authreq, host, req, headers):
     try:
     try:
@@ -356,7 +356,7 @@ class _BasicAuthHandler(urllib.request.HTTPBasicAuthHandler):
         old_add_header(name, val)
         old_add_header(name, val)
       req.add_header = _add_header
       req.add_header = _add_header
       return urllib.request.AbstractBasicAuthHandler.http_error_auth_reqed(
       return urllib.request.AbstractBasicAuthHandler.http_error_auth_reqed(
-        self, authreq, host, req, headers)
+          self, authreq, host, req, headers)
     except:
     except:
       reset = getattr(self, 'reset_retry_count', None)
       reset = getattr(self, 'reset_retry_count', None)
       if reset is not None:
       if reset is not None:
@@ -369,7 +369,7 @@ class _DigestAuthHandler(urllib.request.HTTPDigestAuthHandler):
   def http_error_401(self, req, fp, code, msg, headers):
   def http_error_401(self, req, fp, code, msg, headers):
     _AddPasswordFromUserInput(self, msg, req)
     _AddPasswordFromUserInput(self, msg, req)
     return urllib.request.HTTPDigestAuthHandler.http_error_401(
     return urllib.request.HTTPDigestAuthHandler.http_error_401(
-      self, req, fp, code, msg, headers)
+        self, req, fp, code, msg, headers)
 
 
   def http_error_auth_reqed(self, auth_header, host, req, headers):
   def http_error_auth_reqed(self, auth_header, host, req, headers):
     try:
     try:
@@ -379,7 +379,7 @@ class _DigestAuthHandler(urllib.request.HTTPDigestAuthHandler):
         old_add_header(name, val)
         old_add_header(name, val)
       req.add_header = _add_header
       req.add_header = _add_header
       return urllib.request.AbstractDigestAuthHandler.http_error_auth_reqed(
       return urllib.request.AbstractDigestAuthHandler.http_error_auth_reqed(
-        self, auth_header, host, req, headers)
+          self, auth_header, host, req, headers)
     except:
     except:
       reset = getattr(self, 'reset_retry_count', None)
       reset = getattr(self, 'reset_retry_count', None)
       if reset is not None:
       if reset is not None:
@@ -406,7 +406,7 @@ class _KerberosAuthHandler(urllib.request.BaseHandler):
 
 
       if self.retried > 3:
       if self.retried > 3:
         raise urllib.request.HTTPError(req.get_full_url(), 401,
         raise urllib.request.HTTPError(req.get_full_url(), 401,
-          "Negotiate auth failed", headers, None)
+                                       "Negotiate auth failed", headers, None)
       else:
       else:
         self.retried += 1
         self.retried += 1
 
 

+ 13 - 13
manifest_xml.py

@@ -140,12 +140,12 @@ class XmlManifest(object):
     self._load_local_manifests = True
     self._load_local_manifests = True
 
 
     self.repoProject = MetaProject(self, 'repo',
     self.repoProject = MetaProject(self, 'repo',
-      gitdir=os.path.join(repodir, 'repo/.git'),
-      worktree=os.path.join(repodir, 'repo'))
+                                   gitdir=os.path.join(repodir, 'repo/.git'),
+                                   worktree=os.path.join(repodir, 'repo'))
 
 
     self.manifestProject = MetaProject(self, 'manifests',
     self.manifestProject = MetaProject(self, 'manifests',
-      gitdir=os.path.join(repodir, 'manifests.git'),
-      worktree=os.path.join(repodir, 'manifests'))
+                                       gitdir=os.path.join(repodir, 'manifests.git'),
+                                       worktree=os.path.join(repodir, 'manifests'))
 
 
     self._Unload()
     self._Unload()
 
 
@@ -462,12 +462,12 @@ class XmlManifest(object):
             self.localManifestWarning = True
             self.localManifestWarning = True
             print('warning: %s is deprecated; put local manifests '
             print('warning: %s is deprecated; put local manifests '
                   'in `%s` instead' % (LOCAL_MANIFEST_NAME,
                   'in `%s` instead' % (LOCAL_MANIFEST_NAME,
-                  os.path.join(self.repodir, LOCAL_MANIFESTS_DIR_NAME)),
+                                       os.path.join(self.repodir, LOCAL_MANIFESTS_DIR_NAME)),
                   file=sys.stderr)
                   file=sys.stderr)
           nodes.append(self._ParseManifestXml(local, self.repodir))
           nodes.append(self._ParseManifestXml(local, self.repodir))
 
 
         local_dir = os.path.abspath(os.path.join(self.repodir,
         local_dir = os.path.abspath(os.path.join(self.repodir,
-                                    LOCAL_MANIFESTS_DIR_NAME))
+                                                 LOCAL_MANIFESTS_DIR_NAME))
         try:
         try:
           for local_file in sorted(platform_utils.listdir(local_dir)):
           for local_file in sorted(platform_utils.listdir(local_dir)):
             if local_file.endswith('.xml'):
             if local_file.endswith('.xml'):
@@ -512,7 +512,7 @@ class XmlManifest(object):
         fp = os.path.join(include_root, name)
         fp = os.path.join(include_root, name)
         if not os.path.isfile(fp):
         if not os.path.isfile(fp):
           raise ManifestParseError("include %s doesn't exist or isn't a file"
           raise ManifestParseError("include %s doesn't exist or isn't a file"
-              % (name,))
+                                   % (name,))
         try:
         try:
           nodes.extend(self._ParseManifestXml(fp, include_root))
           nodes.extend(self._ParseManifestXml(fp, include_root))
         # should isolate this to the exact exception, but that's
         # should isolate this to the exact exception, but that's
@@ -811,21 +811,21 @@ class XmlManifest(object):
       remote = self._default.remote
       remote = self._default.remote
     if remote is None:
     if remote is None:
       raise ManifestParseError("no remote for project %s within %s" %
       raise ManifestParseError("no remote for project %s within %s" %
-            (name, self.manifestFile))
+                               (name, self.manifestFile))
 
 
     revisionExpr = node.getAttribute('revision') or remote.revision
     revisionExpr = node.getAttribute('revision') or remote.revision
     if not revisionExpr:
     if not revisionExpr:
       revisionExpr = self._default.revisionExpr
       revisionExpr = self._default.revisionExpr
     if not revisionExpr:
     if not revisionExpr:
       raise ManifestParseError("no revision for project %s within %s" %
       raise ManifestParseError("no revision for project %s within %s" %
-            (name, self.manifestFile))
+                               (name, self.manifestFile))
 
 
     path = node.getAttribute('path')
     path = node.getAttribute('path')
     if not path:
     if not path:
       path = name
       path = name
     if path.startswith('/'):
     if path.startswith('/'):
       raise ManifestParseError("project %s path cannot be absolute in %s" %
       raise ManifestParseError("project %s path cannot be absolute in %s" %
-            (name, self.manifestFile))
+                               (name, self.manifestFile))
 
 
     rebase = node.getAttribute('rebase')
     rebase = node.getAttribute('rebase')
     if not rebase:
     if not rebase:
@@ -1054,7 +1054,7 @@ class XmlManifest(object):
       keep = "true"
       keep = "true"
     if keep != "true" and keep != "false":
     if keep != "true" and keep != "false":
       raise ManifestParseError('optional "keep" attribute must be '
       raise ManifestParseError('optional "keep" attribute must be '
-            '"true" or "false"')
+                               '"true" or "false"')
     project.AddAnnotation(name, value, keep)
     project.AddAnnotation(name, value, keep)
 
 
   def _get_remote(self, node):
   def _get_remote(self, node):
@@ -1065,7 +1065,7 @@ class XmlManifest(object):
     v = self._remotes.get(name)
     v = self._remotes.get(name)
     if not v:
     if not v:
       raise ManifestParseError("remote %s not defined in %s" %
       raise ManifestParseError("remote %s not defined in %s" %
-            (name, self.manifestFile))
+                               (name, self.manifestFile))
     return v
     return v
 
 
   def _reqatt(self, node, attname):
   def _reqatt(self, node, attname):
@@ -1075,7 +1075,7 @@ class XmlManifest(object):
     v = node.getAttribute(attname)
     v = node.getAttribute(attname)
     if not v:
     if not v:
       raise ManifestParseError("no %s in <%s> within %s" %
       raise ManifestParseError("no %s in <%s> within %s" %
-            (attname, node.nodeName, self.manifestFile))
+                               (attname, node.nodeName, self.manifestFile))
     return v
     return v
 
 
   def projectsDiff(self, manifest):
   def projectsDiff(self, manifest):

+ 18 - 18
progress.py

@@ -53,9 +53,9 @@ class Progress(object):
 
 
     if self._total <= 0:
     if self._total <= 0:
       sys.stderr.write('%s\r%s: %d,' % (
       sys.stderr.write('%s\r%s: %d,' % (
-        CSI_ERASE_LINE,
-        self._title,
-        self._done))
+          CSI_ERASE_LINE,
+          self._title,
+          self._done))
       sys.stderr.flush()
       sys.stderr.flush()
     else:
     else:
       p = (100 * self._done) / self._total
       p = (100 * self._done) / self._total
@@ -63,13 +63,13 @@ class Progress(object):
       if self._lastp != p or self._always_print_percentage:
       if self._lastp != p or self._always_print_percentage:
         self._lastp = p
         self._lastp = p
         sys.stderr.write('%s\r%s: %3d%% (%d%s/%d%s)%s%s%s' % (
         sys.stderr.write('%s\r%s: %3d%% (%d%s/%d%s)%s%s%s' % (
-          CSI_ERASE_LINE,
-          self._title,
-          p,
-          self._done, self._units,
-          self._total, self._units,
-          ' ' if msg else '', msg,
-          "\n" if self._print_newline else ""))
+            CSI_ERASE_LINE,
+            self._title,
+            p,
+            self._done, self._units,
+            self._total, self._units,
+            ' ' if msg else '', msg,
+            "\n" if self._print_newline else ""))
         sys.stderr.flush()
         sys.stderr.flush()
 
 
   def end(self):
   def end(self):
@@ -78,16 +78,16 @@ class Progress(object):
 
 
     if self._total <= 0:
     if self._total <= 0:
       sys.stderr.write('%s\r%s: %d, done.\n' % (
       sys.stderr.write('%s\r%s: %d, done.\n' % (
-        CSI_ERASE_LINE,
-        self._title,
-        self._done))
+          CSI_ERASE_LINE,
+          self._title,
+          self._done))
       sys.stderr.flush()
       sys.stderr.flush()
     else:
     else:
       p = (100 * self._done) / self._total
       p = (100 * self._done) / self._total
       sys.stderr.write('%s\r%s: %3d%% (%d%s/%d%s), done.\n' % (
       sys.stderr.write('%s\r%s: %3d%% (%d%s/%d%s), done.\n' % (
-        CSI_ERASE_LINE,
-        self._title,
-        p,
-        self._done, self._units,
-        self._total, self._units))
+          CSI_ERASE_LINE,
+          self._title,
+          p,
+          self._done, self._units,
+          self._total, self._units))
       sys.stderr.flush()
       sys.stderr.flush()

+ 1 - 1
project.py

@@ -2341,7 +2341,7 @@ class Project(object):
     else:
     else:
       branch = self.revisionExpr
       branch = self.revisionExpr
     if (not self.manifest.IsMirror and is_sha1 and depth
     if (not self.manifest.IsMirror and is_sha1 and depth
-        and git_require((1, 8, 3))):
+            and git_require((1, 8, 3))):
       # Shallow checkout of a specific commit, fetch from that commit and not
       # Shallow checkout of a specific commit, fetch from that commit and not
       # the heads only as the commit might be deeper in the history.
       # the heads only as the commit might be deeper in the history.
       spec.append(branch)
       spec.append(branch)

+ 1 - 1
subcmds/__init__.py

@@ -40,7 +40,7 @@ for py in os.listdir(my_dir):
       cmd = getattr(mod, clsn)()
       cmd = getattr(mod, clsn)()
     except AttributeError:
     except AttributeError:
       raise SyntaxError('%s/%s does not define class %s' % (
       raise SyntaxError('%s/%s does not define class %s' % (
-                         __name__, py, clsn))
+          __name__, py, clsn))
 
 
     name = name.replace('_', '-')
     name = name.replace('_', '-')
     cmd.NAME = name
     cmd.NAME = name

+ 1 - 1
subcmds/abandon.py

@@ -95,5 +95,5 @@ It is equivalent to "git branch -D <branchname>".
           result = "all project"
           result = "all project"
         else:
         else:
           result = "%s" % (
           result = "%s" % (
-            ('\n' + ' ' * width + '| ').join(p.relpath for p in success[br]))
+              ('\n' + ' ' * width + '| ').join(p.relpath for p in success[br]))
         print("%s%s| %s\n" % (br, ' ' * (width - len(br)), result), file=sys.stderr)
         print("%s%s| %s\n" % (br, ' ' * (width - len(br)), result), file=sys.stderr)

+ 20 - 20
subcmds/forall.py

@@ -28,10 +28,10 @@ from command import Command, MirrorSafeCommand
 import platform_utils
 import platform_utils
 
 
 _CAN_COLOR = [
 _CAN_COLOR = [
-  'branch',
-  'diff',
-  'grep',
-  'log',
+    'branch',
+    'diff',
+    'grep',
+    'log',
 ]
 ]
 
 
 
 
@@ -170,14 +170,14 @@ without iterating through the remaining projects.
     else:
     else:
       lrev = None
       lrev = None
     return {
     return {
-      'name': project.name,
-      'relpath': project.relpath,
-      'remote_name': project.remote.name,
-      'lrev': lrev,
-      'rrev': project.revisionExpr,
-      'annotations': dict((a.name, a.value) for a in project.annotations),
-      'gitdir': project.gitdir,
-      'worktree': project.worktree,
+        'name': project.name,
+        'relpath': project.relpath,
+        'remote_name': project.remote.name,
+        'lrev': lrev,
+        'rrev': project.revisionExpr,
+        'annotations': dict((a.name, a.value) for a in project.annotations),
+        'gitdir': project.gitdir,
+        'worktree': project.worktree,
     }
     }
 
 
   def ValidateOptions(self, opt, args):
   def ValidateOptions(self, opt, args):
@@ -196,8 +196,8 @@ without iterating through the remaining projects.
     cmd.extend(opt.command[1:])
     cmd.extend(opt.command[1:])
 
 
     if opt.project_header \
     if opt.project_header \
-    and not shell \
-    and cmd[0] == 'git':
+            and not shell \
+            and cmd[0] == 'git':
       # If this is a direct git command that can enable colorized
       # If this is a direct git command that can enable colorized
       # output and the user prefers coloring, add --color into the
       # output and the user prefers coloring, add --color into the
       # command line because we are going to wrap the command into
       # command line because we are going to wrap the command into
@@ -220,7 +220,7 @@ without iterating through the remaining projects.
 
 
     smart_sync_manifest_name = "smart_sync_override.xml"
     smart_sync_manifest_name = "smart_sync_override.xml"
     smart_sync_manifest_path = os.path.join(
     smart_sync_manifest_path = os.path.join(
-      self.manifest.manifestProject.worktree, smart_sync_manifest_name)
+        self.manifest.manifestProject.worktree, smart_sync_manifest_name)
 
 
     if os.path.isfile(smart_sync_manifest_path):
     if os.path.isfile(smart_sync_manifest_path):
       self.manifest.Override(smart_sync_manifest_path)
       self.manifest.Override(smart_sync_manifest_path)
@@ -238,8 +238,8 @@ without iterating through the remaining projects.
     try:
     try:
       config = self.manifest.manifestProject.config
       config = self.manifest.manifestProject.config
       results_it = pool.imap(
       results_it = pool.imap(
-         DoWorkWrapper,
-         self.ProjectArgs(projects, mirror, opt, cmd, shell, config))
+          DoWorkWrapper,
+          self.ProjectArgs(projects, mirror, opt, cmd, shell, config))
       pool.close()
       pool.close()
       for r in results_it:
       for r in results_it:
         rc = rc or r
         rc = rc or r
@@ -253,7 +253,7 @@ without iterating through the remaining projects.
     except Exception as e:
     except Exception as e:
       # Catch any other exceptions raised
       # Catch any other exceptions raised
       print('Got an error, terminating the pool: %s: %s' %
       print('Got an error, terminating the pool: %s: %s' %
-              (type(e).__name__, e),
+            (type(e).__name__, e),
             file=sys.stderr)
             file=sys.stderr)
       pool.terminate()
       pool.terminate()
       rc = rc or getattr(e, 'errno', 1)
       rc = rc or getattr(e, 'errno', 1)
@@ -268,7 +268,7 @@ without iterating through the remaining projects.
         project = self._SerializeProject(p)
         project = self._SerializeProject(p)
       except Exception as e:
       except Exception as e:
         print('Project list error on project %s: %s: %s' %
         print('Project list error on project %s: %s: %s' %
-                (p.name, type(e).__name__, e),
+              (p.name, type(e).__name__, e),
               file=sys.stderr)
               file=sys.stderr)
         return
         return
       except KeyboardInterrupt:
       except KeyboardInterrupt:
@@ -331,7 +331,7 @@ def DoWork(project, mirror, opt, cmd, shell, cnt, config):
     if opt.ignore_missing:
     if opt.ignore_missing:
       return 0
       return 0
     if ((opt.project_header and opt.verbose)
     if ((opt.project_header and opt.verbose)
-        or not opt.project_header):
+            or not opt.project_header):
       print('skipping %s/' % project['relpath'], file=sys.stderr)
       print('skipping %s/' % project['relpath'], file=sys.stderr)
     return 1
     return 1
 
 

+ 4 - 4
subcmds/help.py

@@ -72,13 +72,13 @@ Displays detailed usage information about a command.
       return False
       return False
 
 
     commandNames = list(sorted([name
     commandNames = list(sorted([name
-                    for name, command in self.commands.items()
-                    if command.common and gitc_supported(command)]))
+                                for name, command in self.commands.items()
+                                if command.common and gitc_supported(command)]))
     self._PrintCommands(commandNames)
     self._PrintCommands(commandNames)
 
 
     print(
     print(
-"See 'repo help <command>' for more information on a specific command.\n"
-"See 'repo help --all' for a complete list of recognized commands.")
+        "See 'repo help <command>' for more information on a specific command.\n"
+        "See 'repo help --all' for a complete list of recognized commands.")
 
 
   def _PrintCommandHelp(self, cmd, header_prefix=''):
   def _PrintCommandHelp(self, cmd, header_prefix=''):
     class _Out(Coloring):
     class _Out(Coloring):

+ 5 - 5
subcmds/info.py

@@ -195,11 +195,11 @@ class Info(PagedCommand):
       commits = branch.commits
       commits = branch.commits
       date = branch.date
       date = branch.date
       self.text('%s %-33s (%2d commit%s, %s)' % (
       self.text('%s %-33s (%2d commit%s, %s)' % (
-        branch.name == project.CurrentBranch and '*' or ' ',
-        branch.name,
-        len(commits),
-        len(commits) != 1 and 's' or '',
-        date))
+          branch.name == project.CurrentBranch and '*' or ' ',
+          branch.name,
+          len(commits),
+          len(commits) != 1 and 's' or '',
+          date))
       self.out.nl()
       self.out.nl()
 
 
       for commit in commits:
       for commit in commits:

+ 5 - 5
subcmds/init.py

@@ -223,7 +223,7 @@ to update the working directory files.
     platformize = lambda x: 'platform-' + x
     platformize = lambda x: 'platform-' + x
     if opt.platform == 'auto':
     if opt.platform == 'auto':
       if (not opt.mirror and
       if (not opt.mirror and
-          not m.config.GetString('repo.mirror') == 'true'):
+              not m.config.GetString('repo.mirror') == 'true'):
         groups.append(platformize(platform.system().lower()))
         groups.append(platformize(platform.system().lower()))
     elif opt.platform == 'all':
     elif opt.platform == 'all':
       groups.extend(map(platformize, all_platforms))
       groups.extend(map(platformize, all_platforms))
@@ -280,10 +280,10 @@ to update the working directory files.
       m.config.SetString('repo.submodules', 'true')
       m.config.SetString('repo.submodules', 'true')
 
 
     if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet,
     if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet,
-        clone_bundle=not opt.no_clone_bundle,
-        current_branch_only=opt.current_branch_only,
-        no_tags=opt.no_tags, submodules=opt.submodules,
-        clone_filter=opt.clone_filter):
+                              clone_bundle=not opt.no_clone_bundle,
+                              current_branch_only=opt.current_branch_only,
+                              no_tags=opt.no_tags, submodules=opt.submodules,
+                              clone_filter=opt.clone_filter):
       r = m.GetRemote(m.remote.name)
       r = m.GetRemote(m.remote.name)
       print('fatal: cannot obtain manifest %s' % r.url, file=sys.stderr)
       print('fatal: cannot obtain manifest %s' % r.url, file=sys.stderr)
 
 

+ 3 - 3
subcmds/rebase.py

@@ -43,8 +43,8 @@ branch but need to incorporate new upstream changes "underneath" them.
 
 
   def _Options(self, p):
   def _Options(self, p):
     p.add_option('-i', '--interactive',
     p.add_option('-i', '--interactive',
-                dest="interactive", action="store_true",
-                help="interactive rebase (single project only)")
+                 dest="interactive", action="store_true",
+                 help="interactive rebase (single project only)")
 
 
     p.add_option('--fail-fast',
     p.add_option('--fail-fast',
                  dest='fail_fast', action='store_true',
                  dest='fail_fast', action='store_true',
@@ -82,7 +82,7 @@ branch but need to incorporate new upstream changes "underneath" them.
             file=sys.stderr)
             file=sys.stderr)
       if len(args) == 1:
       if len(args) == 1:
         print('note: project %s is mapped to more than one path' % (args[0],),
         print('note: project %s is mapped to more than one path' % (args[0],),
-            file=sys.stderr)
+              file=sys.stderr)
       return 1
       return 1
 
 
     # Setup the common git rebase args that we use for all projects.
     # Setup the common git rebase args that we use for all projects.

+ 1 - 1
subcmds/start.py

@@ -113,7 +113,7 @@ revision specified in the manifest.
           branch_merge = self.manifest.default.revisionExpr
           branch_merge = self.manifest.default.revisionExpr
 
 
       if not project.StartBranch(
       if not project.StartBranch(
-          nb, branch_merge=branch_merge, revision=opt.revision):
+              nb, branch_merge=branch_merge, revision=opt.revision):
         err.append(project)
         err.append(project)
     pm.end()
     pm.end()
 
 

+ 4 - 4
subcmds/status.py

@@ -126,8 +126,8 @@ the following meanings:
         continue
         continue
       if item in proj_dirs_parents:
       if item in proj_dirs_parents:
         self._FindOrphans(glob.glob('%s/.*' % item) +
         self._FindOrphans(glob.glob('%s/.*' % item) +
-            glob.glob('%s/*' % item),
-            proj_dirs, proj_dirs_parents, outstring)
+                          glob.glob('%s/*' % item),
+                          proj_dirs, proj_dirs_parents, outstring)
         continue
         continue
       outstring.append(''.join([status_header, item, '/']))
       outstring.append(''.join([status_header, item, '/']))
 
 
@@ -179,8 +179,8 @@ the following meanings:
 
 
         outstring = []
         outstring = []
         self._FindOrphans(glob.glob('.*') +
         self._FindOrphans(glob.glob('.*') +
-            glob.glob('*'),
-            proj_dirs, proj_dirs_parents, outstring)
+                          glob.glob('*'),
+                          proj_dirs, proj_dirs_parents, outstring)
 
 
         if outstring:
         if outstring:
           output = StatusColoring(self.manifest.globalConfig)
           output = StatusColoring(self.manifest.globalConfig)

+ 20 - 20
subcmds/sync.py

@@ -327,14 +327,14 @@ later is required to fix a server side protocol bug.
     try:
     try:
       try:
       try:
         success = project.Sync_NetworkHalf(
         success = project.Sync_NetworkHalf(
-          quiet=opt.quiet,
-          current_branch_only=opt.current_branch_only,
-          force_sync=opt.force_sync,
-          clone_bundle=not opt.no_clone_bundle,
-          no_tags=opt.no_tags, archive=self.manifest.IsArchive,
-          optimized_fetch=opt.optimized_fetch,
-          prune=opt.prune,
-          clone_filter=clone_filter)
+            quiet=opt.quiet,
+            current_branch_only=opt.current_branch_only,
+            force_sync=opt.force_sync,
+            clone_bundle=not opt.no_clone_bundle,
+            no_tags=opt.no_tags, archive=self.manifest.IsArchive,
+            optimized_fetch=opt.optimized_fetch,
+            prune=opt.prune,
+            clone_filter=clone_filter)
         self._fetch_times.Set(project, time.time() - start)
         self._fetch_times.Set(project, time.time() - start)
 
 
         # Lock around all the rest of the code, since printing, updating a set
         # Lock around all the rest of the code, since printing, updating a set
@@ -356,7 +356,7 @@ later is required to fix a server side protocol bug.
         pass
         pass
       except Exception as e:
       except Exception as e:
         print('error: Cannot fetch %s (%s: %s)'
         print('error: Cannot fetch %s (%s: %s)'
-            % (project.name, type(e).__name__, str(e)), file=sys.stderr)
+              % (project.name, type(e).__name__, str(e)), file=sys.stderr)
         err_event.set()
         err_event.set()
         raise
         raise
     finally:
     finally:
@@ -704,16 +704,16 @@ later is required to fix a server side protocol bug.
           gitdir = os.path.join(self.manifest.topdir, path, '.git')
           gitdir = os.path.join(self.manifest.topdir, path, '.git')
           if os.path.exists(gitdir):
           if os.path.exists(gitdir):
             project = Project(
             project = Project(
-                           manifest=self.manifest,
-                           name=path,
-                           remote=RemoteSpec('origin'),
-                           gitdir=gitdir,
-                           objdir=gitdir,
-                           worktree=os.path.join(self.manifest.topdir, path),
-                           relpath=path,
-                           revisionExpr='HEAD',
-                           revisionId=None,
-                           groups=None)
+                manifest=self.manifest,
+                name=path,
+                remote=RemoteSpec('origin'),
+                gitdir=gitdir,
+                objdir=gitdir,
+                worktree=os.path.join(self.manifest.topdir, path),
+                relpath=path,
+                revisionExpr='HEAD',
+                revisionId=None,
+                groups=None)
 
 
             if project.IsDirty() and opt.force_remove_dirty:
             if project.IsDirty() and opt.force_remove_dirty:
               print('WARNING: Removing dirty project "%s": uncommitted changes '
               print('WARNING: Removing dirty project "%s": uncommitted changes '
@@ -885,7 +885,7 @@ later is required to fix a server side protocol bug.
 
 
     manifest_name = opt.manifest_name
     manifest_name = opt.manifest_name
     smart_sync_manifest_path = os.path.join(
     smart_sync_manifest_path = os.path.join(
-      self.manifest.manifestProject.worktree, 'smart_sync_override.xml')
+        self.manifest.manifestProject.worktree, 'smart_sync_override.xml')
 
 
     if opt.smart_sync or opt.smart_tag:
     if opt.smart_sync or opt.smart_tag:
       manifest_name = self._SmartSyncSetup(opt, smart_sync_manifest_path)
       manifest_name = self._SmartSyncSetup(opt, smart_sync_manifest_path)

+ 11 - 11
subcmds/upload.py

@@ -218,10 +218,10 @@ Gerrit Code Review:  https://www.gerritcodereview.com/
       print('Upload project %s/ to remote branch %s%s:' %
       print('Upload project %s/ to remote branch %s%s:' %
             (project.relpath, destination, ' (draft)' if opt.draft else ''))
             (project.relpath, destination, ' (draft)' if opt.draft else ''))
       print('  branch %s (%2d commit%s, %s):' % (
       print('  branch %s (%2d commit%s, %s):' % (
-                    name,
-                    len(commit_list),
-                    len(commit_list) != 1 and 's' or '',
-                    date))
+          name,
+          len(commit_list),
+          len(commit_list) != 1 and 's' or '',
+          date))
       for commit in commit_list:
       for commit in commit_list:
         print('         %s' % commit)
         print('         %s' % commit)
 
 
@@ -422,18 +422,18 @@ Gerrit Code Review:  https://www.gerritcodereview.com/
           else:
           else:
             fmt = '\n       (%s)'
             fmt = '\n       (%s)'
           print(('[FAILED] %-15s %-15s' + fmt) % (
           print(('[FAILED] %-15s %-15s' + fmt) % (
-                 branch.project.relpath + '/',
-                 branch.name,
-                 str(branch.error)),
-                 file=sys.stderr)
+              branch.project.relpath + '/',
+              branch.name,
+              str(branch.error)),
+              file=sys.stderr)
       print()
       print()
 
 
     for branch in todo:
     for branch in todo:
       if branch.uploaded:
       if branch.uploaded:
         print('[OK    ] %-15s %s' % (
         print('[OK    ] %-15s %s' % (
-               branch.project.relpath + '/',
-               branch.name),
-               file=sys.stderr)
+            branch.project.relpath + '/',
+            branch.name),
+            file=sys.stderr)
 
 
     if have_errors:
     if have_errors:
       sys.exit(1)
       sys.exit(1)