Mercurial > hg
diff hgext/fsmonitor/__init__.py @ 45942:89a2afe31e82
formating: upgrade to black 20.8b1
This required a couple of small tweaks to un-confuse black, but now it
works. Big formatting changes come from:
* Dramatically improved collection-splitting logic upstream
* Black having a strong (correct IMO) opinion that """ is better than '''
Differential Revision: https://phab.mercurial-scm.org/D9430
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 27 Nov 2020 17:03:29 -0500 |
parents | 2c86b9587740 |
children | 6fb282ce9113 |
line wrap: on
line diff
--- a/hgext/fsmonitor/__init__.py Fri Nov 27 17:00:00 2020 -0500 +++ b/hgext/fsmonitor/__init__.py Fri Nov 27 17:03:29 2020 -0500 @@ -154,25 +154,40 @@ configitem = registrar.configitem(configtable) configitem( - b'fsmonitor', b'mode', default=b'on', + b'fsmonitor', + b'mode', + default=b'on', ) configitem( - b'fsmonitor', b'walk_on_invalidate', default=False, + b'fsmonitor', + b'walk_on_invalidate', + default=False, ) configitem( - b'fsmonitor', b'timeout', default=b'2', + b'fsmonitor', + b'timeout', + default=b'2', ) configitem( - b'fsmonitor', b'blacklistusers', default=list, + b'fsmonitor', + b'blacklistusers', + default=list, +) +configitem( + b'fsmonitor', + b'watchman_exe', + default=b'watchman', ) configitem( - b'fsmonitor', b'watchman_exe', default=b'watchman', + b'fsmonitor', + b'verbose', + default=True, + experimental=True, ) configitem( - b'fsmonitor', b'verbose', default=True, experimental=True, -) -configitem( - b'experimental', b'fsmonitor.transaction_notify', default=False, + b'experimental', + b'fsmonitor.transaction_notify', + default=False, ) # This extension is incompatible with the following blacklisted extensions @@ -271,11 +286,11 @@ def overridewalk(orig, self, match, subrepos, unknown, ignored, full=True): - '''Replacement for dirstate.walk, hooking into Watchman. + """Replacement for dirstate.walk, hooking into Watchman. Whenever full is False, ignored is False, and the Watchman client is available, use Watchman combined with saved state to possibly return only a - subset of files.''' + subset of files.""" def bail(reason): self._ui.debug(b'fsmonitor: fallback to core status, %s\n' % reason) @@ -731,8 +746,8 @@ def wrapsymlink(orig, source, link_name): - ''' if we create a dangling symlink, also touch the parent dir - to encourage fsevents notifications to work more correctly ''' + """if we create a dangling symlink, also touch the parent dir + to encourage fsevents notifications to work more correctly""" try: return orig(source, link_name) finally: @@ -743,13 +758,13 @@ class state_update(object): - ''' This context manager is responsible for dispatching the state-enter - and state-leave signals to the watchman service. The enter and leave - methods can be invoked manually (for scenarios where context manager - semantics are not possible). If parameters oldnode and newnode are None, - they will be populated based on current working copy in enter and - leave, respectively. Similarly, if the distance is none, it will be - calculated based on the oldnode and newnode in the leave method.''' + """This context manager is responsible for dispatching the state-enter + and state-leave signals to the watchman service. The enter and leave + methods can be invoked manually (for scenarios where context manager + semantics are not possible). If parameters oldnode and newnode are None, + they will be populated based on current working copy in enter and + leave, respectively. Similarly, if the distance is none, it will be + calculated based on the oldnode and newnode in the leave method.""" def __init__( self,