# HG changeset patch # User Nicolas Dumazet # Date 1241541603 -32400 # Node ID f5fae700cc0091fc152f3a03a4f6b11fc80ff3a4 # Parent 3e09bc5fee12955bbe06cf16b6cc848aa463e473 inotify: set a flag so a failed inotify query doesn't get repeated. If, for some reason, we can't get the inotify server to start, it's better to disable inotify queries for the instance to avoid trying over and over to start the server, which takes time. Just fall back on repo.status() diff -r 3e09bc5fee12 -r f5fae700cc00 hgext/inotify/__init__.py --- a/hgext/inotify/__init__.py Wed Apr 22 00:37:35 2009 +0900 +++ b/hgext/inotify/__init__.py Wed May 06 01:40:03 2009 +0900 @@ -63,17 +63,24 @@ # to recurse. inotifyserver = False + # We'll set this to false after an unsuccessful attempt so that + # next calls of status() within the same instance don't try again + # to start an inotify server if it won't start. + _inotifyon = True + def status(self, match, ignored, clean, unknown=True): files = match.files() if '.' in files: files = [] - if not ignored and not self.inotifyserver: + if self._inotifyon and not ignored and not self.inotifyserver: cli = client(ui, repo) try: result = cli.statusquery(files, match, False, clean, unknown) except QueryFailed, instr: ui.debug(str(instr)) + # don't retry within the same hg instance + inotifydirstate._inotifyon = False pass else: if ui.config('inotify', 'debug'):