diff options
-rwxr-xr-x | gitnoti.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -110,9 +110,17 @@ class ReposNotifyEvent(pyinotify.ProcessEvent): # Check for lock file if event.pathname.endswith('.lock'): newname = event.pathname[:-5] + i = 0 # Wait max 10 seconds until file is moved - while not os.access(newname, os.F_OK): + while not os.access(newname, os.F_OK) and os.access(event.pathname, os.F_OK) and i < 10: time.sleep(1) + i += 1 + + # Assume deleted if neither file exists. + if not os.access(newname, os.F_OK) and not os.access(event.pathname, os.F_OK): + self.bot.gitmsg('Branch \002%s\002 from repo \002%s\002 was deleted.' % + (os.path.basename(newname), os.path.splitext(os.path.basename(pathname))[0])) + return l = repos[pathname] if not l[0]: |