Fix style violations
authorGregory Szorc <gps@mozilla.com>
Mon, 22 Jul 2013 21:04:50 -0700
changeset 24 65f26af28bd40d7c441b2c5a9a1dbc217bcb0624
parent 23 38dd4d4b71cd1f2fce363d04026d006780f27f2f
child 25 7179b973f36182dffccd6dcd28026ddafdefb9a9
push id10
push usergszorc@mozilla.com
push dateTue, 23 Jul 2013 04:04:56 +0000
Fix style violations
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -92,17 +92,16 @@ import errno
 import os
 import shutil
 import sys
 
 import mercurial.commands as commands
 
 from mercurial.i18n import _
 from mercurial.commands import (
-    pull,
     push,
 )
 from mercurial.error import (
     RepoError,
 )
 from mercurial.localrepo import (
     repofilecache,
 )
@@ -134,16 +133,18 @@ colortable = {
     'buildstatus.failed': 'red',
     'buildstatus.testfailed': 'cyan',
 }
 
 
 # Override peer path lookup such that common names magically get resolved to
 # known URIs.
 old_peerorrepo = hg._peerorrepo
+
+
 def peerorrepo(ui, path, *args, **kwargs):
     # Always try the old mechanism first. That way if there is a local
     # path that shares the name of a magic remote the local path is accessible.
     try:
         return old_peerorrepo(ui, path, *args, **kwargs)
     except RepoError:
         tree, uri = resolve_trees_to_uris([path])[0]
 
@@ -201,17 +202,18 @@ def moztrees(ui, **opts):
         aliases = []
         for alias, targets in TREE_ALIASES.items():
             if len(targets) > 1:
                 continue
 
             if targets[0] == name:
                 aliases.append(alias)
 
-        ui.write('%s: %s\n' % (name.rjust(longest), ', '.join(sorted(aliases))))
+        ui.write('%s: %s\n' % (name.rjust(longest),
+            ', '.join(sorted(aliases))))
 
 
 @command('cloneunified', [], _('hg cloneunified [DEST]'))
 def cloneunified(ui, dest='gecko', **opts):
     """Clone main Mozilla repositories into a unified local repository.
 
     This command will clone the most common Mozilla repositories and will
     add changesets and remote tracking markers into a common repository.
@@ -227,17 +229,17 @@ def cloneunified(ui, dest='gecko', **opt
 
     success = False
 
     try:
         for tree in ('esr17', 'b2g18', 'release', 'beta', 'aurora', 'central',
             'inbound'):
             peer = hg.peer(ui, {}, tree)
             ui.warn('Pulling from %s.\n' % peer.url())
-            result = repo.pull(peer)
+            repo.pull(peer)
         res = hg.update(repo, repo.lookup('central/default'))
         success = True
         return res
     finally:
         if not success:
             shutil.rmtree(path)
 
 
@@ -276,17 +278,16 @@ def treestatus(ui, *trees, **opts):
     If trees are open, it is OK to land code on them.
 
     If trees require approval, you'll need to obtain approval from
     release management to land changes.
 
     If trees are closed, you shouldn't push unless you are fixing the reason
     the tree is closed.
     """
-    from mozautomation.repository import resolve_trees_to_official
     from mozautomation.treestatus import TreeStatusClient
 
     client = TreeStatusClient()
     status = client.all()
 
     trees = resolve_trees_to_official(trees)
 
     if trees:
@@ -406,17 +407,17 @@ def reposetup(ui, repo):
         def remoterefs(self):
             return remoterefs(self)
 
         # Resolve remote ref symbols. For some reason, we need both lookup
         # and findtags implemented.
         def lookup(self, key):
             try:
                 key = self.remoterefs[key]
-            except KeyError, TypeError:
+            except (KeyError, TypeError):
                 pass
 
             return orig_lookup(key)
 
         def _findtags(self):
             tags, tagtypes = orig_findtags()
             tags.update(self.remoterefs)