mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 06:47:41 +03:00
fsmonitor: catch watchman issue and fallback
Summary: My earlier refactor moved a watchmanclient.getcurrentclock() call out of a "try/except Exception" block. This meant any watchman errors broke the hg status entirely, instead of falling back to the old status path. Let's add the logic around this watchman path. Reviewed By: sfilipco Differential Revision: D19709391 fbshipit-source-id: bfb0221ba405a926babddaf73c8e70924e4d9b25
This commit is contained in:
parent
a7246e9781
commit
16d4739981
@ -856,7 +856,13 @@ class fsmonitorfilesystem(filesystem.physicalfilesystem):
|
||||
if match is None:
|
||||
match = util.always
|
||||
|
||||
startclock = self._watchmanclient.getcurrentclock()
|
||||
try:
|
||||
startclock = self._watchmanclient.getcurrentclock()
|
||||
except Exception as ex:
|
||||
if self._ui.configbool("fsmonitor", "fallback-on-watchman-exception"):
|
||||
raise fsmonitorfallback("exception while getting watchman clock")
|
||||
else:
|
||||
raise ex
|
||||
|
||||
self.dirstate._map.preload()
|
||||
lookups = []
|
||||
|
Loading…
Reference in New Issue
Block a user