diff --git a/hgext/convert/bzr.py b/hgext/convert/bzr.py --- a/hgext/convert/bzr.py +++ b/hgext/convert/bzr.py @@ -170,7 +170,7 @@ class bzr_source(converter_source): return changes def _gettreechanges(self, current, origin): - revid = current._revision_id; + revid = current._revision_id changes = [] renames = {} for (fileid, paths, changed_content, versioned, parent, name, diff --git a/hgext/convert/gnuarch.py b/hgext/convert/gnuarch.py --- a/hgext/convert/gnuarch.py +++ b/hgext/convert/gnuarch.py @@ -172,7 +172,7 @@ class gnuarch_source(converter_source, c for src in self.changes[rev].ren_dirs: to = self.changes[rev].ren_dirs[src] - chgs, cps = self._rendirchanges(src, to); + chgs, cps = self._rendirchanges(src, to) changes += [(f, rev) for f in chgs] copies.update(cps) diff --git a/hgext/extdiff.py b/hgext/extdiff.py --- a/hgext/extdiff.py +++ b/hgext/extdiff.py @@ -126,7 +126,7 @@ def dodiff(ui, repo, diffcmd, diffopts, modadd = mod_a | add_a | mod_b | add_b common = modadd | rem_a | rem_b if not common: - return 0 + return 0 tmproot = tempfile.mkdtemp(prefix='extdiff.') try: diff --git a/hgext/gpg.py b/hgext/gpg.py --- a/hgext/gpg.py +++ b/hgext/gpg.py @@ -90,7 +90,7 @@ def sigwalk(repo): if not l: continue yield (l.split(" ", 2), (context, ln)) - ln +=1 + ln += 1 # read the heads fl = repo.file(".hgsigs") diff --git a/hgext/hgk.py b/hgext/hgk.py --- a/hgext/hgk.py +++ b/hgext/hgk.py @@ -92,7 +92,7 @@ def difftree(ui, repo, node1=None, node2 break def catcommit(ui, repo, n, prefix, ctx=None): - nlprefix = '\n' + prefix; + nlprefix = '\n' + prefix if ctx is None: ctx = repo[n] ui.write("tree %s\n" % short(ctx.changeset()[0])) # use ctx.node() instead ?? @@ -135,7 +135,7 @@ def catfile(ui, repo, type=None, r=None, prefix = "" if opts['stdin']: try: - (type, r) = raw_input().split(' '); + (type, r) = raw_input().split(' ') prefix = " " except EOFError: return @@ -148,12 +148,12 @@ def catfile(ui, repo, type=None, r=None, while r: if type != "commit": ui.warn(_("aborting hg cat-file only understands commits\n")) - return 1; + return 1 n = repo.lookup(r) catcommit(ui, repo, n, prefix) if opts['stdin']: try: - (type, r) = raw_input().split(' '); + (type, r) = raw_input().split(' ') except EOFError: break else: @@ -220,8 +220,8 @@ def revtree(ui, args, repo, full="tree", # calculate the graph for the supplied commits for i, n in enumerate(want_sha1): - reachable.append(set()); - visit = [n]; + reachable.append(set()) + visit = [n] reachable[i].add(n) while visit: n = visit.pop(0) diff --git a/hgext/highlight/highlight.py b/hgext/highlight/highlight.py --- a/hgext/highlight/highlight.py +++ b/hgext/highlight/highlight.py @@ -9,7 +9,7 @@ # file to defer pygments loading and speedup extension setup. from mercurial import demandimport -demandimport.ignore.extend(['pkgutil', 'pkg_resources', '__main__',]) +demandimport.ignore.extend(['pkgutil', 'pkg_resources', '__main__']) from mercurial import util, encoding from pygments import highlight diff --git a/hgext/transplant.py b/hgext/transplant.py --- a/hgext/transplant.py +++ b/hgext/transplant.py @@ -552,7 +552,7 @@ def transplant(ui, repo, *revs, **opts): tp.resume(repo, source, opts) return - tf=tp.transplantfilter(repo, source, p1) + tf = tp.transplantfilter(repo, source, p1) if opts.get('prune'): prune = [source.lookup(r) for r in cmdutil.revrange(source, opts.get('prune'))] diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -103,7 +103,7 @@ def annotate(ui, repo, *pats, **opts): opts['number'] = 1 linenumber = opts.get('line_number') is not None - if (linenumber and (not opts.get('changeset')) and (not opts.get('number'))): + if linenumber and (not opts.get('changeset')) and (not opts.get('number')): raise util.Abort(_('at least one of -n/-c is required for -l')) funcmap = [func for op, func in opmap if opts.get(op)] diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -366,7 +366,7 @@ class dirstate(object): def clear(self): self._map = {} if "_dirs" in self.__dict__: - delattr(self, "_dirs"); + delattr(self, "_dirs") self._copymap = {} self._pl = [nullid, nullid] self._dirty = True diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -10,7 +10,7 @@ import os, re, time from mercurial.i18n import _ from mercurial import ui, hg, util, templater from mercurial import error, encoding -from common import ErrorResponse, get_mtime, staticfile, paritygen,\ +from common import ErrorResponse, get_mtime, staticfile, paritygen, \ get_contact, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR from hgweb_mod import hgweb from request import wsgirequest diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -707,7 +707,7 @@ def graph(web, req, tmpl): dag = graphmod.revisions(web.repo, rev, downrev) tree = list(graphmod.colored(dag)) - canvasheight = (len(tree) + 1) * bg_height - 27; + canvasheight = (len(tree) + 1) * bg_height - 27 data = [] for (id, type, ctx, vtx, edges) in tree: if type != graphmod.CHANGESET: diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py --- a/mercurial/keepalive.py +++ b/mercurial/keepalive.py @@ -550,10 +550,10 @@ def safesend(self, str): if hasattr(str,'read') : if self.debuglevel > 0: print "sendIng a read()able" - data=str.read(blocksize) + data = str.read(blocksize) while data: self.sock.sendall(data) - data=str.read(blocksize) + data = str.read(blocksize) else: self.sock.sendall(str) except socket.error, v: diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -178,7 +178,7 @@ def showfileadds(**args): return showlist('file_add', getfiles(repo, ctx, revcache)[1], **args) def showfilecopies(**args): - cache, ctx= args['cache'], args['ctx'] + cache, ctx = args['cache'], args['ctx'] copies = args['revcache'].get('copies') if copies is None: if 'getrenamed' not in cache: diff --git a/mercurial/windows.py b/mercurial/windows.py --- a/mercurial/windows.py +++ b/mercurial/windows.py @@ -41,7 +41,7 @@ class winstdout(object): limit = 16000 l = len(s) start = 0 - self.softspace = 0; + self.softspace = 0 while start < l: end = start + limit self.fp.write(s[start:end]) @@ -217,7 +217,6 @@ def statfiles(files): '''Stat each file in files and yield stat or None if file does not exist. Cluster and cache stat per directory to minimize number of OS stat calls.''' ncase = os.path.normcase - sep = os.sep dircache = {} # dirname -> filename -> status | None if file does not exist for nf in files: nf = ncase(nf)