Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/dirstate.py @ 1749:d457fec76ab0
fix warnings from pychecker (unused variables and shadowing)
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Sun, 19 Feb 2006 19:43:03 +0100 |
parents | ece5d785e87a |
children | a8f7791e3680 |
comparison
equal
deleted
inserted
replaced
1748:2428e6d66f06 | 1749:d457fec76ab0 |
---|---|
268 if not dc: | 268 if not dc: |
269 dc = self.map.copy() | 269 dc = self.map.copy() |
270 elif not dc: | 270 elif not dc: |
271 dc = self.filterfiles(files) | 271 dc = self.filterfiles(files) |
272 | 272 |
273 def statmatch(file, stat): | 273 def statmatch(file_, stat): |
274 file = util.pconvert(file) | 274 file_ = util.pconvert(file_) |
275 if file not in dc and self.ignore(file): | 275 if file_ not in dc and self.ignore(file_): |
276 return False | 276 return False |
277 return match(file) | 277 return match(file_) |
278 | 278 |
279 return self.walkhelper(files=files, statmatch=statmatch, dc=dc) | 279 return self.walkhelper(files=files, statmatch=statmatch, dc=dc) |
280 | 280 |
281 def walk(self, files=None, match=util.always, dc=None): | 281 def walk(self, files=None, match=util.always, dc=None): |
282 # filter out the stat | 282 # filter out the stat |
348 util.pathto(self.getcwd(), ff), | 348 util.pathto(self.getcwd(), ff), |
349 inst.strerror)) | 349 inst.strerror)) |
350 continue | 350 continue |
351 if stat.S_ISDIR(st.st_mode): | 351 if stat.S_ISDIR(st.st_mode): |
352 cmp1 = (lambda x, y: cmp(x[1], y[1])) | 352 cmp1 = (lambda x, y: cmp(x[1], y[1])) |
353 sorted = [ x for x in findfiles(f) ] | 353 sorted_ = [ x for x in findfiles(f) ] |
354 sorted.sort(cmp1) | 354 sorted_.sort(cmp1) |
355 for e in sorted: | 355 for e in sorted_: |
356 yield e | 356 yield e |
357 else: | 357 else: |
358 ff = util.normpath(ff) | 358 ff = util.normpath(ff) |
359 if seen(ff): | 359 if seen(ff): |
360 continue | 360 continue |
378 lookup, modified, added, unknown = [], [], [], [] | 378 lookup, modified, added, unknown = [], [], [], [] |
379 removed, deleted = [], [] | 379 removed, deleted = [], [] |
380 | 380 |
381 for src, fn, st in self.statwalk(files, match): | 381 for src, fn, st in self.statwalk(files, match): |
382 try: | 382 try: |
383 type, mode, size, time = self[fn] | 383 type_, mode, size, time = self[fn] |
384 except KeyError: | 384 except KeyError: |
385 unknown.append(fn) | 385 unknown.append(fn) |
386 continue | 386 continue |
387 if src == 'm': | 387 if src == 'm': |
388 nonexistent = True | 388 nonexistent = True |
397 # We need to re-check that it is a valid file | 397 # We need to re-check that it is a valid file |
398 if st and self.supported_type(fn, st): | 398 if st and self.supported_type(fn, st): |
399 nonexistent = False | 399 nonexistent = False |
400 # XXX: what to do with file no longer present in the fs | 400 # XXX: what to do with file no longer present in the fs |
401 # who are not removed in the dirstate ? | 401 # who are not removed in the dirstate ? |
402 if nonexistent and type in "nm": | 402 if nonexistent and type_ in "nm": |
403 deleted.append(fn) | 403 deleted.append(fn) |
404 continue | 404 continue |
405 # check the common case first | 405 # check the common case first |
406 if type == 'n': | 406 if type_ == 'n': |
407 if not st: | 407 if not st: |
408 st = os.stat(fn) | 408 st = os.stat(fn) |
409 if size != st.st_size or (mode ^ st.st_mode) & 0100: | 409 if size != st.st_size or (mode ^ st.st_mode) & 0100: |
410 modified.append(fn) | 410 modified.append(fn) |
411 elif time != st.st_mtime: | 411 elif time != st.st_mtime: |
412 lookup.append(fn) | 412 lookup.append(fn) |
413 elif type == 'm': | 413 elif type_ == 'm': |
414 modified.append(fn) | 414 modified.append(fn) |
415 elif type == 'a': | 415 elif type_ == 'a': |
416 added.append(fn) | 416 added.append(fn) |
417 elif type == 'r': | 417 elif type_ == 'r': |
418 removed.append(fn) | 418 removed.append(fn) |
419 | 419 |
420 return (lookup, modified, added, removed, deleted, unknown) | 420 return (lookup, modified, added, removed, deleted, unknown) |