svn: Optimized IdeaCommitHandler - track deleted files only if required (corresponding parameter is set)

This commit is contained in:
Konstantin Kolosovsky
2014-02-18 21:41:34 +04:00
parent 342cf543d8
commit a472d35528
2 changed files with 6 additions and 4 deletions
@@ -48,14 +48,16 @@ public class IdeaCommitHandler implements CommitEventHandler, ISVNEventHandler {
@Nullable private final ProgressIndicator myProgress;
@NotNull private final List<VirtualFile> myDeletedFiles = ContainerUtil.newArrayList();
private final boolean myCheckCancel;
private final boolean myTrackDeletedFiles;
public IdeaCommitHandler(@Nullable ProgressIndicator progress) {
this(progress, false);
this(progress, false, false);
}
public IdeaCommitHandler(@Nullable ProgressIndicator progress, boolean checkCancel) {
public IdeaCommitHandler(@Nullable ProgressIndicator progress, boolean checkCancel, boolean trackDeletedFiles) {
myProgress = progress;
myCheckCancel = checkCancel;
myTrackDeletedFiles = trackDeletedFiles;
}
@NotNull
@@ -83,7 +85,7 @@ public class IdeaCommitHandler implements CommitEventHandler, ISVNEventHandler {
if (path != null) {
CommitEventType eventType = convert(event.getAction());
if (CommitEventType.deleting.equals(eventType)) {
if (CommitEventType.deleting.equals(eventType) && myTrackDeletedFiles) {
trackDeletedFile(event);
}
updateProgress(eventType, path);
@@ -94,7 +94,7 @@ public class SvnCheckinEnvironment implements CheckinEnvironment {
final SVNCommitClient committer = mySvnVcs.createCommitClient();
final ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
IdeaCommitHandler handler = new IdeaCommitHandler(progress, true);
IdeaCommitHandler handler = new IdeaCommitHandler(progress, true, true);
if (progress != null) {
committer.setEventHandler(handler);
}