comparison hgext/fsmonitor/__init__.py @ 34885:df2ff314e36f

fsmonitor: warn when fsmonitor could be used fsmonitor can significantly speed up operations on large working directories. But fsmonitor isn't enabled by default, so naive users may not realize there is a potential to make Mercurial faster. This commit introduces a warning to working directory updates when fsmonitor could be used. The following conditions must be met: * Working directory is previously empty * New working directory adds >= N files (currently 50,000) * Running on Linux or MacOS * fsmonitor not enabled * Warning not disabled via config override Because of the empty working directory restriction, most users will only see this warning during `hg clone` (assuming very few users actually do an `hg up null`). The addition of a warning may be considered a BC change. However, clone has printed warnings before. Until recently, Mercurial printed a warning with the server's certificate fingerprint when it wasn't explicitly trusted for example. The warning goes to stderr. So it shouldn't interfere with scripts parsing meaningful output. The OS restriction was on the advice of Facebook engineers, who only feel confident with watchman's stability on the supported platforms. .. feature:: Print warning when fsmonitor isn't being used on a large repository Differential Revision: https://phab.mercurial-scm.org/D894
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 18 Oct 2017 22:57:15 +0200
parents dacfcdd8b94e
children dbb542326582
comparison
equal deleted inserted replaced
34884:05535d0dea68 34885:df2ff314e36f
15 system, with fsmonitor it takes about 0.3 seconds. 15 system, with fsmonitor it takes about 0.3 seconds.
16 16
17 fsmonitor requires no configuration -- it will tell Watchman about your 17 fsmonitor requires no configuration -- it will tell Watchman about your
18 repository as necessary. You'll need to install Watchman from 18 repository as necessary. You'll need to install Watchman from
19 https://facebook.github.io/watchman/ and make sure it is in your PATH. 19 https://facebook.github.io/watchman/ and make sure it is in your PATH.
20
21 fsmonitor is incompatible with the largefiles and eol extensions, and
22 will disable itself if any of those are active.
20 23
21 The following configuration options exist: 24 The following configuration options exist:
22 25
23 :: 26 ::
24 27
56 I/O with Watchman. For large repos it is recommended to set this value to 59 I/O with Watchman. For large repos it is recommended to set this value to
57 false. You may wish to set this to true if you have a very fast filesystem 60 false. You may wish to set this to true if you have a very fast filesystem
58 that can outpace the IPC overhead of getting the result data for the full repo 61 that can outpace the IPC overhead of getting the result data for the full repo
59 from Watchman. Defaults to false. 62 from Watchman. Defaults to false.
60 63
61 fsmonitor is incompatible with the largefiles and eol extensions, and 64 ::
62 will disable itself if any of those are active. 65
63 66 [fsmonitor]
67 warn_when_unused = (boolean)
68
69 Whether to print a warning during certain operations when fsmonitor would be
70 beneficial to performance but isn't enabled.
71
72 ::
73
74 [fsmonitor]
75 warn_update_file_count = (integer)
76
77 If ``warn_when_unused`` is set and fsmonitor isn't enabled, a warning will
78 be printed during working directory updates if this many files will be
79 created.
64 ''' 80 '''
65 81
66 # Platforms Supported 82 # Platforms Supported
67 # =================== 83 # ===================
68 # 84 #