##// END OF EJS Templates
fsmonitor: issue debug messages when we fall back to core status...
Boris Feld -
r35146:0b5716ec default
parent child Browse files
Show More
@@ -224,16 +224,21 b' def overridewalk(orig, self, match, subr'
224 Whenever full is False, ignored is False, and the Watchman client is
224 Whenever full is False, ignored is False, and the Watchman client is
225 available, use Watchman combined with saved state to possibly return only a
225 available, use Watchman combined with saved state to possibly return only a
226 subset of files.'''
226 subset of files.'''
227 def bail():
227 def bail(reason):
228 self._ui.debug('fsmonitor: fallback to core status, %s\n' % reason)
228 return orig(match, subrepos, unknown, ignored, full=True)
229 return orig(match, subrepos, unknown, ignored, full=True)
229
230
230 if full or ignored or not self._watchmanclient.available():
231 if full:
231 return bail()
232 return bail('full rewalk requested')
233 if ignored:
234 return bail('listing ignored files')
235 if not self._watchmanclient.available():
236 return bail('client unavailable')
232 state = self._fsmonitorstate
237 state = self._fsmonitorstate
233 clock, ignorehash, notefiles = state.get()
238 clock, ignorehash, notefiles = state.get()
234 if not clock:
239 if not clock:
235 if state.walk_on_invalidate:
240 if state.walk_on_invalidate:
236 return bail()
241 return bail('no clock')
237 # Initial NULL clock value, see
242 # Initial NULL clock value, see
238 # https://facebook.github.io/watchman/docs/clockspec.html
243 # https://facebook.github.io/watchman/docs/clockspec.html
239 clock = 'c:0:0'
244 clock = 'c:0:0'
@@ -263,7 +268,7 b' def overridewalk(orig, self, match, subr'
263 if _hashignore(ignore) != ignorehash and clock != 'c:0:0':
268 if _hashignore(ignore) != ignorehash and clock != 'c:0:0':
264 # ignore list changed -- can't rely on Watchman state any more
269 # ignore list changed -- can't rely on Watchman state any more
265 if state.walk_on_invalidate:
270 if state.walk_on_invalidate:
266 return bail()
271 return bail('ignore rules changed')
267 notefiles = []
272 notefiles = []
268 clock = 'c:0:0'
273 clock = 'c:0:0'
269 else:
274 else:
@@ -338,7 +343,7 b' def overridewalk(orig, self, match, subr'
338 except Exception as ex:
343 except Exception as ex:
339 _handleunavailable(self._ui, state, ex)
344 _handleunavailable(self._ui, state, ex)
340 self._watchmanclient.clearconnection()
345 self._watchmanclient.clearconnection()
341 return bail()
346 return bail('exception during run')
342 else:
347 else:
343 # We need to propagate the last observed clock up so that we
348 # We need to propagate the last observed clock up so that we
344 # can use it for our next query
349 # can use it for our next query
@@ -346,7 +351,7 b' def overridewalk(orig, self, match, subr'
346 if result['is_fresh_instance']:
351 if result['is_fresh_instance']:
347 if state.walk_on_invalidate:
352 if state.walk_on_invalidate:
348 state.invalidate()
353 state.invalidate()
349 return bail()
354 return bail('fresh instance')
350 fresh_instance = True
355 fresh_instance = True
351 # Ignore any prior noteable files from the state info
356 # Ignore any prior noteable files from the state info
352 notefiles = []
357 notefiles = []
General Comments 0
You need to be logged in to leave comments. Login now