##// END OF EJS Templates
fix warnings from pychecker (unused variables and shadowing)
Benoit Boissinot -
r1749:d457fec7 default
parent child Browse files
Show More
@@ -115,8 +115,8 b' def walkchangerevs(ui, repo, pats, opts)'
115 115 yield rev
116 116
117 117 minrev, maxrev = min(revs), max(revs)
118 for file in files:
119 filelog = repo.file(file)
118 for file_ in files:
119 filelog = repo.file(file_)
120 120 # A zero count may be a directory or deleted file, so
121 121 # try to find matching entries on the slow path.
122 122 if filelog.count() == 0:
@@ -127,7 +127,7 b' def walkchangerevs(ui, repo, pats, opts)'
127 127 if rev < minrev:
128 128 break
129 129 fncache.setdefault(rev, [])
130 fncache[rev].append(file)
130 fncache[rev].append(file_)
131 131 wanted[rev] = 1
132 132 if slowpath:
133 133 # The slow path checks files modified in every changeset.
@@ -447,7 +447,6 b' def help_(ui, cmd=None, with_version=Fal'
447 447 f = f.lstrip("^")
448 448 if not ui.debugflag and f.startswith("debug"):
449 449 continue
450 d = ""
451 450 doc = e[0].__doc__
452 451 if not doc:
453 452 doc = _("(No help text available)")
@@ -1290,6 +1289,7 b' def grep(ui, repo, pattern, *pats, **opt'
1290 1289 s = linestate(line, lnum, cstart, cend)
1291 1290 m[s] = s
1292 1291
1292 # FIXME: prev isn't used, why ?
1293 1293 prev = {}
1294 1294 ucache = {}
1295 1295 def display(fn, rev, states, prevstates):
@@ -270,11 +270,11 b' class dirstate(object):'
270 270 elif not dc:
271 271 dc = self.filterfiles(files)
272 272
273 def statmatch(file, stat):
274 file = util.pconvert(file)
275 if file not in dc and self.ignore(file):
273 def statmatch(file_, stat):
274 file_ = util.pconvert(file_)
275 if file_ not in dc and self.ignore(file_):
276 276 return False
277 return match(file)
277 return match(file_)
278 278
279 279 return self.walkhelper(files=files, statmatch=statmatch, dc=dc)
280 280
@@ -350,9 +350,9 b' class dirstate(object):'
350 350 continue
351 351 if stat.S_ISDIR(st.st_mode):
352 352 cmp1 = (lambda x, y: cmp(x[1], y[1]))
353 sorted = [ x for x in findfiles(f) ]
354 sorted.sort(cmp1)
355 for e in sorted:
353 sorted_ = [ x for x in findfiles(f) ]
354 sorted_.sort(cmp1)
355 for e in sorted_:
356 356 yield e
357 357 else:
358 358 ff = util.normpath(ff)
@@ -380,7 +380,7 b' class dirstate(object):'
380 380
381 381 for src, fn, st in self.statwalk(files, match):
382 382 try:
383 type, mode, size, time = self[fn]
383 type_, mode, size, time = self[fn]
384 384 except KeyError:
385 385 unknown.append(fn)
386 386 continue
@@ -399,22 +399,22 b' class dirstate(object):'
399 399 nonexistent = False
400 400 # XXX: what to do with file no longer present in the fs
401 401 # who are not removed in the dirstate ?
402 if nonexistent and type in "nm":
402 if nonexistent and type_ in "nm":
403 403 deleted.append(fn)
404 404 continue
405 405 # check the common case first
406 if type == 'n':
406 if type_ == 'n':
407 407 if not st:
408 408 st = os.stat(fn)
409 409 if size != st.st_size or (mode ^ st.st_mode) & 0100:
410 410 modified.append(fn)
411 411 elif time != st.st_mtime:
412 412 lookup.append(fn)
413 elif type == 'm':
413 elif type_ == 'm':
414 414 modified.append(fn)
415 elif type == 'a':
415 elif type_ == 'a':
416 416 added.append(fn)
417 elif type == 'r':
417 elif type_ == 'r':
418 418 removed.append(fn)
419 419
420 420 return (lookup, modified, added, removed, deleted, unknown)
@@ -231,7 +231,7 b' class localrepository(object):'
231 231 self.join("journal"), after)
232 232
233 233 def recover(self):
234 lock = self.lock()
234 l = self.lock()
235 235 if os.path.exists(self.join("journal")):
236 236 self.ui.status(_("rolling back interrupted transaction\n"))
237 237 transaction.rollback(self.opener, self.join("journal"))
@@ -245,7 +245,7 b' class localrepository(object):'
245 245 def undo(self, wlock=None):
246 246 if not wlock:
247 247 wlock = self.wlock()
248 lock = self.lock()
248 l = self.lock()
249 249 if os.path.exists(self.join("undo")):
250 250 self.ui.status(_("rolling back last transaction\n"))
251 251 transaction.rollback(self.opener, self.join("undo"))
@@ -311,7 +311,7 b' class localrepository(object):'
311 311
312 312 if not wlock:
313 313 wlock = self.wlock()
314 lock = self.lock()
314 l = self.lock()
315 315 tr = self.transaction()
316 316 mm = m1.copy()
317 317 mfm = mf1.copy()
@@ -388,7 +388,7 b' class localrepository(object):'
388 388
389 389 if not wlock:
390 390 wlock = self.wlock()
391 lock = self.lock()
391 l = self.lock()
392 392 tr = self.transaction()
393 393
394 394 # check in files
@@ -931,7 +931,7 b' class localrepository(object):'
931 931 return subset
932 932
933 933 def pull(self, remote, heads=None):
934 lock = self.lock()
934 l = self.lock()
935 935
936 936 # if we have an empty repo, fetch everything
937 937 if self.changelog.tip() == nullid:
@@ -951,7 +951,7 b' class localrepository(object):'
951 951 return self.addchangegroup(cg)
952 952
953 953 def push(self, remote, force=False):
954 lock = remote.lock()
954 l = remote.lock()
955 955
956 956 base = {}
957 957 heads = remote.heads()
@@ -624,12 +624,10 b' class revlog(object):'
624 624 # we store negative distances because heap returns smallest member
625 625 h = [(-dist[node], node)]
626 626 seen = {}
627 earliest = self.count()
628 627 while h:
629 628 d, n = heapq.heappop(h)
630 629 if n not in seen:
631 630 seen[n] = 1
632 r = self.rev(n)
633 631 yield (-d, n)
634 632 for p in self.parents(n):
635 633 heapq.heappush(h, (-dist[p], p))
@@ -690,11 +688,6 b' class revlog(object):'
690 688 p = self.parents(self.node(revs[0]))[0]
691 689 revs.insert(0, self.rev(p))
692 690
693 # helper to reconstruct intermediate versions
694 def construct(text, base, rev):
695 bins = [self.chunk(r) for r in xrange(base + 1, rev + 1)]
696 return mdiff.patches(text, bins)
697
698 691 # build deltas
699 692 for d in xrange(0, len(revs) - 1):
700 693 a, b = revs[d], revs[d + 1]
@@ -738,10 +731,10 b' class revlog(object):'
738 731 base = prev = -1
739 732 start = end = measure = 0
740 733 if r:
741 start = self.start(self.base(t))
734 base = self.base(t)
735 start = self.start(base)
742 736 end = self.end(t)
743 measure = self.length(self.base(t))
744 base = self.base(t)
737 measure = self.length(base)
745 738 prev = self.tip()
746 739
747 740 transaction.add(self.datafile, end)
@@ -793,14 +786,15 b' class revlog(object):'
793 786 raise RevlogError(_("consistency error adding group"))
794 787 measure = len(text)
795 788 else:
796 e = (end, len(cdelta), self.base(t), link, p1, p2, node)
789 e = (end, len(cdelta), base, link, p1, p2, node)
797 790 self.index.append(e)
798 791 self.nodemap[node] = r
799 792 dfh.write(cdelta)
800 793 ifh.write(struct.pack(indexformat, *e))
801 794
802 795 t, r, chain, prev = r, r + 1, node, node
803 start = self.start(self.base(t))
796 base = self.base(t)
797 start = self.start(base)
804 798 end = self.end(t)
805 799
806 800 dfh.close()
General Comments 0
You need to be logged in to leave comments. Login now