# HG changeset patch
# User zphricz <zack.hr...@oculus.com>
# Date 1482357094 28800
#      Wed Dec 21 13:51:34 2016 -0800
# Node ID a3d289ca22c1066bc929bb519b655fce9fd39bbe
# Parent  2bb8c53be961f41026ce99e1227ff2e530fbe425
fsmonitor: fix exception message scraping

pywatchman.CommandError formats its error message such that
'unable to resolve root' is not a prefix. This change fixes that by
instead just searching for it as a substring.

diff --git a/hgext/fsmonitor/watchmanclient.py 
b/hgext/fsmonitor/watchmanclient.py
--- a/hgext/fsmonitor/watchmanclient.py
+++ b/hgext/fsmonitor/watchmanclient.py
@@ -87,7 +87,7 @@
                     useImmutableBser=True)
             return self._watchmanclient.query(*watchmanargs)
         except pywatchman.CommandError as ex:
-            if ex.msg.startswith('unable to resolve root'):
+            if 'unable to resolve root' in ex.msg:
                 raise WatchmanNoRoot(self._root, ex.msg)
             raise Unavailable(ex.msg)
         except pywatchman.WatchmanError as ex:
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to