autoland: fix PEP8 issues (bug 1253393) r?smacleod draft
authorbyron jones <glob@mozilla.com>
Fri, 15 Jul 2016 13:26:53 +0800
changeset 8975 fa1e02f2094fe92966eddfff2a2e7421b8d755e3
parent 8973 9bf139a2cdbe4c02eefbdcb1196b73b3d094619f
child 8976 08fdf631ddc7a8e5d803d1c1424f2e8c6c131fd1
push id1036
push userbjones@mozilla.com
push dateWed, 20 Jul 2016 07:34:03 +0000
reviewerssmacleod
bugs1253393
autoland: fix PEP8 issues (bug 1253393) r?smacleod MozReview-Commit-ID: 8CSeCWE8ZD1
autoland/autoland/transplant.py
autoland/hgext/rewritecommitdescriptions.py
--- a/autoland/autoland/transplant.py
+++ b/autoland/autoland/transplant.py
@@ -153,23 +153,29 @@ def _transplant(logger, client, tree, de
                            'rewriting or rebasing your commits. The commits '
                            'being pushed no longer match what was requested. '
                            'Please file a bug.')
 
     # Now we push to the destination
     if trysyntax:
         if not trysyntax.startswith("try: "):
             trysyntax = "try: %s" % trysyntax
-
-        cmds = [['--encoding=utf-8', '--config', 'ui.allowemptycommit=true', 'commit', '-m', trysyntax],
-                ['log', '-r', 'tip', '-T', '{node|short}'],
-                ['push', '-r', '.', '-f', 'try']]
+        cmds = [
+            [
+                '--encoding=utf-8',
+                '--config', 'ui.allowemptycommit=true',
+                'commit',
+                '-m', trysyntax
+            ],
+            ['log', '-r', 'tip', '-T', '{node|short}'],
+            ['push', '-r', '.', '-f', 'try']
+        ]
     elif push_bookmark:
-        cmds =  [['bookmark', push_bookmark],
-                 ['push', '-B', push_bookmark, destination]]
+        cmds = [['bookmark', push_bookmark],
+                ['push', '-B', push_bookmark, destination]]
     else:
         cmds = [['push', '-r', 'tip', destination]]
 
     for cmd in cmds:
         try:
             output = run_hg(cmd)
             if 'log' in cmd:
                 result = output
@@ -178,10 +184,9 @@ def _transplant(logger, client, tree, de
             return False, formulate_hg_error(['hg'] + cmd, output)
 
     # Strip any lingering draft changesets
     try:
         run_hg(['strip', '--no-backup', '-r', 'not public()'])
     except hglib.error.CommandError as e:
         pass
 
-
     return landed, result
--- a/autoland/hgext/rewritecommitdescriptions.py
+++ b/autoland/hgext/rewritecommitdescriptions.py
@@ -1,13 +1,12 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 import json
 import os
-import sys
 
 from mercurial import (context,
                        cmdutil,
                        encoding,
                        phases)
 
 from mercurial.i18n import _
 
@@ -27,17 +26,18 @@ command = cmdutil.command(cmdtable)
            'path to json file with new commit descriptions', 'string')],
          _('hg rewritecommitdescriptions'))
 def rewrite_commit_descriptions(ui, repo, node, descriptions=None):
 
     description_map = {}
     with open(descriptions, 'rb') as f:
         raw_descriptions = json.load(f)
         for k in raw_descriptions:
-            description_map[k[:12]] = encoding.tolocal(raw_descriptions[k].encode('utf-8'))
+            description_map[k[:12]] = encoding.tolocal(
+                raw_descriptions[k].encode('utf-8'))
 
     if not node:
         node = 'tip'
 
     ctx = repo[node]
     nodes = [ctx.node()]
     for ancestor in ctx.ancestors():
         ctx = repo[ancestor]