check-code: indent 4 spaces in py files stable
authorMads Kiilerich <mads@kiilerich.com>
Tue, 31 Jul 2012 03:30:42 +0200
branchstable
changeset 17299 e51d4aedace9
parent 17298 59c14bf5a48c
child 17301 2e8342aeab49
check-code: indent 4 spaces in py files
contrib/check-code.py
contrib/hgfixes/fix_bytes.py
hgext/largefiles/lfcommands.py
hgext/largefiles/overrides.py
hgext/transplant.py
mercurial/commands.py
mercurial/dispatch.py
mercurial/localrepo.py
mercurial/patch.py
--- a/contrib/check-code.py	Sat Jul 28 13:33:06 2012 +0200
+++ b/contrib/check-code.py	Tue Jul 31 03:30:42 2012 +0200
@@ -206,6 +206,7 @@
     (r'\.debug\(\_', "don't mark debug messages for translation"),
     (r'\.strip\(\)\.split\(\)', "no need to strip before splitting"),
     (r'^\s*except\s*:', "warning: naked except clause", r'#.*re-raises'),
+    (r':\n(    )*( ){1,3}[^ ]', "must indent 4 spaces"),
   ],
   # warnings
   [
--- a/contrib/hgfixes/fix_bytes.py	Sat Jul 28 13:33:06 2012 +0200
+++ b/contrib/hgfixes/fix_bytes.py	Tue Jul 31 03:30:42 2012 +0200
@@ -74,7 +74,7 @@
        'setattr' in sggparent or \
        'encode' in sggparent or \
        'decode' in sggparent:
-           return False
+        return False
 
     return True
 
--- a/hgext/largefiles/lfcommands.py	Sat Jul 28 13:33:06 2012 +0200
+++ b/hgext/largefiles/lfcommands.py	Tue Jul 31 03:30:42 2012 +0200
@@ -121,7 +121,7 @@
             shutil.rmtree(rdst.root)
 
 def _addchangeset(ui, rsrc, rdst, ctx, revmap):
- # Convert src parents to dst parents
+    # Convert src parents to dst parents
     parents = _convertparents(ctx, revmap)
 
     # Generate list of changed files
@@ -506,7 +506,7 @@
         # because otherwise the largefile will get reverted.  But for commit's
         # sake, we have to mark the file as unclean.
         if getattr(repo, "_isrebasing", False):
-           lfdirstate.normallookup(lfile)
+            lfdirstate.normallookup(lfile)
         else:
             lfdirstate.normal(lfile)
     elif state == 'r':
--- a/hgext/largefiles/overrides.py	Sat Jul 28 13:33:06 2012 +0200
+++ b/hgext/largefiles/overrides.py	Tue Jul 31 03:30:42 2012 +0200
@@ -667,9 +667,9 @@
         repo._isrebasing = True
         try:
             if opts.get('update'):
-                 del opts['update']
-                 ui.debug('--update and --rebase are not compatible, ignoring '
-                          'the update flag\n')
+                del opts['update']
+                ui.debug('--update and --rebase are not compatible, ignoring '
+                         'the update flag\n')
             del opts['rebase']
             cmdutil.bailifchanged(repo)
             origpostincoming = commands.postincoming
--- a/hgext/transplant.py	Sat Jul 28 13:33:06 2012 +0200
+++ b/hgext/transplant.py	Tue Jul 31 03:30:42 2012 +0200
@@ -666,9 +666,9 @@
     Transplanted changesets in set, or all transplanted changesets.
     """
     if x:
-      s = revset.getset(repo, subset, x)
+        s = revset.getset(repo, subset, x)
     else:
-      s = subset
+        s = subset
     return [r for r in s if repo[r].extra().get('transplant_source')]
 
 def kwtransplanted(repo, ctx, **args):
--- a/mercurial/commands.py	Sat Jul 28 13:33:06 2012 +0200
+++ b/mercurial/commands.py	Tue Jul 31 03:30:42 2012 +0200
@@ -4499,7 +4499,7 @@
         try:
             # set phase
             if not revs:
-                 raise util.Abort(_('empty revision set'))
+                raise util.Abort(_('empty revision set'))
             nodes = [repo[r].node() for r in revs]
             olddata = repo._phasecache.getphaserevs(repo)[:]
             phases.advanceboundary(repo, targetphase, nodes)
@@ -5442,7 +5442,7 @@
                 # current bookmark not in parent ctx marks
                 pass
         for m in marks:
-          ui.write(' ' + m, label='log.bookmark')
+            ui.write(' ' + m, label='log.bookmark')
         ui.write('\n', label='log.bookmark')
 
     st = list(repo.status(unknown=True))[:6]
--- a/mercurial/dispatch.py	Sat Jul 28 13:33:06 2012 +0200
+++ b/mercurial/dispatch.py	Tue Jul 31 03:30:42 2012 +0200
@@ -169,7 +169,7 @@
             try: # usually it is in the form (errno, strerror)
                 reason = inst.reason.args[1]
             except (AttributeError, IndexError):
-                 # it might be anything, for example a string
+                # it might be anything, for example a string
                 reason = inst.reason
             ui.warn(_("abort: error: %s\n") % reason)
         elif util.safehasattr(inst, "args") and inst.args[0] == errno.EPIPE:
--- a/mercurial/localrepo.py	Sat Jul 28 13:33:06 2012 +0200
+++ b/mercurial/localrepo.py	Tue Jul 31 03:30:42 2012 +0200
@@ -272,7 +272,7 @@
         return bookmarks.readcurrent(self)
 
     def _writebookmarks(self, marks):
-      bookmarks.write(self)
+        bookmarks.write(self)
 
     def bookmarkheads(self, bookmark):
         name = bookmark.split('@', 1)[0]
--- a/mercurial/patch.py	Sat Jul 28 13:33:06 2012 +0200
+++ b/mercurial/patch.py	Tue Jul 31 03:30:42 2012 +0200
@@ -634,7 +634,7 @@
             if self.mode is None:
                 self.mode = (False, False)
         if self.missing:
-             self.ui.warn(_("unable to find '%s' for patching\n") % self.fname)
+            self.ui.warn(_("unable to find '%s' for patching\n") % self.fname)
 
         self.hash = {}
         self.dirty = 0
@@ -1630,9 +1630,9 @@
     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))
+    def difffn(opts, losedata):
+        return trydiff(repo, revs, ctx1, ctx2, modified, added, removed,
+                       copy, getfilectx, opts, losedata, prefix)
     if opts.upgrade and not opts.git:
         try:
             def losedata(fn):