Mercurial > hg
comparison hgext/inotify/server.py @ 9348:954f7a879495
inotify: server._updatestatus: simplify control flow
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Sun, 28 Jun 2009 19:46:36 +0900 |
parents | a87bc6e2a907 |
children | 56fb15ad8fb1 |
comparison
equal
deleted
inserted
replaced
9347:d0474b184347 | 9348:954f7a879495 |
---|---|
441 (wfn, oldstatus, newstatus)) | 441 (wfn, oldstatus, newstatus)) |
442 | 442 |
443 if oldstatus and oldstatus in self.statuskeys \ | 443 if oldstatus and oldstatus in self.statuskeys \ |
444 and oldstatus != newstatus: | 444 and oldstatus != newstatus: |
445 del self.statustrees[oldstatus].dir(root).files[fn] | 445 del self.statustrees[oldstatus].dir(root).files[fn] |
446 if newstatus and newstatus != 'i': | 446 |
447 if newstatus in (None, 'i'): | |
448 d.files.pop(fn, None) | |
449 elif oldstatus != newstatus: | |
447 d.files[fn] = newstatus | 450 d.files[fn] = newstatus |
448 if newstatus in self.statuskeys: | 451 if newstatus != 'n': |
449 dd = self.statustrees[newstatus].dir(root) | 452 self.statustrees[newstatus].dir(root).files[fn] = newstatus |
450 if oldstatus != newstatus or fn not in dd.files: | |
451 dd.files[fn] = newstatus | |
452 else: | |
453 d.files.pop(fn, None) | |
454 | 453 |
455 | 454 |
456 def check_deleted(self, key): | 455 def check_deleted(self, key): |
457 # Files that had been deleted but were present in the dirstate | 456 # Files that had been deleted but were present in the dirstate |
458 # may have vanished from the dirstate; we must clean them up. | 457 # may have vanished from the dirstate; we must clean them up. |