changeset 10413:e433002acb05

fix up a bunch of check-code warnings
author Matt Mackall <mpm@selenic.com>
date Tue, 09 Feb 2010 14:12:22 -0600
parents 5326800d6937
children 1a8df80dfdde
files doc/rst2man.py hgext/mq.py hgext/rebase.py mercurial/commands.py tests/coverage.py tests/run-tests.py tests/test-doctest.py tests/test-mq-header-from tests/test-simplemerge.py tests/test-subrepo
diffstat 10 files changed, 16 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/doc/rst2man.py	Tue Feb 09 13:53:24 2010 -0600
+++ b/doc/rst2man.py	Tue Feb 09 14:12:22 2010 -0600
@@ -112,7 +112,7 @@
 class Table:
     def __init__(self):
         self._rows = []
-        self._options = ['center',]
+        self._options = ['center']
         self._tab_char = '\t'
         self._coldefs = []
     def new_row(self):
--- a/hgext/mq.py	Tue Feb 09 13:53:24 2010 -0600
+++ b/hgext/mq.py	Tue Feb 09 14:12:22 2010 -0600
@@ -859,7 +859,8 @@
                         p.write("Date: %d %d\n\n" % date)
                 else:
                     p.write("# HG changeset patch\n")
-                    p.write("# Parent " + hex(repo[None].parents()[0].node()) + "\n")
+                    p.write("# Parent "
+                            + hex(repo[None].parents()[0].node()) + "\n")
                     if user:
                         p.write("# User " + user + "\n")
                     if date:
--- a/hgext/rebase.py	Tue Feb 09 13:53:24 2010 -0600
+++ b/hgext/rebase.py	Tue Feb 09 14:12:22 2010 -0600
@@ -499,7 +499,7 @@
         ('', 'detach', False, _('force detaching of source from its original '
                                 'branch')),
         ('c', 'continue', False, _('continue an interrupted rebase')),
-        ('a', 'abort', False, _('abort an interrupted rebase')),] +
+        ('a', 'abort', False, _('abort an interrupted rebase'))] +
          templateopts,
         _('hg rebase [-s REV | -b REV] [-d REV] [--collapse] [--detach] '
                         '[--keep] [--keepbranches] | [-c] | [-a]')),
--- a/mercurial/commands.py	Tue Feb 09 13:53:24 2010 -0600
+++ b/mercurial/commands.py	Tue Feb 09 14:12:22 2010 -0600
@@ -1835,7 +1835,8 @@
     wlock = lock = None
 
     def tryone(ui, hunk):
-        tmpname, message, user, date, branch, nodeid, p1, p2 = patch.extract(ui, hunk)
+        tmpname, message, user, date, branch, nodeid, p1, p2 = \
+            patch.extract(ui, hunk)
 
         if not tmpname:
             return None
--- a/tests/coverage.py	Tue Feb 09 13:53:24 2010 -0600
+++ b/tests/coverage.py	Tue Feb 09 14:12:22 2010 -0600
@@ -847,7 +847,7 @@
         morfs = self.filter_by_prefix(morfs, omit_prefixes)
         morfs.sort(self.morf_name_compare)
 
-        max_name = max([5,] + map(len, map(self.morf_name, morfs)))
+        max_name = max([5] + map(len, map(self.morf_name, morfs)))
         fmt_name = "%%- %ds  " % max_name
         fmt_err = fmt_name + "%s: %s"
         header = fmt_name % "Name" + " Stmts   Exec  Cover"
--- a/tests/run-tests.py	Tue Feb 09 13:53:24 2010 -0600
+++ b/tests/run-tests.py	Tue Feb 09 14:12:22 2010 -0600
@@ -785,7 +785,7 @@
                     if k in t:
                         break
                 else:
-                    skipped +=1
+                    skipped += 1
                     continue
 
             ret = runone(options, test, skips, fails)
--- a/tests/test-doctest.py	Tue Feb 09 13:53:24 2010 -0600
+++ b/tests/test-doctest.py	Tue Feb 09 14:12:22 2010 -0600
@@ -1,5 +1,5 @@
 # this is hack to make sure no escape characters are inserted into the output
-import os;
+import os
 if 'TERM' in os.environ:
     del os.environ['TERM']
 import doctest
--- a/tests/test-mq-header-from	Tue Feb 09 13:53:24 2010 -0600
+++ b/tests/test-mq-header-from	Tue Feb 09 14:12:22 2010 -0600
@@ -148,4 +148,4 @@
 (cd sandbox ; runtest)
 rm -r sandbox
 
-runtest
\ No newline at end of file
+runtest
--- a/tests/test-simplemerge.py	Tue Feb 09 13:53:24 2010 -0600
+++ b/tests/test-simplemerge.py	Tue Feb 09 14:12:22 2010 -0600
@@ -143,7 +143,7 @@
         # to match without zz
         self.assertEquals(list(m3.find_sync_regions()),
                           [(0, 1,  2, 3,  0, 1),
-                           (1, 1,  3, 3,  1, 1),])
+                           (1, 1,  3, 3,  1, 1)])
 
         self.assertEquals(list(m3.merge_regions()),
                           [('a', 0, 2),
@@ -180,12 +180,12 @@
         self.assertEquals(list(m3.find_sync_regions()),
                           [(0, 1,  0, 1,  0, 1),
                            (1, 2,  2, 3,  1, 2),
-                           (2, 2,  3, 3,  2, 2),])
+                           (2, 2,  3, 3,  2, 2)])
 
         self.assertEquals(list(m3.merge_regions()),
                           [('unchanged', 0, 1),
                            ('a', 1, 2),
-                           ('unchanged', 1, 2),])
+                           ('unchanged', 1, 2)])
 
     def test_append_a(self):
         m3 = Merge3(['aaa\n', 'bbb\n'],
@@ -256,7 +256,7 @@
         self.assertEquals(list(m3.find_sync_regions()),
                           [(0, 1,  0, 1,  0, 1),
                            (1, 2,  2, 3,  2, 3),
-                           (2, 2,  3, 3,  3, 3),])
+                           (2, 2,  3, 3,  3, 3)])
 
         self.assertEquals(list(m3.merge_regions()),
                           [('unchanged', 0, 1),
@@ -296,7 +296,7 @@
         self.assertEquals(list(m3.find_sync_regions()),
                           [(0, 1,  0, 1,  0, 1),
                            (2, 3,  2, 3,  2, 3),
-                           (3, 3,  3, 3,  3, 3),])
+                           (3, 3,  3, 3,  3, 3)])
 
     def test_replace_multi(self):
         """Replacement with regions of different size."""
--- a/tests/test-subrepo	Tue Feb 09 13:53:24 2010 -0600
+++ b/tests/test-subrepo	Tue Feb 09 14:12:22 2010 -0600
@@ -175,7 +175,7 @@
 hg -R nested_relative ci -mtest2
 hg init main
 echo nested_relative = ../nested_relative > main/.hgsub
-echo nested_absolute = $PWD/nested_absolute >> main/.hgsub
+echo nested_absolute = `pwd`/nested_absolute >> main/.hgsub
 hg -R main add
 hg -R main ci -m "add subrepos"
 cd ..