autoland: fix PEP8 issues (
bug 1253393) r?smacleod
MozReview-Commit-ID: 8CSeCWE8ZD1
--- 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]