[vcs] simplify: extract method

This commit is contained in:
Kirill Likhodedov
2015-07-24 16:17:12 +03:00
parent 02b495df7c
commit b55c8e11e6
@@ -395,15 +395,11 @@ public class PatchApplier<BinaryType extends FilePatch> {
new Consumer<VcsDirtyScopeManager>() {
@Override
public void consume(final VcsDirtyScopeManager vcsDirtyScopeManager) {
vcsDirtyScopeManager.filePathsDirty(directlyAffected, null);
vcsDirtyScopeManager.filesDirty(indirectlyAffected, null);
markDirty(vcsDirtyScopeManager, directlyAffected, indirectlyAffected);
}
}, null);
} else {
final VcsDirtyScopeManager vcsDirtyScopeManager = VcsDirtyScopeManager.getInstance(project);
// will schedule update
vcsDirtyScopeManager.filePathsDirty(directlyAffected, null);
vcsDirtyScopeManager.filesDirty(indirectlyAffected, null);
markDirty(VcsDirtyScopeManager.getInstance(project), directlyAffected, indirectlyAffected);
if (context != null) {
context.ping();
}
@@ -412,6 +408,13 @@ public class PatchApplier<BinaryType extends FilePatch> {
});
}
private static void markDirty(@NotNull VcsDirtyScopeManager vcsDirtyScopeManager,
@NotNull Collection<FilePath> directlyAffected,
@NotNull Collection<VirtualFile> indirectlyAffected) {
vcsDirtyScopeManager.filePathsDirty(directlyAffected, null);
vcsDirtyScopeManager.filesDirty(indirectlyAffected, null);
}
@Nullable
private ApplyPatchStatus actualApply(final PathsVerifier<BinaryType> verifier, final CommitContext commitContext) {
final List<Pair<VirtualFile, ApplyTextFilePatch>> textPatches = verifier.getTextPatches();