@@ -72,7 +72,9 @@ impl<'config> WatchmanFileSource<'config> {
72
72
CompilerState :: deserialize_from_file ( saved_state_path)
73
73
} ) ?;
74
74
let query_timer = perf_logger_event. start ( "watchman_query_time" ) ;
75
- let file_source_result =self . query_file_result ( compiler_state. clock . clone ( ) ) . await ?;
75
+ let file_source_result =self
76
+ . query_file_result ( compiler_state. clock . clone ( ) , false )
77
+ . await ?;
76
78
perf_logger_event. stop ( query_timer) ;
77
79
compiler_state
78
80
. pending_file_source_changes
@@ -133,7 +135,7 @@ impl<'config> WatchmanFileSource<'config> {
133
135
perf_logger_event : & impl PerfLogEvent ,
134
136
perf_logger : & impl PerfLogger ,
135
137
) ->Result < CompilerState > {
136
- let file_source_result =self . query_file_result ( None ) . await ?;
138
+ let file_source_result =self . query_file_result ( None , false ) . await ?;
137
139
let compiler_state = perf_logger_event. time ( "from_file_source_changes" , ||{
138
140
CompilerState :: from_file_source_changes (
139
141
self . config ,
@@ -157,7 +159,9 @@ impl<'config> WatchmanFileSource<'config> {
157
159
let expression =get_watchman_expr ( self . config ) ;
158
160
159
161
let query_timer = perf_logger_event. start ( "watchman_query_time_before_subscribe" ) ;
160
- let file_source_result =self . query_file_result ( compiler_state. clock . clone ( ) ) . await ?;
162
+ let file_source_result =self
163
+ . query_file_result ( compiler_state. clock . clone ( ) , true )
164
+ . await ?;
161
165
perf_logger_event. stop ( query_timer) ;
162
166
163
167
let query_timer = perf_logger_event. start ( "watchman_query_time_subscribe" ) ;
@@ -185,7 +189,11 @@ impl<'config> WatchmanFileSource<'config> {
185
189
186
190
/// Internal method to issue a watchman query, returning a raw
187
191
/// WatchmanFileSourceResult.
188
- async fn query_file_result ( & self , since_clock : Option < Clock > ) ->Result < FileSourceResult > {
192
+ async fn query_file_result (
193
+ & self ,
194
+ since_clock : Option < Clock > ,
195
+ omit_changed_files : bool ,
196
+ ) ->Result < FileSourceResult > {
189
197
let expression =get_watchman_expr ( self . config ) ;
190
198
debug ! (
191
199
"WatchmanFileSource::query_file_result(...) get_watchman_expr = {:?}" ,
@@ -197,6 +205,8 @@ impl<'config> WatchmanFileSource<'config> {
197
205
// passed as the request params
198
206
let request =if since_clock. is_some ( ) {
199
207
QueryRequestCommon {
208
+ omit_changed_files,
209
+ empty_on_fresh_instance : omit_changed_files,
200
210
expression : Some ( expression) ,
201
211
since : since_clock,
202
212
..Default :: default ( )
@@ -207,6 +217,8 @@ impl<'config> WatchmanFileSource<'config> {
207
217
. map ( PathGeneratorElement :: RecursivePath )
208
218
. collect ( ) ;
209
219
QueryRequestCommon {
220
+ omit_changed_files,
221
+ empty_on_fresh_instance : omit_changed_files,
210
222
expression : Some ( expression) ,
211
223
path : Some ( query_roots) ,
212
224
..Default :: default ( )
@@ -257,7 +269,7 @@ impl<'config> WatchmanFileSource<'config> {
257
269
) ;
258
270
let query_timer = perf_logger_event. start ( "watchman_query_time_try_saved_state" ) ;
259
271
let file_source_result =self
260
- . query_file_result ( Some ( scm_since) )
272
+ . query_file_result ( Some ( scm_since) , false )
261
273
. await
262
274
. map_err ( |_|"query failed" ) ?;
263
275
perf_logger_event. stop ( query_timer) ;