##// END OF EJS Templates
fix coding style (reported by pylint)
Benoit Boissinot -
r10394:4612cded default
parent child Browse files
Show More
@@ -170,7 +170,7 b' class bzr_source(converter_source):'
170 return changes
170 return changes
171
171
172 def _gettreechanges(self, current, origin):
172 def _gettreechanges(self, current, origin):
173 revid = current._revision_id;
173 revid = current._revision_id
174 changes = []
174 changes = []
175 renames = {}
175 renames = {}
176 for (fileid, paths, changed_content, versioned, parent, name,
176 for (fileid, paths, changed_content, versioned, parent, name,
@@ -172,7 +172,7 b' class gnuarch_source(converter_source, c'
172
172
173 for src in self.changes[rev].ren_dirs:
173 for src in self.changes[rev].ren_dirs:
174 to = self.changes[rev].ren_dirs[src]
174 to = self.changes[rev].ren_dirs[src]
175 chgs, cps = self._rendirchanges(src, to);
175 chgs, cps = self._rendirchanges(src, to)
176 changes += [(f, rev) for f in chgs]
176 changes += [(f, rev) for f in chgs]
177 copies.update(cps)
177 copies.update(cps)
178
178
@@ -126,7 +126,7 b' def dodiff(ui, repo, diffcmd, diffopts, '
126 modadd = mod_a | add_a | mod_b | add_b
126 modadd = mod_a | add_a | mod_b | add_b
127 common = modadd | rem_a | rem_b
127 common = modadd | rem_a | rem_b
128 if not common:
128 if not common:
129 return 0
129 return 0
130
130
131 tmproot = tempfile.mkdtemp(prefix='extdiff.')
131 tmproot = tempfile.mkdtemp(prefix='extdiff.')
132 try:
132 try:
@@ -90,7 +90,7 b' def sigwalk(repo):'
90 if not l:
90 if not l:
91 continue
91 continue
92 yield (l.split(" ", 2), (context, ln))
92 yield (l.split(" ", 2), (context, ln))
93 ln +=1
93 ln += 1
94
94
95 # read the heads
95 # read the heads
96 fl = repo.file(".hgsigs")
96 fl = repo.file(".hgsigs")
@@ -92,7 +92,7 b' def difftree(ui, repo, node1=None, node2'
92 break
92 break
93
93
94 def catcommit(ui, repo, n, prefix, ctx=None):
94 def catcommit(ui, repo, n, prefix, ctx=None):
95 nlprefix = '\n' + prefix;
95 nlprefix = '\n' + prefix
96 if ctx is None:
96 if ctx is None:
97 ctx = repo[n]
97 ctx = repo[n]
98 ui.write("tree %s\n" % short(ctx.changeset()[0])) # use ctx.node() instead ??
98 ui.write("tree %s\n" % short(ctx.changeset()[0])) # use ctx.node() instead ??
@@ -135,7 +135,7 b' def catfile(ui, repo, type=None, r=None,'
135 prefix = ""
135 prefix = ""
136 if opts['stdin']:
136 if opts['stdin']:
137 try:
137 try:
138 (type, r) = raw_input().split(' ');
138 (type, r) = raw_input().split(' ')
139 prefix = " "
139 prefix = " "
140 except EOFError:
140 except EOFError:
141 return
141 return
@@ -148,12 +148,12 b' def catfile(ui, repo, type=None, r=None,'
148 while r:
148 while r:
149 if type != "commit":
149 if type != "commit":
150 ui.warn(_("aborting hg cat-file only understands commits\n"))
150 ui.warn(_("aborting hg cat-file only understands commits\n"))
151 return 1;
151 return 1
152 n = repo.lookup(r)
152 n = repo.lookup(r)
153 catcommit(ui, repo, n, prefix)
153 catcommit(ui, repo, n, prefix)
154 if opts['stdin']:
154 if opts['stdin']:
155 try:
155 try:
156 (type, r) = raw_input().split(' ');
156 (type, r) = raw_input().split(' ')
157 except EOFError:
157 except EOFError:
158 break
158 break
159 else:
159 else:
@@ -220,8 +220,8 b' def revtree(ui, args, repo, full="tree",'
220
220
221 # calculate the graph for the supplied commits
221 # calculate the graph for the supplied commits
222 for i, n in enumerate(want_sha1):
222 for i, n in enumerate(want_sha1):
223 reachable.append(set());
223 reachable.append(set())
224 visit = [n];
224 visit = [n]
225 reachable[i].add(n)
225 reachable[i].add(n)
226 while visit:
226 while visit:
227 n = visit.pop(0)
227 n = visit.pop(0)
@@ -9,7 +9,7 b''
9 # file to defer pygments loading and speedup extension setup.
9 # file to defer pygments loading and speedup extension setup.
10
10
11 from mercurial import demandimport
11 from mercurial import demandimport
12 demandimport.ignore.extend(['pkgutil', 'pkg_resources', '__main__',])
12 demandimport.ignore.extend(['pkgutil', 'pkg_resources', '__main__'])
13 from mercurial import util, encoding
13 from mercurial import util, encoding
14
14
15 from pygments import highlight
15 from pygments import highlight
@@ -552,7 +552,7 b' def transplant(ui, repo, *revs, **opts):'
552 tp.resume(repo, source, opts)
552 tp.resume(repo, source, opts)
553 return
553 return
554
554
555 tf=tp.transplantfilter(repo, source, p1)
555 tf = tp.transplantfilter(repo, source, p1)
556 if opts.get('prune'):
556 if opts.get('prune'):
557 prune = [source.lookup(r)
557 prune = [source.lookup(r)
558 for r in cmdutil.revrange(source, opts.get('prune'))]
558 for r in cmdutil.revrange(source, opts.get('prune'))]
@@ -103,7 +103,7 b' def annotate(ui, repo, *pats, **opts):'
103 opts['number'] = 1
103 opts['number'] = 1
104
104
105 linenumber = opts.get('line_number') is not None
105 linenumber = opts.get('line_number') is not None
106 if (linenumber and (not opts.get('changeset')) and (not opts.get('number'))):
106 if linenumber and (not opts.get('changeset')) and (not opts.get('number')):
107 raise util.Abort(_('at least one of -n/-c is required for -l'))
107 raise util.Abort(_('at least one of -n/-c is required for -l'))
108
108
109 funcmap = [func for op, func in opmap if opts.get(op)]
109 funcmap = [func for op, func in opmap if opts.get(op)]
@@ -366,7 +366,7 b' class dirstate(object):'
366 def clear(self):
366 def clear(self):
367 self._map = {}
367 self._map = {}
368 if "_dirs" in self.__dict__:
368 if "_dirs" in self.__dict__:
369 delattr(self, "_dirs");
369 delattr(self, "_dirs")
370 self._copymap = {}
370 self._copymap = {}
371 self._pl = [nullid, nullid]
371 self._pl = [nullid, nullid]
372 self._dirty = True
372 self._dirty = True
@@ -10,7 +10,7 b' import os, re, time'
10 from mercurial.i18n import _
10 from mercurial.i18n import _
11 from mercurial import ui, hg, util, templater
11 from mercurial import ui, hg, util, templater
12 from mercurial import error, encoding
12 from mercurial import error, encoding
13 from common import ErrorResponse, get_mtime, staticfile, paritygen,\
13 from common import ErrorResponse, get_mtime, staticfile, paritygen, \
14 get_contact, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
14 get_contact, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
15 from hgweb_mod import hgweb
15 from hgweb_mod import hgweb
16 from request import wsgirequest
16 from request import wsgirequest
@@ -707,7 +707,7 b' def graph(web, req, tmpl):'
707
707
708 dag = graphmod.revisions(web.repo, rev, downrev)
708 dag = graphmod.revisions(web.repo, rev, downrev)
709 tree = list(graphmod.colored(dag))
709 tree = list(graphmod.colored(dag))
710 canvasheight = (len(tree) + 1) * bg_height - 27;
710 canvasheight = (len(tree) + 1) * bg_height - 27
711 data = []
711 data = []
712 for (id, type, ctx, vtx, edges) in tree:
712 for (id, type, ctx, vtx, edges) in tree:
713 if type != graphmod.CHANGESET:
713 if type != graphmod.CHANGESET:
@@ -550,10 +550,10 b' def safesend(self, str):'
550 if hasattr(str,'read') :
550 if hasattr(str,'read') :
551 if self.debuglevel > 0:
551 if self.debuglevel > 0:
552 print "sendIng a read()able"
552 print "sendIng a read()able"
553 data=str.read(blocksize)
553 data = str.read(blocksize)
554 while data:
554 while data:
555 self.sock.sendall(data)
555 self.sock.sendall(data)
556 data=str.read(blocksize)
556 data = str.read(blocksize)
557 else:
557 else:
558 self.sock.sendall(str)
558 self.sock.sendall(str)
559 except socket.error, v:
559 except socket.error, v:
@@ -178,7 +178,7 b' def showfileadds(**args):'
178 return showlist('file_add', getfiles(repo, ctx, revcache)[1], **args)
178 return showlist('file_add', getfiles(repo, ctx, revcache)[1], **args)
179
179
180 def showfilecopies(**args):
180 def showfilecopies(**args):
181 cache, ctx= args['cache'], args['ctx']
181 cache, ctx = args['cache'], args['ctx']
182 copies = args['revcache'].get('copies')
182 copies = args['revcache'].get('copies')
183 if copies is None:
183 if copies is None:
184 if 'getrenamed' not in cache:
184 if 'getrenamed' not in cache:
@@ -41,7 +41,7 b' class winstdout(object):'
41 limit = 16000
41 limit = 16000
42 l = len(s)
42 l = len(s)
43 start = 0
43 start = 0
44 self.softspace = 0;
44 self.softspace = 0
45 while start < l:
45 while start < l:
46 end = start + limit
46 end = start + limit
47 self.fp.write(s[start:end])
47 self.fp.write(s[start:end])
@@ -217,7 +217,6 b' def statfiles(files):'
217 '''Stat each file in files and yield stat or None if file does not exist.
217 '''Stat each file in files and yield stat or None if file does not exist.
218 Cluster and cache stat per directory to minimize number of OS stat calls.'''
218 Cluster and cache stat per directory to minimize number of OS stat calls.'''
219 ncase = os.path.normcase
219 ncase = os.path.normcase
220 sep = os.sep
221 dircache = {} # dirname -> filename -> status | None if file does not exist
220 dircache = {} # dirname -> filename -> status | None if file does not exist
222 for nf in files:
221 for nf in files:
223 nf = ncase(nf)
222 nf = ncase(nf)
General Comments 0
You need to be logged in to leave comments. Login now