|
22 | 22 | import com.google.idea.blaze.base.logging.utils.querysync.SyncQueryStats;
|
23 | 23 | import com.google.idea.blaze.base.logging.utils.querysync.SyncQueryStatsScope;
|
24 | 24 | import com.google.idea.blaze.base.scope.BlazeContext;
|
| 25 | +import com.google.idea.blaze.base.settings.BlazeUserSettings; |
25 | 26 | import com.google.idea.blaze.base.vcs.BlazeVcsHandlerProvider.BlazeVcsHandler;
|
26 | 27 | import com.google.idea.blaze.common.vcs.VcsState;
|
27 | 28 | import com.google.idea.blaze.exception.BuildException;
|
@@ -120,15 +121,17 @@ public PostQuerySyncData update(
|
120 | 121 | ProjectDefinition currentProjectDef, PostQuerySyncData previousState, BlazeContext context)
|
121 | 122 | throws IOException, BuildException {
|
122 | 123 |
|
123 |
| - Optional<VcsState> vcsState = getVcsState(context); |
124 |
| - SyncQueryStatsScope.fromContext(context) |
125 |
| - .ifPresent(stats -> stats.setSyncMode(SyncQueryStats.SyncMode.DELTA)); |
126 |
| - logger.info( |
127 |
| - String.format( |
128 |
| - "Starting partial query update; upstream rev=%s; snapshot path=%s", |
129 |
| - vcsState.map(s -> s.upstreamRevision).orElse("<unknown>"), |
130 |
| - vcsState.flatMap(s -> s.workspaceSnapshotPath).map(Object::toString).orElse("<none>"))); |
131 |
| - |
| 124 | + Optional<VcsState> vcsState = Optional.empty(); |
| 125 | + if (BlazeUserSettings.getInstance().getExpandSyncToWorkingSet()) { |
| 126 | + vcsState = getVcsState(context); |
| 127 | + SyncQueryStatsScope.fromContext(context) |
| 128 | + .ifPresent(stats -> stats.setSyncMode(SyncQueryStats.SyncMode.DELTA)); |
| 129 | + logger.info( |
| 130 | + String.format( |
| 131 | + "Starting partial query update; upstream rev=%s; snapshot path=%s", |
| 132 | + vcsState.map(s -> s.upstreamRevision).orElse("<unknown>"), |
| 133 | + vcsState.flatMap(s -> s.workspaceSnapshotPath).map(Object::toString).orElse("<none>"))); |
| 134 | + } |
132 | 135 | RefreshOperation refresh =
|
133 | 136 | projectRefresher.startPartialRefresh(
|
134 | 137 | context,
|
|
0 commit comments