diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -206,6 +206,7 @@ pypats = [ (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 [ diff --git a/contrib/hgfixes/fix_bytes.py b/contrib/hgfixes/fix_bytes.py --- a/contrib/hgfixes/fix_bytes.py +++ b/contrib/hgfixes/fix_bytes.py @@ -74,7 +74,7 @@ def shouldtransform(node): 'setattr' in sggparent or \ 'encode' in sggparent or \ 'decode' in sggparent: - return False + return False return True diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py +++ b/hgext/largefiles/lfcommands.py @@ -121,7 +121,7 @@ def lfconvert(ui, src, dest, *pats, **op 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 @@ def _updatelfile(repo, lfdirstate, lfile # 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': diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -667,9 +667,9 @@ def overridepull(orig, ui, repo, source= 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 diff --git a/hgext/transplant.py b/hgext/transplant.py --- a/hgext/transplant.py +++ b/hgext/transplant.py @@ -666,9 +666,9 @@ def revsettransplanted(repo, subset, x): 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): diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4499,7 +4499,7 @@ def phase(ui, repo, *revs, **opts): 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 @@ def summary(ui, repo, **opts): # 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] diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -169,7 +169,7 @@ def _runcatch(req): 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: diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -272,7 +272,7 @@ class localrepository(object): return bookmarks.readcurrent(self) def _writebookmarks(self, marks): - bookmarks.write(self) + bookmarks.write(self) def bookmarkheads(self, bookmark): name = bookmark.split('@', 1)[0] diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -634,7 +634,7 @@ class patchfile(object): 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 @@ 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)) + 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):