comparison mercurial/dirstate.py @ 2429:6a8f7c3f7333

dirstate: fix call to os.lstat when st is None
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Tue, 13 Jun 2006 14:56:01 -0700
parents 150cde10ea21
children b77a2ef61b81
comparison
equal deleted inserted replaced
2428:42b8a1ff46cf 2429:6a8f7c3f7333
453 continue 453 continue
454 if src == 'm': 454 if src == 'm':
455 nonexistent = True 455 nonexistent = True
456 if not st: 456 if not st:
457 try: 457 try:
458 f = self.wjoin(fn) 458 st = os.lstat(self.wjoin(fn))
459 st = os.lstat(f)
460 except OSError, inst: 459 except OSError, inst:
461 if inst.errno != errno.ENOENT: 460 if inst.errno != errno.ENOENT:
462 raise 461 raise
463 st = None 462 st = None
464 # We need to re-check that it is a valid file 463 # We need to re-check that it is a valid file
470 deleted.append(fn) 469 deleted.append(fn)
471 continue 470 continue
472 # check the common case first 471 # check the common case first
473 if type_ == 'n': 472 if type_ == 'n':
474 if not st: 473 if not st:
475 st = os.stat(fn) 474 st = os.stat(self.wjoin(fn))
476 if size >= 0 and (size != st.st_size 475 if size >= 0 and (size != st.st_size
477 or (mode ^ st.st_mode) & 0100): 476 or (mode ^ st.st_mode) & 0100):
478 modified.append(fn) 477 modified.append(fn)
479 elif time != st.st_mtime: 478 elif time != st.st_mtime:
480 lookup.append(fn) 479 lookup.append(fn)