[PATCH 1 of 6] cleanup: eradicate long lines

Brodie Rao brodie at sf.io
Sat May 12 08:39:30 CDT 2012


# HG changeset patch
# User Brodie Rao <brodie at sf.io>
# Date 1336827632 -7200
# Branch stable
# Node ID caaa087bfcd3a7cd9ed1902706edbea262d75f1d
# Parent  2fdd1902ed2d0862afd51f956379b0effac4e884
cleanup: eradicate long lines

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -137,7 +137,8 @@ pypats = [
     (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),
     (r'[^\n]\Z', "no trailing newline"),
     (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
-#    (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=', "don't use underbars in identifiers"),
+#    (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=',
+#     "don't use underbars in identifiers"),
     (r'^\s+(self\.)?[A-za-z][a-z0-9]+[A-Z]\w* = ',
      "don't use camelcase in identifiers"),
     (r'^\s*(if|while|def|class|except|try)\s[^[\n]*:\s*[^\\n]#\s]+',
diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -42,7 +42,8 @@ def perfwalk(ui, repo, *pats):
 
 def perfstatus(ui, repo, *pats):
     #m = match.always(repo.root, repo.getcwd())
-    #timer(lambda: sum(map(len, repo.dirstate.status(m, [], False, False, False))))
+    #timer(lambda: sum(map(len, repo.dirstate.status(m, [], False, False,
+    #                                                False))))
     timer(lambda: sum(map(len, repo.status())))
 
 def perfheads(ui, repo):
diff --git a/doc/gendoc.py b/doc/gendoc.py
--- a/doc/gendoc.py
+++ b/doc/gendoc.py
@@ -102,9 +102,9 @@ def show_doc(ui):
         ui.write("\n")
 
     section(ui, _("Extensions"))
-    ui.write(_("This section contains help for extensions that are distributed "
-               "together with Mercurial. Help for other extensions is available "
-               "in the help system."))
+    ui.write(_("This section contains help for extensions that are "
+               "distributed together with Mercurial. Help for other "
+               "extensions is available in the help system."))
     ui.write("\n\n"
              ".. contents::\n"
              "   :class: htmlonly\n"
diff --git a/hgext/bugzilla.py b/hgext/bugzilla.py
--- a/hgext/bugzilla.py
+++ b/hgext/bugzilla.py
@@ -416,7 +416,8 @@ class bzmysql(bzaccess):
         for id in bugs.keys():
             self.ui.status(_('  bug %s\n') % id)
             cmdfmt = self.ui.config('bugzilla', 'notify', self.default_notify)
-            bzdir = self.ui.config('bugzilla', 'bzdir', '/var/www/html/bugzilla')
+            bzdir = self.ui.config('bugzilla', 'bzdir',
+                                   '/var/www/html/bugzilla')
             try:
                 # Backwards-compatible with old notify string, which
                 # took one string. This will throw with a new format
@@ -468,8 +469,8 @@ class bzmysql(bzaccess):
                 userid = self.get_user_id(defaultuser)
                 user = defaultuser
             except KeyError:
-                raise util.Abort(_('cannot find bugzilla user id for %s or %s') %
-                                 (user, defaultuser))
+                raise util.Abort(_('cannot find bugzilla user id for %s or %s')
+                                 % (user, defaultuser))
         return (user, userid)
 
     def updatebug(self, bugid, newstate, text, committer):
diff --git a/hgext/convert/__init__.py b/hgext/convert/__init__.py
--- a/hgext/convert/__init__.py
+++ b/hgext/convert/__init__.py
@@ -328,7 +328,8 @@ cmdtable = {
           ('', 'root', '', _('specify cvsroot')),
           # Options specific to builtin cvsps
           ('', 'parents', '', _('show parent changesets')),
-          ('', 'ancestors', '', _('show current changeset in ancestor branches')),
+          ('', 'ancestors', '',
+           _('show current changeset in ancestor branches')),
           # Options that are ignored for compatibility with cvsps-2.1
           ('A', 'cvs-direct', None, _('ignored for compatibility')),
          ],
diff --git a/hgext/convert/cvs.py b/hgext/convert/cvs.py
--- a/hgext/convert/cvs.py
+++ b/hgext/convert/cvs.py
@@ -121,12 +121,13 @@ class convert_cvs(converter_source):
                         pf = open(cvspass)
                         for line in pf.read().splitlines():
                             part1, part2 = line.split(' ', 1)
+                            # /1 :pserver:user at example.com:2401/cvsroot/foo
+                            # Ah<Z
                             if part1 == '/1':
-                                # /1 :pserver:user at example.com:2401/cvsroot/foo Ah<Z
                                 part1, part2 = part2.split(' ', 1)
                                 format = format1
+                            # :pserver:user at example.com:/cvsroot/foo Ah<Z
                             else:
-                                # :pserver:user at example.com:/cvsroot/foo Ah<Z
                                 format = format0
                             if part1 == format:
                                 passw = part2
diff --git a/hgext/convert/cvsps.py b/hgext/convert/cvsps.py
--- a/hgext/convert/cvsps.py
+++ b/hgext/convert/cvsps.py
@@ -336,7 +336,8 @@ def createlog(ui, directory=None, root="
                 else:
                     myrev = '.'.join(myrev[:-2] + ['0', myrev[-2]])
                     branches = [b for b in branchmap if branchmap[b] == myrev]
-                    assert len(branches) == 1, 'unknown branch: %s' % e.mergepoint
+                    assert len(branches) == 1, ('unknown branch: %s'
+                                                % e.mergepoint)
                     e.mergepoint = branches[0]
             else:
                 e.mergepoint = None
diff --git a/hgext/convert/git.py b/hgext/convert/git.py
--- a/hgext/convert/git.py
+++ b/hgext/convert/git.py
@@ -181,8 +181,8 @@ class convert_git(converter_source):
                 m, f = l[:-1].split("\t")
                 changes.append(f)
         else:
-            fh = self.gitopen('git diff-tree --name-only --root -r %s "%s^%s" --'
-                             % (version, version, i + 1))
+            fh = self.gitopen('git diff-tree --name-only --root -r %s '
+                              '"%s^%s" --' % (version, version, i + 1))
             changes = [f.rstrip('\n') for f in fh]
         if fh.close():
             raise util.Abort(_('cannot read changes in %s') % version)
diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py
--- a/hgext/convert/hg.py
+++ b/hgext/convert/hg.py
@@ -294,7 +294,8 @@ class mercurial_source(converter_source)
         if not parents:
             files = sorted(ctx.manifest())
             # getcopies() is not needed for roots, but it is a simple way to
-            # detect missing revlogs and abort on errors or populate self.ignored
+            # detect missing revlogs and abort on errors or populate
+            # self.ignored
             self.getcopies(ctx, parents, files)
             return [(f, rev) for f in files if f not in self.ignored], {}
         if self._changescache and self._changescache[0] == rev:
diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -85,8 +85,8 @@ class changedpath(object):
         self.copyfrom_rev = p.copyfrom_rev
         self.action = p.action
 
-def get_log_child(fp, url, paths, start, end, limit=0, discover_changed_paths=True,
-                    strict_node_history=False):
+def get_log_child(fp, url, paths, start, end, limit=0,
+                  discover_changed_paths=True, strict_node_history=False):
     protocol = -1
     def receiver(orig_paths, revnum, author, date, message, pool):
         if orig_paths is not None:
@@ -276,7 +276,8 @@ class svn_source(converter_source):
             except ValueError:
                 raise util.Abort(_('svn: revision %s is not an integer') % rev)
 
-        self.trunkname = self.ui.config('convert', 'svn.trunk', 'trunk').strip('/')
+        self.trunkname = self.ui.config('convert', 'svn.trunk',
+                                        'trunk').strip('/')
         self.startrev = self.ui.config('convert', 'svn.startrev', default=0)
         try:
             self.startrev = int(self.startrev)
@@ -862,7 +863,8 @@ class svn_source(converter_source):
                     pass
         except SubversionException, (inst, num):
             if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION:
-                raise util.Abort(_('svn: branch has no revision %s') % to_revnum)
+                raise util.Abort(_('svn: branch has no revision %s')
+                                 % to_revnum)
             raise
 
     def getfile(self, file, rev):
@@ -949,8 +951,8 @@ class svn_source(converter_source):
             if not p.startswith('/'):
                 p = self.module + '/' + p
             relpaths.append(p.strip('/'))
-        args = [self.baseurl, relpaths, start, end, limit, discover_changed_paths,
-                strict_node_history]
+        args = [self.baseurl, relpaths, start, end, limit,
+                discover_changed_paths, strict_node_history]
         arg = encodeargs(args)
         hgexe = util.hgexecutable()
         cmd = '%s debugsvnlog' % util.shellquote(hgexe)
diff --git a/hgext/eol.py b/hgext/eol.py
--- a/hgext/eol.py
+++ b/hgext/eol.py
@@ -111,7 +111,8 @@ def tolf(s, params, ui, **kwargs):
         return s
     if ui.configbool('eol', 'only-consistent', True) and inconsistenteol(s):
         return s
-    if ui.configbool('eol', 'fix-trailing-newline', False) and s and s[-1] != '\n':
+    if (ui.configbool('eol', 'fix-trailing-newline', False)
+        and s and s[-1] != '\n'):
         s = s + '\n'
     return eolre.sub('\n', s)
 
@@ -121,7 +122,8 @@ def tocrlf(s, params, ui, **kwargs):
         return s
     if ui.configbool('eol', 'only-consistent', True) and inconsistenteol(s):
         return s
-    if ui.configbool('eol', 'fix-trailing-newline', False) and s and s[-1] != '\n':
+    if (ui.configbool('eol', 'fix-trailing-newline', False)
+        and s and s[-1] != '\n'):
         s = s + '\n'
     return eolre.sub('\r\n', s)
 
diff --git a/hgext/hgk.py b/hgext/hgk.py
--- a/hgext/hgk.py
+++ b/hgext/hgk.py
@@ -95,7 +95,8 @@ def catcommit(ui, repo, n, prefix, ctx=N
     nlprefix = '\n' + prefix
     if ctx is None:
         ctx = repo[n]
-    ui.write("tree %s\n" % short(ctx.changeset()[0])) # use ctx.node() instead ??
+    # use ctx.node() instead ??
+    ui.write("tree %s\n" % short(ctx.changeset()[0]))
     for p in ctx.parents():
         ui.write("parent %s\n" % p)
 
@@ -113,7 +114,8 @@ def catcommit(ui, repo, n, prefix, ctx=N
     ui.write("branch %s\n\n" % ctx.branch())
 
     if prefix != "":
-        ui.write("%s%s\n" % (prefix, description.replace('\n', nlprefix).strip()))
+        ui.write("%s%s\n" % (prefix,
+                             description.replace('\n', nlprefix).strip()))
     else:
         ui.write(description + "\n")
     if prefix:
diff --git a/hgext/highlight/__init__.py b/hgext/highlight/__init__.py
--- a/hgext/highlight/__init__.py
+++ b/hgext/highlight/__init__.py
@@ -51,11 +51,13 @@ def generate_css(web, req, tmpl):
     pg_style = web.config('web', 'pygments_style', 'colorful')
     fmter = highlight.HtmlFormatter(style = pg_style)
     req.respond(common.HTTP_OK, 'text/css')
-    return ['/* pygments_style = %s */\n\n' % pg_style, fmter.get_style_defs('')]
+    return ['/* pygments_style = %s */\n\n' % pg_style,
+            fmter.get_style_defs('')]
 
 def extsetup():
     # monkeypatch in the new version
-    extensions.wrapfunction(webcommands, '_filerevision', filerevision_highlight)
+    extensions.wrapfunction(webcommands, '_filerevision',
+                            filerevision_highlight)
     extensions.wrapfunction(webcommands, 'annotate', annotate_highlight)
     webcommands.highlightcss = generate_css
     webcommands.__all__.append('highlightcss')
diff --git a/hgext/inotify/__init__.py b/hgext/inotify/__init__.py
--- a/hgext/inotify/__init__.py
+++ b/hgext/inotify/__init__.py
@@ -46,7 +46,8 @@ def reposetup(ui, repo):
             files = match.files()
             if '.' in files:
                 files = []
-            if self._inotifyon and not ignored and not subrepos and not self._dirty:
+            if (self._inotifyon and not ignored and not subrepos and
+                not self._dirty):
                 cli = client(ui, repo)
                 try:
                     result = cli.statusquery(files, match, False,
diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1217,9 +1217,11 @@ class queue(object):
 
             if exact:
                 if move:
-                    raise util.Abort(_("cannot use --exact and --move together"))
+                    raise util.Abort(_('cannot use --exact and --move '
+                                       'together'))
                 if self.applied:
-                    raise util.Abort(_("cannot push --exact with applied patches"))
+                    raise util.Abort(_('cannot push --exact with applied '
+                                       'patches'))
                 root = self.series[start]
                 target = patchheader(self.join(root), self.plainmode).parent
                 if not target:
@@ -2141,7 +2143,8 @@ def init(ui, repo, **opts):
 
 @command("qclone",
          [('', 'pull', None, _('use pull protocol to copy metadata')),
-          ('U', 'noupdate', None, _('do not update the new working directories')),
+          ('U', 'noupdate', None,
+           _('do not update the new working directories')),
           ('', 'uncompressed', None,
            _('use uncompressed transfer (fast over LAN)')),
           ('p', 'patches', '',
@@ -2243,7 +2246,8 @@ def series(ui, repo, **opts):
     """print the entire series file
 
     Returns 0 on success."""
-    repo.mq.qseries(repo, missing=opts.get('missing'), summary=opts.get('summary'))
+    repo.mq.qseries(repo, missing=opts.get('missing'),
+                    summary=opts.get('summary'))
     return 0
 
 @command("qtop", seriesopts, _('hg qtop [-s]'))
@@ -2464,7 +2468,8 @@ def fold(ui, repo, *files, **opts):
         if p in patches or p == parent:
             ui.warn(_('Skipping already folded patch %s\n') % p)
         if q.isapplied(p):
-            raise util.Abort(_('qfold cannot fold already applied patch %s') % p)
+            raise util.Abort(_('qfold cannot fold already applied patch %s')
+                             % p)
         patches.append(p)
 
     for p in patches:
@@ -2567,7 +2572,8 @@ def guard(ui, repo, *args, **opts):
     args = list(args)
     if opts.get('list'):
         if args or opts.get('none'):
-            raise util.Abort(_('cannot mix -l/--list with options or arguments'))
+            raise util.Abort(_('cannot mix -l/--list with options or '
+                               'arguments'))
         for i in xrange(len(q.series)):
             status(i)
         return
@@ -2632,7 +2638,8 @@ def savename(path):
 
 @command("^qpush",
          [('f', 'force', None, _('apply on top of local changes')),
-          ('e', 'exact', None, _('apply the target patch to its recorded parent')),
+          ('e', 'exact', None,
+           _('apply the target patch to its recorded parent')),
           ('l', 'list', None, _('list patch name in commit text')),
           ('a', 'all', None, _('apply all patches')),
           ('m', 'merge', None, _('merge from another queue (DEPRECATED)')),
@@ -3310,8 +3317,8 @@ def reposetup(ui, repo):
             tags = result[0]
             for patch in mqtags:
                 if patch[1] in tags:
-                    self.ui.warn(_('Tag %s overrides mq patch of the same name\n')
-                                 % patch[1])
+                    self.ui.warn(_('Tag %s overrides mq patch of the same '
+                                   'name\n') % patch[1])
                 else:
                     tags[patch[1]] = patch[0]
 
diff --git a/hgext/notify.py b/hgext/notify.py
--- a/hgext/notify.py
+++ b/hgext/notify.py
@@ -353,8 +353,8 @@ def hook(ui, repo, hooktype, node=None, 
                     author = repo[rev].user()
             else:
                 data += ui.popbuffer()
-                ui.note(_('notify: suppressing notification for merge %d:%s\n') %
-                        (rev, repo[rev].hex()[:12]))
+                ui.note(_('notify: suppressing notification for merge %d:%s\n')
+                        % (rev, repo[rev].hex()[:12]))
                 ui.pushbuffer()
         if count:
             n.diff(ctx, repo['tip'])
diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -109,7 +109,8 @@ def makepatch(ui, repo, patchlines, opts
         msg = email.MIMEMultipart.MIMEMultipart()
         if body:
             msg.attach(mail.mimeencode(ui, body, _charsets, opts.get('test')))
-        p = mail.mimetextpatch('\n'.join(patchlines), 'x-patch', opts.get('test'))
+        p = mail.mimetextpatch('\n'.join(patchlines), 'x-patch',
+                               opts.get('test'))
         binnode = bin(node)
         # if node is mq patch, it will have the patch file's name as a tag
         if not patchname:
@@ -119,7 +120,8 @@ def makepatch(ui, repo, patchlines, opts
                 patchname = patchtags[0]
             elif total > 1:
                 patchname = cmdutil.makefilename(repo, '%b-%n.patch',
-                                                  binnode, seqno=idx, total=total)
+                                                 binnode, seqno=idx,
+                                                 total=total)
             else:
                 patchname = cmdutil.makefilename(repo, '%b.patch', binnode)
         disposition = 'inline'
diff --git a/hgext/record.py b/hgext/record.py
--- a/hgext/record.py
+++ b/hgext/record.py
@@ -516,10 +516,11 @@ def dorecord(ui, repo, commitfunc, cmdsu
                                '(use "hg commit" instead)'))
 
         changes = repo.status(match=match)[:3]
-        diffopts = mdiff.diffopts(git=True, nodates=True,
-                                  ignorews=opts.get('ignore_all_space'),
-                                  ignorewsamount=opts.get('ignore_space_change'),
-                                  ignoreblanklines=opts.get('ignore_blank_lines'))
+        diffopts = mdiff.diffopts(
+            git=True, nodates=True,
+            ignorews=opts.get('ignore_all_space'),
+            ignorewsamount=opts.get('ignore_space_change'),
+            ignoreblanklines=opts.get('ignore_blank_lines'))
         chunks = patch.diff(repo, changes=changes, opts=diffopts)
         fp = cStringIO.StringIO()
         fp.write(''.join(chunks))
diff --git a/hgext/zeroconf/__init__.py b/hgext/zeroconf/__init__.py
--- a/hgext/zeroconf/__init__.py
+++ b/hgext/zeroconf/__init__.py
@@ -119,7 +119,8 @@ class hgwebdirzc(hgwebdir_mod.hgwebdir):
             name = os.path.basename(repo)
             path = (prefix + repo).strip('/')
             desc = u.config('web', 'description', name)
-            publish(name, desc, path, util.getport(u.config("web", "port", 8000)))
+            publish(name, desc, path,
+                    util.getport(u.config("web", "port", 8000)))
 
 # listen
 
diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -323,13 +323,16 @@ def getremotechanges(ui, repo, other, on
 
     Returns a tuple (local, csets, cleanupfn):
 
-    "local" is a local repo from which to obtain the actual incoming changesets; it
-      is a bundlerepo for the obtained bundle when the original "other" is remote.
+    "local" is a local repo from which to obtain the actual incoming
+      changesets; it is a bundlerepo for the obtained bundle when the
+      original "other" is remote.
     "csets" lists the incoming changeset node ids.
-    "cleanupfn" must be called without arguments when you're done processing the
-      changes; it closes both the original "other" and the one returned here.
+    "cleanupfn" must be called without arguments when you're done processing
+      the changes; it closes both the original "other" and the one returned
+      here.
     '''
-    tmp = discovery.findcommonincoming(repo, other, heads=onlyheads, force=force)
+    tmp = discovery.findcommonincoming(repo, other, heads=onlyheads,
+                                       force=force)
     common, incoming, rheads = tmp
     if not incoming:
         try:
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1661,7 +1661,8 @@ def debugdag(ui, repo, file_=None, *revs
         revs = set((int(r) for r in revs))
         def events():
             for r in rlog:
-                yield 'n', (r, list(set(p for p in rlog.parentrevs(r) if p != -1)))
+                yield 'n', (r, list(set(p for p in rlog.parentrevs(r)
+                                        if p != -1)))
                 if r in revs:
                     yield 'l', (r, "r%i" % r)
     elif repo:
@@ -1680,7 +1681,8 @@ def debugdag(ui, repo, file_=None, *revs
                     if newb != b:
                         yield 'a', newb
                         b = newb
-                yield 'n', (r, list(set(p for p in cl.parentrevs(r) if p != -1)))
+                yield 'n', (r, list(set(p for p in cl.parentrevs(r)
+                                        if p != -1)))
                 if tags:
                     ls = labels.get(r)
                     if ls:
@@ -1738,7 +1740,8 @@ def debugdate(ui, date, range=None, **op
     _('[-l REV] [-r REV] [-b BRANCH]... [OTHER]'))
 def debugdiscovery(ui, repo, remoteurl="default", **opts):
     """runs the changeset discovery protocol in isolation"""
-    remoteurl, branches = hg.parseurl(ui.expandpath(remoteurl), opts.get('branch'))
+    remoteurl, branches = hg.parseurl(ui.expandpath(remoteurl),
+                                      opts.get('branch'))
     remote = hg.peer(repo, opts, remoteurl)
     ui.status(_('comparing with %s\n') % util.hidepassword(remoteurl))
 
@@ -1748,7 +1751,8 @@ def debugdiscovery(ui, repo, remoteurl="
     def doit(localheads, remoteheads):
         if opts.get('old'):
             if localheads:
-                raise util.Abort('cannot use localheads with old style discovery')
+                raise util.Abort('cannot use localheads with old style '
+                                 'discovery')
             common, _in, hds = treediscovery.findcommonincoming(repo, remote,
                                                                 force=True)
             common = set(common)
@@ -1875,7 +1879,8 @@ def debugindex(ui, repo, file_ = None, *
                  " nodeid       p1           p2\n")
     elif format == 1:
         ui.write("   rev flag   offset   length"
-                 "     size " + basehdr + "   link     p1     p2       nodeid\n")
+                 "     size " + basehdr + "   link     p1     p2"
+                 "       nodeid\n")
 
     for i in r:
         node = r.node(i)
@@ -2000,8 +2005,8 @@ def debuginstall(ui):
 def debugknown(ui, repopath, *ids, **opts):
     """test whether node ids are known to a repo
 
-    Every ID must be a full-length hex node id string. Returns a list of 0s and 1s
-    indicating unknown/known.
+    Every ID must be a full-length hex node id string. Returns a list of 0s
+    and 1s indicating unknown/known.
     """
     repo = hg.peer(ui, opts, repopath)
     if not repo.capable('known'):
@@ -2233,13 +2238,17 @@ def debugrevlog(ui, repo, file_ = None, 
         fmt2 = pcfmtstr(numdeltas, 4)
         ui.write('deltas against prev  : ' + fmt % pcfmt(numprev, numdeltas))
         if numprev > 0:
-            ui.write('    where prev = p1  : ' + fmt2 % pcfmt(nump1prev, numprev))
-            ui.write('    where prev = p2  : ' + fmt2 % pcfmt(nump2prev, numprev))
-            ui.write('    other            : ' + fmt2 % pcfmt(numoprev, numprev))
+            ui.write('    where prev = p1  : ' + fmt2 % pcfmt(nump1prev,
+                                                              numprev))
+            ui.write('    where prev = p2  : ' + fmt2 % pcfmt(nump2prev,
+                                                              numprev))
+            ui.write('    other            : ' + fmt2 % pcfmt(numoprev,
+                                                              numprev))
         if gdelta:
             ui.write('deltas against p1    : ' + fmt % pcfmt(nump1, numdeltas))
             ui.write('deltas against p2    : ' + fmt % pcfmt(nump2, numdeltas))
-            ui.write('deltas against other : ' + fmt % pcfmt(numother, numdeltas))
+            ui.write('deltas against other : ' + fmt % pcfmt(numother,
+                                                             numdeltas))
 
 @command('debugrevspec', [], ('REVSPEC'))
 def debugrevspec(ui, repo, expr):
@@ -4396,7 +4405,8 @@ def postincoming(ui, repo, modheads, opt
         if currentbranchheads == modheads:
             ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n"))
         elif currentbranchheads > 1:
-            ui.status(_("(run 'hg heads .' to see heads, 'hg merge' to merge)\n"))
+            ui.status(_("(run 'hg heads .' to see heads, 'hg merge' to "
+                        "merge)\n"))
         else:
             ui.status(_("(run 'hg heads' to see heads)\n"))
     else:
@@ -5368,7 +5378,8 @@ def summary(ui, repo, **opts):
         t = []
         source, branches = hg.parseurl(ui.expandpath('default'))
         other = hg.peer(repo, {}, source)
-        revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev'))
+        revs, checkout = hg.addbranchrevs(repo, other, branches,
+                                          opts.get('rev'))
         ui.debug('comparing with %s\n' % util.hidepassword(source))
         repo.ui.pushbuffer()
         commoninc = discovery.findcommonincoming(repo, other)
diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py
--- a/mercurial/commandserver.py
+++ b/mercurial/commandserver.py
@@ -142,8 +142,8 @@ class server(object):
             else:
                 logfile = open(logpath, 'a')
 
-        # the ui here is really the repo ui so take its baseui so we don't end up
-        # with its local configuration
+        # the ui here is really the repo ui so take its baseui so we don't end
+        # up with its local configuration
         self.ui = repo.baseui
         self.repo = repo
         self.repoui = repo.ui
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -237,7 +237,8 @@ class changectx(object):
                                         _('not found in manifest'))
         if '_manifestdelta' in self.__dict__ or path in self.files():
             if path in self._manifestdelta:
-                return self._manifestdelta[path], self._manifestdelta.flags(path)
+                return (self._manifestdelta[path],
+                        self._manifestdelta.flags(path))
         node, flag = self._repo.manifest.find(self._changeset[0], path)
         if not node:
             raise error.LookupError(self._node, path,
diff --git a/mercurial/dagparser.py b/mercurial/dagparser.py
--- a/mercurial/dagparser.py
+++ b/mercurial/dagparser.py
@@ -268,7 +268,8 @@ def parsedag(desc):
                 s += c
                 i += 1
                 c = nextch()
-            raise util.Abort(_("invalid character in dag description: %s...") % s)
+            raise util.Abort(_('invalid character in dag description: '
+                               '%s...') % s)
 
 def dagtextlines(events,
                  addspaces=True,
@@ -436,7 +437,9 @@ def dagtext(dag,
         >>> dagtext([('n', (0, [-1])), ('a', 'ann'), ('n', (1, [0]))])
         '+1 @ann +1'
 
-        >>> dagtext([('n', (0, [-1])), ('a', 'my annotation'), ('n', (1, [0]))])
+        >>> dagtext([('n', (0, [-1])),
+        ...          ('a', 'my annotation'),
+        ...          ('n', (1, [0]))])
         '+1 @"my annotation" +1'
 
     Commands:
@@ -447,7 +450,9 @@ def dagtext(dag,
         >>> dagtext([('n', (0, [-1])), ('c', 'my command'), ('n', (1, [0]))])
         '+1 !"my command" +1'
 
-        >>> dagtext([('n', (0, [-1])), ('C', 'my command line'), ('n', (1, [0]))])
+        >>> dagtext([('n', (0, [-1])),
+        ...          ('C', 'my command line'),
+        ...          ('n', (1, [0]))])
         '+1 !!my command line\\n+1'
 
     Comments:
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -695,7 +695,8 @@ class dirstate(object):
         if not skipstep3 and not exact:
             visit = sorted([f for f in dmap if f not in results and matchfn(f)])
             for nf, st in zip(visit, util.statfiles([join(i) for i in visit])):
-                if not st is None and not getkind(st.st_mode) in (regkind, lnkkind):
+                if (not st is None and
+                    not getkind(st.st_mode) in (regkind, lnkkind)):
                     st = None
                 results[nf] = st
         for s in subrepos:
diff --git a/mercurial/discovery.py b/mercurial/discovery.py
--- a/mercurial/discovery.py
+++ b/mercurial/discovery.py
@@ -86,13 +86,14 @@ class outgoing(object):
             self._computecommonmissing()
         return self._missing
 
-def findcommonoutgoing(repo, other, onlyheads=None, force=False, commoninc=None):
+def findcommonoutgoing(repo, other, onlyheads=None, force=False,
+                       commoninc=None):
     '''Return an outgoing instance to identify the nodes present in repo but
     not in other.
 
-    If onlyheads is given, only nodes ancestral to nodes in onlyheads (inclusive)
-    are included. If you already know the local repo's heads, passing them in
-    onlyheads is faster than letting them be recomputed here.
+    If onlyheads is given, only nodes ancestral to nodes in onlyheads
+    (inclusive) are included. If you already know the local repo's heads,
+    passing them in onlyheads is faster than letting them be recomputed here.
 
     If commoninc is given, it must the the result of a prior call to
     findcommonincoming(repo, other, force) to avoid recomputing it here.'''
diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -12,7 +12,8 @@ import cmdutil, encoding
 import ui as uimod
 
 class request(object):
-    def __init__(self, args, ui=None, repo=None, fin=None, fout=None, ferr=None):
+    def __init__(self, args, ui=None, repo=None, fin=None, fout=None,
+                 ferr=None):
         self.args = args
         self.ui = ui
         self.repo = repo
@@ -532,7 +533,8 @@ def _checkshellalias(lui, ui, args):
 
     if cmd and util.safehasattr(fn, 'shell'):
         d = lambda: fn(ui, *args[1:])
-        return lambda: runcommand(lui, None, cmd, args[:1], ui, options, d, [], {})
+        return lambda: runcommand(lui, None, cmd, args[:1], ui, options, d,
+                                  [], {})
 
     restorecommands()
 
@@ -680,7 +682,8 @@ def _dispatch(req):
                             return _dispatch(req)
                     if not path:
                         raise error.RepoError(_("no repository found in '%s'"
-                                                " (.hg not found)") % os.getcwd())
+                                                " (.hg not found)")
+                                              % os.getcwd())
                     raise
         if repo:
             ui = repo.ui
diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -73,7 +73,8 @@ class hgweb(object):
             self.repo = hg.repository(self.repo.ui, self.repo.root)
             self.maxchanges = int(self.config("web", "maxchanges", 10))
             self.stripecount = int(self.config("web", "stripes", 1))
-            self.maxshortchanges = int(self.config("web", "maxshortchanges", 60))
+            self.maxshortchanges = int(self.config("web", "maxshortchanges",
+                                                   60))
             self.maxfiles = int(self.config("web", "maxfiles", 10))
             self.allowpull = self.configbool("web", "allowpull", True)
             encoding.encoding = self.config("web", "encoding",
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -296,7 +296,8 @@ class localrepository(repo.repository):
                 fp.write('\n')
             for name in names:
                 m = munge and munge(name) or name
-                if self._tagscache.tagtypes and name in self._tagscache.tagtypes:
+                if (self._tagscache.tagtypes and
+                    name in self._tagscache.tagtypes):
                     old = self.tags().get(name, nullid)
                     fp.write('%s %s\n' % (hex(old), m))
                 fp.write('%s %s\n' % (hex(node), m))
@@ -376,7 +377,8 @@ class localrepository(repo.repository):
 
     @propertycache
     def _tagscache(self):
-        '''Returns a tagscache object that contains various tags related caches.'''
+        '''Returns a tagscache object that contains various tags related
+        caches.'''
 
         # This simplifies its cache management by having one decorated
         # function (this one) and the rest simply fetch things from it.
@@ -1190,7 +1192,8 @@ class localrepository(repo.repository):
             p1, p2 = self.dirstate.parents()
             hookp1, hookp2 = hex(p1), (p2 != nullid and hex(p2) or '')
             try:
-                self.hook("precommit", throw=True, parent1=hookp1, parent2=hookp2)
+                self.hook("precommit", throw=True, parent1=hookp1,
+                          parent2=hookp2)
                 ret = self.commitctx(cctx, True)
             except:
                 if edited:
@@ -1326,7 +1329,8 @@ class localrepository(repo.repository):
     def status(self, node1='.', node2=None, match=None,
                ignored=False, clean=False, unknown=False,
                listsubrepos=False):
-        """return status of files between two nodes or node and working directory
+        """return status of files between two nodes or node and working
+        directory.
 
         If node1 is None, use the first dirstate parent instead.
         If node2 is None, compare node1 with working directory.
@@ -1668,7 +1672,8 @@ class localrepository(repo.repository):
                         # http: return remote's addchangegroup() or 0 for error
                         ret = remote.unbundle(cg, remoteheads, 'push')
                     else:
-                        # we return an integer indicating remote head count change
+                        # we return an integer indicating remote head count
+                        # change
                         ret = remote.addchangegroup(cg, 'push', self.url())
 
                 if ret:
@@ -1900,7 +1905,8 @@ class localrepository(repo.repository):
             for fname in sorted(changedfiles):
                 filerevlog = self.file(fname)
                 if not len(filerevlog):
-                    raise util.Abort(_("empty or missing revlog for %s") % fname)
+                    raise util.Abort(_("empty or missing revlog for %s")
+                                     % fname)
                 fstate[0] = fname
                 fstate[1] = fnodes.pop(fname, {})
 
@@ -2000,7 +2006,8 @@ class localrepository(repo.repository):
             for fname in sorted(changedfiles):
                 filerevlog = self.file(fname)
                 if not len(filerevlog):
-                    raise util.Abort(_("empty or missing revlog for %s") % fname)
+                    raise util.Abort(_("empty or missing revlog for %s")
+                                     % fname)
                 fstate[0] = fname
                 nodelist = gennodelst(filerevlog)
                 if nodelist:
@@ -2257,7 +2264,8 @@ class localrepository(repo.repository):
                            (util.bytecount(total_bytes), elapsed,
                             util.bytecount(total_bytes / elapsed)))
 
-            # new requirements = old non-format requirements + new format-related
+            # new requirements = old non-format requirements +
+            #                    new format-related
             # requirements from the streamed-in repository
             requirements.update(set(self.requirements) - self.supportedformats)
             self._applyrequirements(requirements)
diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -124,8 +124,8 @@ class manifest(revlog.revlog):
                     addlist[start:end] = array.array('c', content)
                 else:
                     del addlist[start:end]
-            return "".join(struct.pack(">lll", start, end, len(content)) + content
-                           for start, end, content in x)
+            return "".join(struct.pack(">lll", start, end, len(content))
+                           + content for start, end, content in x)
 
         def checkforbidden(l):
             for f in l:
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -363,7 +363,8 @@ def applyupdates(repo, action, wctx, mct
             removed += 1
         elif m == "m": # merge
             if f == '.hgsubstate': # subrepo states need updating
-                subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), overwrite)
+                subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
+                                 overwrite)
                 continue
             f2, fd, flags, move = a[2:]
             repo.wopener.audit(fd)
diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -858,7 +858,8 @@ class hunk(object):
             self.lenb = int(self.lenb)
         self.starta = int(self.starta)
         self.startb = int(self.startb)
-        diffhelpers.addlines(lr, self.hunk, self.lena, self.lenb, self.a, self.b)
+        diffhelpers.addlines(lr, self.hunk, self.lena, self.lenb, self.a,
+                             self.b)
         # if we hit eof before finishing out the hunk, the last line will
         # be zero length.  Lets try to fix it up.
         while len(self.hunk[-1]) == 0:
@@ -1619,8 +1620,9 @@ def diff(repo, node1=None, node2=None, m
     if opts.git or opts.upgrade:
         copy = copies.pathcopies(ctx1, ctx2)
 
-    difffn = lambda opts, losedata: trydiff(repo, revs, ctx1, ctx2,
-                 modified, added, removed, copy, getfilectx, opts, losedata, prefix)
+    difffn = (lambda opts, losedata:
+                  trydiff(repo, revs, ctx1, ctx2, modified, added, removed,
+                          copy, getfilectx, opts, losedata, prefix))
     if opts.upgrade and not opts.git:
         try:
             def losedata(fn):
@@ -1861,7 +1863,8 @@ def diffstat(lines, width=80, git=False)
                        countwidth, count, pluses, minuses))
 
     if stats:
-        output.append(_(' %d files changed, %d insertions(+), %d deletions(-)\n')
+        output.append(_(' %d files changed, %d insertions(+), '
+                        '%d deletions(-)\n')
                       % (len(stats), totaladds, totalremoves))
 
     return ''.join(output)
diff --git a/mercurial/pure/mpatch.py b/mercurial/pure/mpatch.py
--- a/mercurial/pure/mpatch.py
+++ b/mercurial/pure/mpatch.py
@@ -85,10 +85,10 @@ def patches(a, bins):
             p1, p2, l = struct.unpack(">lll", m.read(12))
             pull(new, frags, p1 - last) # what didn't change
             pull([], frags, p2 - p1)    # what got deleted
-            new.append((l, pos + 12))        # what got added
+            new.append((l, pos + 12))   # what got added
             pos += l + 12
             last = p2
-        frags.extend(reversed(new))                    # what was left at the end
+        frags.extend(reversed(new))     # what was left at the end
 
     t = collect(b2, frags)
 
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -108,7 +108,8 @@ def tokenize(program):
                 pos += 1
             else:
                 raise error.ParseError(_("unterminated string"), s)
-        elif c.isalnum() or c in '._' or ord(c) > 127: # gather up a symbol/keyword
+        # gather up a symbol/keyword
+        elif c.isalnum() or c in '._' or ord(c) > 127:
             s = pos
             pos += 1
             while pos < l: # find end of symbol
@@ -257,7 +258,8 @@ def _firstancestors(repo, subset, x):
 
 def ancestorspec(repo, subset, x, n):
     """``set~n``
-    Changesets that are the Nth ancestor (first parents only) of a changeset in set.
+    Changesets that are the Nth ancestor (first parents only) of a changeset
+    in set.
     """
     try:
         n = int(n[1])
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -141,8 +141,9 @@ class pathauditor(object):
                 elif (stat.S_ISDIR(st.st_mode) and
                       os.path.isdir(os.path.join(curpath, '.hg'))):
                     if not self.callback or not self.callback(curpath):
-                        raise util.Abort(_("path '%s' is inside nested repo %r") %
-                                         (path, prefix))
+                        raise util.Abort(_("path '%s' is inside nested "
+                                           "repo %r")
+                                         % (path, prefix))
             prefixes.append(normprefix)
             parts.pop()
             normparts.pop()
@@ -654,8 +655,9 @@ def addremove(repo, pats=[], opts={}, dr
             unknown.append(abs)
             if repo.ui.verbose or not exact:
                 repo.ui.status(_('adding %s\n') % ((pats and rel) or abs))
-        elif repo.dirstate[abs] != 'r' and (not good or not os.path.lexists(target)
-            or (os.path.isdir(target) and not os.path.islink(target))):
+        elif (repo.dirstate[abs] != 'r' and
+              (not good or not os.path.lexists(target) or
+               (os.path.isdir(target) and not os.path.islink(target)))):
             deleted.append(abs)
             if repo.ui.verbose or not exact:
                 repo.ui.status(_('removing %s\n') % ((pats and rel) or abs))
@@ -764,8 +766,9 @@ def readrequires(opener, supported):
             missings.append(r)
     missings.sort()
     if missings:
-        raise error.RequirementError(_("unknown repository format: "
-            "requires features '%s' (upgrade Mercurial)") % "', '".join(missings))
+        raise error.RequirementError(
+            _("unknown repository format: requires features '%s' (upgrade "
+              "Mercurial)") % "', '".join(missings))
     return requirements
 
 class filecacheentry(object):
diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -134,11 +134,16 @@ def findcommonheads(ui, local, remote,
         return (ownheadhashes, True, srvheadhashes,)
 
     # full blown discovery
-    undecided = dag.nodeset() # own nodes where I don't know if remote knows them
-    common = set() # own nodes I know we both know
-    missing = set() # own nodes I know remote lacks
 
-    # treat remote heads (and maybe own heads) as a first implicit sample response
+    # own nodes where I don't know if remote knows them
+    undecided = dag.nodeset()
+    # own nodes I know we both know
+    common = set()
+    # own nodes I know remote lacks
+    missing = set()
+
+    # treat remote heads (and maybe own heads) as a first implicit sample
+    # response
     common.update(dag.ancestorset(srvheads))
     undecided.difference_update(common)
 
diff --git a/mercurial/similar.py b/mercurial/similar.py
--- a/mercurial/similar.py
+++ b/mercurial/similar.py
@@ -44,7 +44,8 @@ def _findsimilarmatches(repo, added, rem
     '''
     copies = {}
     for i, r in enumerate(removed):
-        repo.ui.progress(_('searching for similar files'), i, total=len(removed))
+        repo.ui.progress(_('searching for similar files'), i,
+                         total=len(removed))
 
         # lazily load text
         @util.cachefunc
diff --git a/mercurial/simplemerge.py b/mercurial/simplemerge.py
--- a/mercurial/simplemerge.py
+++ b/mercurial/simplemerge.py
@@ -222,7 +222,8 @@ class Merge3Text(object):
         # section a[0:ia] has been disposed of, etc
         iz = ia = ib = 0
 
-        for zmatch, zend, amatch, aend, bmatch, bend in self.find_sync_regions():
+        for region in self.find_sync_regions():
+            zmatch, zend, amatch, aend, bmatch, bend = region
             #print 'match base [%d:%d]' % (zmatch, zend)
 
             matchlen = zend - zmatch
diff --git a/mercurial/sshrepo.py b/mercurial/sshrepo.py
--- a/mercurial/sshrepo.py
+++ b/mercurial/sshrepo.py
@@ -86,7 +86,8 @@ class sshrepository(wireproto.wirereposi
             lines.append(l)
             max_noise -= 1
         else:
-            self._abort(error.RepoError(_("no suitable response from remote hg")))
+            self._abort(error.RepoError(_('no suitable response from '
+                                          'remote hg')))
 
         self.capabilities = set()
         for l in reversed(lines):
diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -200,7 +200,8 @@ def _updateprompt(ui, sub, dirty, local,
                  'use (l)ocal source (%s) or (r)emote source (%s)?\n')
                % (subrelpath(sub), local, remote))
     else:
-        msg = (_(' subrepository sources for %s differ (in checked out version)\n'
+        msg = (_(' subrepository sources for %s differ (in checked out '
+                 'version)\n'
                  'use (l)ocal source (%s) or (r)emote source (%s)?\n')
                % (subrelpath(sub), local, remote))
     return ui.promptchoice(msg, (_('&Local'), _('&Remote')), 0)
@@ -498,8 +499,9 @@ class hgsubrepo(abstractsubrepo):
                                      % (subrelpath(self), srcurl))
                 parentrepo = self._repo._subparent
                 shutil.rmtree(self._repo.path)
-                other, self._repo = hg.clone(self._repo._subparent.ui, {}, other,
-                                         self._repo.root, update=False)
+                other, self._repo = hg.clone(self._repo._subparent.ui, {},
+                                             other, self._repo.root,
+                                             update=False)
                 self._initrepo(parentrepo, source, create=True)
             else:
                 self._repo.ui.status(_('pulling subrepo %s from %s\n')
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -680,7 +680,8 @@ class ui(object):
         printed.'''
         if self.tracebackflag:
             if exc:
-                traceback.print_exception(exc[0], exc[1], exc[2], file=self.ferr)
+                traceback.print_exception(exc[0], exc[1], exc[2],
+                                          file=self.ferr)
             else:
                 traceback.print_exc(file=self.ferr)
         return self.tracebackflag
diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -377,7 +377,8 @@ if has_https:
                 keyfile = self.auth['key']
                 certfile = self.auth['cert']
 
-            conn = httpsconnection(host, port, keyfile, certfile, *args, **kwargs)
+            conn = httpsconnection(host, port, keyfile, certfile, *args,
+                                   **kwargs)
             conn.ui = self.ui
             return conn
 
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -24,9 +24,9 @@ class future(object):
 class batcher(object):
     '''base class for batches of commands submittable in a single request
 
-    All methods invoked on instances of this class are simply queued and return a
-    a future for the result. Once you call submit(), all the queued calls are
-    performed and the results set in their respective futures.
+    All methods invoked on instances of this class are simply queued and
+    return a a future for the result. Once you call submit(), all the queued
+    calls are performed and the results set in their respective futures.
     '''
     def __init__(self):
         self.calls = []
@@ -51,7 +51,8 @@ class localbatch(batcher):
 class remotebatch(batcher):
     '''batches the queued calls; uses as few roundtrips as possible'''
     def __init__(self, remote):
-        '''remote must support _submitbatch(encbatch) and _submitone(op, encargs)'''
+        '''remote must support _submitbatch(encbatch) and
+        _submitone(op, encargs)'''
         batcher.__init__(self)
         self.remote = remote
     def submit(self):
@@ -97,14 +98,14 @@ def batchable(f):
         encresref = future()
         # Return encoded arguments and future:
         yield encargs, encresref
-        # Assuming the future to be filled with the result from the batched request
-        # now. Decode it:
+        # Assuming the future to be filled with the result from the batched
+        # request now. Decode it:
         yield decode(encresref.value)
 
-    The decorator returns a function which wraps this coroutine as a plain method,
-    but adds the original method as an attribute called "batchable", which is
-    used by remotebatch to split the call into separate encoding and decoding
-    phases.
+    The decorator returns a function which wraps this coroutine as a plain
+    method, but adds the original method as an attribute called "batchable",
+    which is used by remotebatch to split the call into separate encoding and
+    decoding phases.
     '''
     def plain(*args, **opts):
         batchable = f(*args, **opts)
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -39,7 +39,8 @@ except:
 # The base IronPython distribution (as of 2.7.1) doesn't support bz2
 isironpython = False
 try:
-    isironpython = platform.python_implementation().lower().find("ironpython") != -1
+    isironpython = (platform.python_implementation()
+                    .lower().find("ironpython") != -1)
 except:
     pass
 
@@ -211,10 +212,12 @@ class hgbuild(build):
     # Insert hgbuildmo first so that files in mercurial/locale/ are found
     # when build_py is run next.
     sub_commands = [('build_mo', None),
-    # We also need build_ext before build_py. Otherwise, when 2to3 is called (in
-    # build_py), it will not find osutil & friends, thinking that those modules are
-    # global and, consequently, making a mess, now that all module imports are
-    # global.
+
+    # We also need build_ext before build_py. Otherwise, when 2to3 is
+    # called (in build_py), it will not find osutil & friends,
+    # thinking that those modules are global and, consequently, making
+    # a mess, now that all module imports are global.
+
                     ('build_ext', build.has_ext_modules),
                    ] + build.sub_commands
 
@@ -292,7 +295,8 @@ class hgbuildpy(build_py):
             self.distribution.ext_modules = []
         else:
             if not os.path.exists(os.path.join(get_python_inc(), 'Python.h')):
-                raise SystemExit("Python headers are required to build Mercurial")
+                raise SystemExit('Python headers are required to build '
+                                 'Mercurial')
 
     def find_modules(self):
         modules = build_py.find_modules(self)
diff --git a/tests/test-check-code-hg.t b/tests/test-check-code-hg.t
--- a/tests/test-check-code-hg.t
+++ b/tests/test-check-code-hg.t
@@ -8,16 +8,10 @@
   $ hg manifest | xargs "$check_code" || echo 'FAILURE IS NOT AN OPTION!!!'
 
   $ hg manifest | xargs "$check_code" --warnings --nolineno --per-file=0 || true
-  contrib/check-code.py:0:
-   > #    (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=', "don't use underbars in identifiers"),
-   warning: line over 80 characters
   contrib/perf.py:0:
    >         except:
    warning: naked except clause
   contrib/perf.py:0:
-   >     #timer(lambda: sum(map(len, repo.dirstate.status(m, [], False, False, False))))
-   warning: line over 80 characters
-  contrib/perf.py:0:
    >     except:
    warning: naked except clause
   contrib/setup3k.py:0:
@@ -34,18 +28,6 @@
   contrib/shrink-revlog.py:0:
    >         except:
    warning: naked except clause
-  doc/gendoc.py:0:
-   >                "together with Mercurial. Help for other extensions is available "
-   warning: line over 80 characters
-  hgext/bugzilla.py:0:
-   >                 raise util.Abort(_('cannot find bugzilla user id for %s or %s') %
-   warning: line over 80 characters
-  hgext/bugzilla.py:0:
-   >             bzdir = self.ui.config('bugzilla', 'bzdir', '/var/www/html/bugzilla')
-   warning: line over 80 characters
-  hgext/convert/__init__.py:0:
-   >           ('', 'ancestors', '', _('show current changeset in ancestor branches')),
-   warning: line over 80 characters
   hgext/convert/bzr.py:0:
    >         except:
    warning: naked except clause
@@ -59,12 +41,6 @@
   hgext/convert/convcmd.py:0:
    >         except:
    warning: naked except clause
-  hgext/convert/cvs.py:0:
-   >                                 # /1 :pserver:user at example.com:2401/cvsroot/foo Ah<Z
-   warning: line over 80 characters
-  hgext/convert/cvsps.py:0:
-   >                     assert len(branches) == 1, 'unknown branch: %s' % e.mergepoint
-   warning: line over 80 characters
   hgext/convert/cvsps.py:0:
    >                     ui.write('Ancestors: %s\n' % (','.join(r)))
    warning: unwrapped ui message
@@ -104,12 +80,6 @@
   hgext/convert/git.py:0:
    >             except:
    warning: naked except clause
-  hgext/convert/git.py:0:
-   >             fh = self.gitopen('git diff-tree --name-only --root -r %s "%s^%s" --'
-   warning: line over 80 characters
-  hgext/convert/hg.py:0:
-   >             # detect missing revlogs and abort on errors or populate self.ignored
-   warning: line over 80 characters
   hgext/convert/hg.py:0:
    >             except:
    warning: naked except clause
@@ -124,27 +94,11 @@
    >         except:
    warning: naked except clause
   hgext/convert/subversion.py:0:
-   >                 raise util.Abort(_('svn: branch has no revision %s') % to_revnum)
-   warning: line over 80 characters
-  hgext/convert/subversion.py:0:
    >             except:
    warning: naked except clause
   hgext/convert/subversion.py:0:
-   >         args = [self.baseurl, relpaths, start, end, limit, discover_changed_paths,
-   warning: line over 80 characters
-  hgext/convert/subversion.py:0:
-   >         self.trunkname = self.ui.config('convert', 'svn.trunk', 'trunk').strip('/')
-   warning: line over 80 characters
-  hgext/convert/subversion.py:0:
    >     except:
    warning: naked except clause
-  hgext/convert/subversion.py:0:
-   > def get_log_child(fp, url, paths, start, end, limit=0, discover_changed_paths=True,
-   warning: line over 80 characters
-  hgext/eol.py:0:
-   >     if ui.configbool('eol', 'fix-trailing-newline', False) and s and s[-1] != '\n':
-   warning: line over 80 characters
-   warning: line over 80 characters
   hgext/gpg.py:0:
    >                 except:
    warning: naked except clause
@@ -152,9 +106,6 @@
    > except:
    warning: naked except clause
   hgext/hgk.py:0:
-   >         ui.write("%s%s\n" % (prefix, description.replace('\n', nlprefix).strip()))
-   warning: line over 80 characters
-  hgext/hgk.py:0:
    >         ui.write("parent %s\n" % p)
    warning: unwrapped ui message
   hgext/hgk.py:0:
@@ -173,18 +124,8 @@
    >     ui.write("revision %d\n" % ctx.rev())
    warning: unwrapped ui message
   hgext/hgk.py:0:
-   >     ui.write("tree %s\n" % short(ctx.changeset()[0])) # use ctx.node() instead ??
-   warning: line over 80 characters
+   >     ui.write("tree %s\n" % short(ctx.changeset()[0]))
    warning: unwrapped ui message
-  hgext/highlight/__init__.py:0:
-   >     extensions.wrapfunction(webcommands, '_filerevision', filerevision_highlight)
-   warning: line over 80 characters
-  hgext/highlight/__init__.py:0:
-   >     return ['/* pygments_style = %s */\n\n' % pg_style, fmter.get_style_defs('')]
-   warning: line over 80 characters
-  hgext/inotify/__init__.py:0:
-   >             if self._inotifyon and not ignored and not subrepos and not self._dirty:
-   warning: line over 80 characters
   hgext/inotify/server.py:0:
    >                     except:
    warning: naked except clause
@@ -195,15 +136,6 @@
    >     ui.note("hg ci -m '%s'\n" % msg)
    warning: unwrapped ui message
   hgext/mq.py:0:
-   >                     raise util.Abort(_("cannot push --exact with applied patches"))
-   warning: line over 80 characters
-  hgext/mq.py:0:
-   >                     raise util.Abort(_("cannot use --exact and --move together"))
-   warning: line over 80 characters
-  hgext/mq.py:0:
-   >                     self.ui.warn(_('Tag %s overrides mq patch of the same name\n')
-   warning: line over 80 characters
-  hgext/mq.py:0:
    >                 except:
    warning: naked except clause
    warning: naked except clause
@@ -214,32 +146,11 @@
    warning: naked except clause
    warning: naked except clause
   hgext/mq.py:0:
-   >             raise util.Abort(_('cannot mix -l/--list with options or arguments'))
-   warning: line over 80 characters
-  hgext/mq.py:0:
-   >             raise util.Abort(_('qfold cannot fold already applied patch %s') % p)
-   warning: line over 80 characters
-  hgext/mq.py:0:
-   >           ('U', 'noupdate', None, _('do not update the new working directories')),
-   warning: line over 80 characters
-  hgext/mq.py:0:
-   >           ('e', 'exact', None, _('apply the target patch to its recorded parent')),
-   warning: line over 80 characters
-  hgext/mq.py:0:
    >         except:
    warning: naked except clause
   hgext/mq.py:0:
    >         ui.write("mq:     %s\n" % ', '.join(m))
    warning: unwrapped ui message
-  hgext/mq.py:0:
-   >     repo.mq.qseries(repo, missing=opts.get('missing'), summary=opts.get('summary'))
-   warning: line over 80 characters
-  hgext/notify.py:0:
-   >                 ui.note(_('notify: suppressing notification for merge %d:%s\n') %
-   warning: line over 80 characters
-  hgext/patchbomb.py:0:
-   >                                                   binnode, seqno=idx, total=total)
-   warning: line over 80 characters
   hgext/patchbomb.py:0:
    >             except:
    warning: naked except clause
@@ -247,39 +158,12 @@
    >             ui.write('Subject: %s\n' % subj)
    warning: unwrapped ui message
   hgext/patchbomb.py:0:
-   >         p = mail.mimetextpatch('\n'.join(patchlines), 'x-patch', opts.get('test'))
-   warning: line over 80 characters
-  hgext/patchbomb.py:0:
    >         ui.write('From: %s\n' % sender)
    warning: unwrapped ui message
-  hgext/record.py:0:
-   >                                   ignoreblanklines=opts.get('ignore_blank_lines'))
-   warning: line over 80 characters
-  hgext/record.py:0:
-   >                                   ignorewsamount=opts.get('ignore_space_change'),
-   warning: line over 80 characters
-  hgext/zeroconf/__init__.py:0:
-   >             publish(name, desc, path, util.getport(u.config("web", "port", 8000)))
-   warning: line over 80 characters
   hgext/zeroconf/__init__.py:0:
    >     except:
    warning: naked except clause
    warning: naked except clause
-  mercurial/bundlerepo.py:0:
-   >       is a bundlerepo for the obtained bundle when the original "other" is remote.
-   warning: line over 80 characters
-  mercurial/bundlerepo.py:0:
-   >     "local" is a local repo from which to obtain the actual incoming changesets; it
-   warning: line over 80 characters
-  mercurial/bundlerepo.py:0:
-   >     tmp = discovery.findcommonincoming(repo, other, heads=onlyheads, force=force)
-   warning: line over 80 characters
-  mercurial/commands.py:0:
-   >                  "     size " + basehdr + "   link     p1     p2       nodeid\n")
-   warning: line over 80 characters
-  mercurial/commands.py:0:
-   >                 raise util.Abort('cannot use localheads with old style discovery')
-   warning: line over 80 characters
   mercurial/commands.py:0:
    >                 ui.note('branch %s\n' % data)
    warning: unwrapped ui message
@@ -293,18 +177,9 @@
    >                 ui.write("unpruned common: %s\n" % " ".join([short(n)
    warning: unwrapped ui message
   mercurial/commands.py:0:
-   >                 yield 'n', (r, list(set(p for p in cl.parentrevs(r) if p != -1)))
-   warning: line over 80 characters
-  mercurial/commands.py:0:
-   >                 yield 'n', (r, list(set(p for p in rlog.parentrevs(r) if p != -1)))
-   warning: line over 80 characters
-  mercurial/commands.py:0:
    >             except:
    warning: naked except clause
   mercurial/commands.py:0:
-   >             ui.status(_("(run 'hg heads .' to see heads, 'hg merge' to merge)\n"))
-   warning: line over 80 characters
-  mercurial/commands.py:0:
    >             ui.write("format: id, p1, p2, cset, delta base, len(delta)\n")
    warning: unwrapped ui message
   mercurial/commands.py:0:
@@ -314,17 +189,7 @@
    >             ui.write("remote is subset\n")
    warning: unwrapped ui message
   mercurial/commands.py:0:
-   >             ui.write('    other            : ' + fmt2 % pcfmt(numoprev, numprev))
-   warning: line over 80 characters
-  mercurial/commands.py:0:
-   >             ui.write('    where prev = p1  : ' + fmt2 % pcfmt(nump1prev, numprev))
-   warning: line over 80 characters
-  mercurial/commands.py:0:
-   >             ui.write('    where prev = p2  : ' + fmt2 % pcfmt(nump2prev, numprev))
-   warning: line over 80 characters
-  mercurial/commands.py:0:
-   >             ui.write('deltas against other : ' + fmt % pcfmt(numother, numdeltas))
-   warning: line over 80 characters
+   >             ui.write('deltas against other : ' + fmt % pcfmt(numother,
    warning: unwrapped ui message
   mercurial/commands.py:0:
    >             ui.write('deltas against p1    : ' + fmt % pcfmt(nump1, numdeltas))
@@ -336,9 +201,6 @@
    >         except:
    warning: naked except clause
   mercurial/commands.py:0:
-   >         revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev'))
-   warning: line over 80 characters
-  mercurial/commands.py:0:
    >         ui.write("common heads: %s\n" % " ".join([short(n) for n in common]))
    warning: unwrapped ui message
   mercurial/commands.py:0:
@@ -354,12 +216,6 @@
    >         ui.write('uncompressed data size (min/max/avg) : %d / %d / %d\n'
    warning: unwrapped ui message
   mercurial/commands.py:0:
-   >     Every ID must be a full-length hex node id string. Returns a list of 0s and 1s
-   warning: line over 80 characters
-  mercurial/commands.py:0:
-   >     remoteurl, branches = hg.parseurl(ui.expandpath(remoteurl), opts.get('branch'))
-   warning: line over 80 characters
-  mercurial/commands.py:0:
    >     ui.write("digraph G {\n")
    warning: unwrapped ui message
   mercurial/commands.py:0:
@@ -402,48 +258,15 @@
   mercurial/commands.py:0:
    >     ui.write('symlink: %s\n' % (util.checklink(path) and 'yes' or 'no'))
    warning: unwrapped ui message
-  mercurial/commandserver.py:0:
-   >         # the ui here is really the repo ui so take its baseui so we don't end up
-   warning: line over 80 characters
-  mercurial/context.py:0:
-   >                 return self._manifestdelta[path], self._manifestdelta.flags(path)
-   warning: line over 80 characters
-  mercurial/dagparser.py:0:
-   >             raise util.Abort(_("invalid character in dag description: %s...") % s)
-   warning: line over 80 characters
-  mercurial/dagparser.py:0:
-   >         >>> dagtext([('n', (0, [-1])), ('C', 'my command line'), ('n', (1, [0]))])
-   warning: line over 80 characters
-  mercurial/dirstate.py:0:
-   >                 if not st is None and not getkind(st.st_mode) in (regkind, lnkkind):
-   warning: line over 80 characters
-  mercurial/discovery.py:0:
-   >     If onlyheads is given, only nodes ancestral to nodes in onlyheads (inclusive)
-   warning: line over 80 characters
-  mercurial/discovery.py:0:
-   > def findcommonoutgoing(repo, other, onlyheads=None, force=False, commoninc=None):
-   warning: line over 80 characters
-  mercurial/dispatch.py:0:
-   >                                                 " (.hg not found)") % os.getcwd())
-   warning: line over 80 characters
   mercurial/dispatch.py:0:
    >         except:
    warning: naked except clause
   mercurial/dispatch.py:0:
-   >         return lambda: runcommand(lui, None, cmd, args[:1], ui, options, d, [], {})
-   warning: line over 80 characters
-  mercurial/dispatch.py:0:
-   >     def __init__(self, args, ui=None, repo=None, fin=None, fout=None, ferr=None):
-   warning: line over 80 characters
-  mercurial/dispatch.py:0:
    >     except:
    warning: naked except clause
   mercurial/hg.py:0:
    >     except:
    warning: naked except clause
-  mercurial/hgweb/hgweb_mod.py:0:
-   >             self.maxshortchanges = int(self.config("web", "maxshortchanges", 60))
-   warning: line over 80 characters
   mercurial/keepalive.py:0:
    >         except:
    warning: naked except clause
@@ -451,105 +274,23 @@
    >     except:
    warning: naked except clause
   mercurial/localrepo.py:0:
-   >                         # we return an integer indicating remote head count change
-   warning: line over 80 characters
-  mercurial/localrepo.py:0:
-   >                     raise util.Abort(_("empty or missing revlog for %s") % fname)
-   warning: line over 80 characters
-   warning: line over 80 characters
-  mercurial/localrepo.py:0:
-   >                 if self._tagscache.tagtypes and name in self._tagscache.tagtypes:
-   warning: line over 80 characters
-  mercurial/localrepo.py:0:
-   >                 self.hook("precommit", throw=True, parent1=hookp1, parent2=hookp2)
-   warning: line over 80 characters
-  mercurial/localrepo.py:0:
-   >             # new requirements = old non-format requirements + new format-related
-   warning: line over 80 characters
-  mercurial/localrepo.py:0:
    >             except:
    warning: naked except clause
-  mercurial/localrepo.py:0:
-   >         """return status of files between two nodes or node and working directory
-   warning: line over 80 characters
-  mercurial/localrepo.py:0:
-   >         '''Returns a tagscache object that contains various tags related caches.'''
-   warning: line over 80 characters
-  mercurial/manifest.py:0:
-   >             return "".join(struct.pack(">lll", start, end, len(content)) + content
-   warning: line over 80 characters
-  mercurial/merge.py:0:
-   >                 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), overwrite)
-   warning: line over 80 characters
-  mercurial/patch.py:0:
-   >                  modified, added, removed, copy, getfilectx, opts, losedata, prefix)
-   warning: line over 80 characters
-  mercurial/patch.py:0:
-   >         diffhelpers.addlines(lr, self.hunk, self.lena, self.lenb, self.a, self.b)
-   warning: line over 80 characters
-  mercurial/patch.py:0:
-   >         output.append(_(' %d files changed, %d insertions(+), %d deletions(-)\n')
-   warning: line over 80 characters
   mercurial/patch.py:0:
    >     except:
    warning: naked except clause
-  mercurial/pure/mpatch.py:0:
-   >         frags.extend(reversed(new))                    # what was left at the end
-   warning: line over 80 characters
   mercurial/repair.py:0:
    >         except:
    warning: naked except clause
   mercurial/repair.py:0:
    >     except:
    warning: naked except clause
-  mercurial/revset.py:0:
-   >         elif c.isalnum() or c in '._' or ord(c) > 127: # gather up a symbol/keyword
-   warning: line over 80 characters
-  mercurial/revset.py:0:
-   >     Changesets that are the Nth ancestor (first parents only) of a changeset in set.
-   warning: line over 80 characters
-  mercurial/scmutil.py:0:
-   >                         raise util.Abort(_("path '%s' is inside nested repo %r") %
-   warning: line over 80 characters
-  mercurial/scmutil.py:0:
-   >             "requires features '%s' (upgrade Mercurial)") % "', '".join(missings))
-   warning: line over 80 characters
-  mercurial/scmutil.py:0:
-   >         elif repo.dirstate[abs] != 'r' and (not good or not os.path.lexists(target)
-   warning: line over 80 characters
-  mercurial/setdiscovery.py:0:
-   >     # treat remote heads (and maybe own heads) as a first implicit sample response
-   warning: line over 80 characters
-  mercurial/setdiscovery.py:0:
-   >     undecided = dag.nodeset() # own nodes where I don't know if remote knows them
-   warning: line over 80 characters
-  mercurial/similar.py:0:
-   >         repo.ui.progress(_('searching for similar files'), i, total=len(removed))
-   warning: line over 80 characters
-  mercurial/simplemerge.py:0:
-   >         for zmatch, zend, amatch, aend, bmatch, bend in self.find_sync_regions():
-   warning: line over 80 characters
-  mercurial/sshrepo.py:0:
-   >             self._abort(error.RepoError(_("no suitable response from remote hg")))
-   warning: line over 80 characters
   mercurial/sshrepo.py:0:
    >         except:
    warning: naked except clause
-  mercurial/subrepo.py:0:
-   >                 other, self._repo = hg.clone(self._repo._subparent.ui, {}, other,
-   warning: line over 80 characters
-  mercurial/subrepo.py:0:
-   >         msg = (_(' subrepository sources for %s differ (in checked out version)\n'
-   warning: line over 80 characters
   mercurial/transaction.py:0:
    >             except:
    warning: naked except clause
-  mercurial/ui.py:0:
-   >                 traceback.print_exception(exc[0], exc[1], exc[2], file=self.ferr)
-   warning: line over 80 characters
-  mercurial/url.py:0:
-   >             conn = httpsconnection(host, port, keyfile, certfile, *args, **kwargs)
-   warning: line over 80 characters
   mercurial/util.py:0:
    >             except:
    warning: naked except clause
@@ -562,35 +303,14 @@
   mercurial/verify.py:0:
    >                 except:
    warning: naked except clause
-  mercurial/wireproto.py:0:
-   >         # Assuming the future to be filled with the result from the batched request
-   warning: line over 80 characters
-  mercurial/wireproto.py:0:
-   >         '''remote must support _submitbatch(encbatch) and _submitone(op, encargs)'''
-   warning: line over 80 characters
-  mercurial/wireproto.py:0:
-   >     All methods invoked on instances of this class are simply queued and return a
-   warning: line over 80 characters
-  mercurial/wireproto.py:0:
-   >     The decorator returns a function which wraps this coroutine as a plain method,
-   warning: line over 80 characters
-  setup.py:0:
-   >                 raise SystemExit("Python headers are required to build Mercurial")
-   warning: line over 80 characters
   setup.py:0:
    >         except:
    warning: naked except clause
   setup.py:0:
-   >     # build_py), it will not find osutil & friends, thinking that those modules are
-   warning: line over 80 characters
-  setup.py:0:
    >     except:
    warning: naked except clause
    warning: naked except clause
   setup.py:0:
-   >     isironpython = platform.python_implementation().lower().find("ironpython") != -1
-   warning: line over 80 characters
-  setup.py:0:
    > except:
    warning: naked except clause
    warning: naked except clause
@@ -601,30 +321,12 @@
   tests/run-tests.py:0:
    >     except:
    warning: naked except clause
-  tests/test-commandserver.py:0:
-   >                         'hooks.pre-identify=python:test-commandserver.hook', 'id'],
-   warning: line over 80 characters
-  tests/test-commandserver.py:0:
-   >     # the cached repo local hgrc contains ui.foo=bar, so showconfig should show it
-   warning: line over 80 characters
-  tests/test-commandserver.py:0:
-   >     print '%c, %r' % (ch, re.sub('encoding: [a-zA-Z0-9-]+', 'encoding: ***', data))
-   warning: line over 80 characters
   tests/test-filecache.py:0:
    >     except:
    warning: naked except clause
-  tests/test-filecache.py:0:
-   > if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'], 'cacheable']):
-   warning: line over 80 characters
   tests/test-ui-color.py:0:
    > testui.warn('warning\n')
    warning: unwrapped ui message
   tests/test-ui-color.py:0:
    > testui.write('buffered\n')
    warning: unwrapped ui message
-  tests/test-walkrepo.py:0:
-   >         print "Found %d repositories when I should have found 2" % (len(reposet),)
-   warning: line over 80 characters
-  tests/test-walkrepo.py:0:
-   >         print "Found %d repositories when I should have found 3" % (len(reposet),)
-   warning: line over 80 characters
diff --git a/tests/test-commandserver.py b/tests/test-commandserver.py
--- a/tests/test-commandserver.py
+++ b/tests/test-commandserver.py
@@ -71,7 +71,8 @@ def unknowncommand(server):
 def hellomessage(server):
     ch, data = readchannel(server)
     # escaping python tests output not supported
-    print '%c, %r' % (ch, re.sub('encoding: [a-zA-Z0-9-]+', 'encoding: ***', data))
+    print '%c, %r' % (ch, re.sub('encoding: [a-zA-Z0-9-]+', 'encoding: ***',
+                                 data))
 
     # run an arbitrary command to make sure the next thing the server sends
     # isn't part of the hello message
@@ -142,7 +143,8 @@ def localhgrc(server):
     is used """
     readchannel(server)
 
-    # the cached repo local hgrc contains ui.foo=bar, so showconfig should show it
+    # the cached repo local hgrc contains ui.foo=bar, so showconfig should
+    # show it
     runcommand(server, ['showconfig'])
 
     # but not for this repo
@@ -157,7 +159,8 @@ def hook(**args):
 def hookoutput(server):
     readchannel(server)
     runcommand(server, ['--config',
-                        'hooks.pre-identify=python:test-commandserver.hook', 'id'],
+                        'hooks.pre-identify=python:test-commandserver.hook',
+                        'id'],
                input=cStringIO.StringIO('some input'))
 
 def outsidechanges(server):
diff --git a/tests/test-filecache.py b/tests/test-filecache.py
--- a/tests/test-filecache.py
+++ b/tests/test-filecache.py
@@ -1,6 +1,7 @@
 import sys, os, subprocess
 
-if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'], 'cacheable']):
+if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'],
+                    'cacheable']):
     sys.exit(80)
 
 from mercurial import util, scmutil, extensions
diff --git a/tests/test-walkrepo.py b/tests/test-walkrepo.py
--- a/tests/test-walkrepo.py
+++ b/tests/test-walkrepo.py
@@ -24,10 +24,12 @@ def runtest():
     reposet = frozenset(walkrepos('.', followsym=True))
     if sym and (len(reposet) != 3):
         print "reposet = %r" % (reposet,)
-        print "Found %d repositories when I should have found 3" % (len(reposet),)
+        print ("Found %d repositories when I should have found 3"
+               % (len(reposet),))
     if (not sym) and (len(reposet) != 2):
         print "reposet = %r" % (reposet,)
-        print "Found %d repositories when I should have found 2" % (len(reposet),)
+        print ("Found %d repositories when I should have found 2"
+               % (len(reposet),))
     sub1set = frozenset((pjoin('.', 'sub1'),
                          pjoin('.', 'circle', 'subdir', 'sub1')))
     if len(sub1set & reposet) != 1:


More information about the Mercurial-devel mailing list