comparison hgext/inotify/server.py @ 7302:972737252d05

inotify: server raising an error when removing a file (issue1371) When a file is deleted via hg rm <file> the dirstate marks the file with a status of 'r'. The physical file has been deleted, but the inotify server tries to do a stat on the file after it's been removed. Patch catches the exception and correctly call updatestatus()
author Gerard Korsten <soonkia77@gmail.com>
date Sat, 01 Nov 2008 14:05:13 +0200
parents 810ca383da9c
children fd4bf5269733
comparison
equal deleted inserted replaced
7301:00d76fa3ffba 7302:972737252d05
335 if wtopdir and wtopdir[-1] != '/': 335 if wtopdir and wtopdir[-1] != '/':
336 wtopdir += '/' 336 wtopdir += '/'
337 for wfn, state in ds.iteritems(): 337 for wfn, state in ds.iteritems():
338 if not wfn.startswith(wtopdir): 338 if not wfn.startswith(wtopdir):
339 continue 339 continue
340 status = state[0] 340 try:
341 st = self.stat(wfn) 341 st = self.stat(wfn)
342 if status == 'r' and not st: 342 except OSError:
343 self.updatestatus(wfn, st, status=status) 343 status = state[0]
344 self.updatestatus(wfn, None, status=status)
344 else: 345 else:
345 self.updatestatus(wfn, st) 346 self.updatestatus(wfn, st)
346 self.check_deleted('!') 347 self.check_deleted('!')
347 self.check_deleted('r') 348 self.check_deleted('r')
348 349