svn: Used "SvnBaseContentRevision" to filter svn related content revisions

Removed unnecessary "MarkerVcsContentRevision"
This commit is contained in:
Konstantin Kolosovsky
2016-11-16 21:01:56 +03:00
parent 29d7f2b85a
commit ebd34ea3c9
5 changed files with 9 additions and 54 deletions
@@ -1,28 +0,0 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.openapi.vcs.changes;
import com.intellij.openapi.vcs.VcsKey;
/**
* Created with IntelliJ IDEA.
* User: Irina.Chernushina
* Date: 6/14/12
* Time: 5:13 PM
*/
public interface MarkerVcsContentRevision {
VcsKey getVcsKey();
}
@@ -19,9 +19,7 @@ package org.jetbrains.idea.svn;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.VcsKey;
import com.intellij.openapi.vcs.changes.ByteBackedContentRevision;
import com.intellij.openapi.vcs.changes.MarkerVcsContentRevision;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import com.intellij.openapi.vcs.impl.ContentRevisionCache;
import com.intellij.openapi.vcs.impl.CurrentRevisionProvider;
@@ -35,7 +33,7 @@ import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
import java.io.IOException;
public class SvnContentRevision extends SvnBaseContentRevision implements ByteBackedContentRevision, MarkerVcsContentRevision {
public class SvnContentRevision extends SvnBaseContentRevision implements ByteBackedContentRevision {
@NotNull private final SVNRevision myRevision;
/**
@@ -124,9 +122,4 @@ public class SvnContentRevision extends SvnBaseContentRevision implements ByteBa
public String toString() {
return myFile.getPath();
}
@Override
public VcsKey getVcsKey() {
return SvnVcs.getKey();
}
}
@@ -29,9 +29,13 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsDataKeys;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.changes.*;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangesUtil;
import com.intellij.openapi.vcs.changes.ContentRevision;
import com.intellij.openapi.vcs.changes.CurrentContentRevision;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnBaseContentRevision;
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnRevisionNumber;
import org.jetbrains.idea.svn.SvnVcs;
@@ -74,7 +78,7 @@ public class ShowPropertiesDiffAction extends AnAction implements DumbAware {
}
private static boolean isUnderSvn(@Nullable ContentRevision revision) {
return revision instanceof MarkerVcsContentRevision && SvnVcs.getKey().equals(((MarkerVcsContentRevision)revision).getVcsKey());
return revision instanceof SvnBaseContentRevision;
}
@Override
@@ -20,8 +20,6 @@ import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.VcsKey;
import com.intellij.openapi.vcs.changes.MarkerVcsContentRevision;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -37,7 +35,7 @@ import java.util.List;
import static org.jetbrains.idea.svn.actions.ShowPropertiesDiffAction.getPropertyList;
import static org.jetbrains.idea.svn.actions.ShowPropertiesDiffAction.toSortedStringPresentation;
public class SvnLazyPropertyContentRevision extends SvnBaseContentRevision implements MarkerVcsContentRevision, PropertyRevision {
public class SvnLazyPropertyContentRevision extends SvnBaseContentRevision implements PropertyRevision {
private final VcsRevisionNumber myNumber;
private final SVNURL myUrl;
private List<PropertyData> myContent;
@@ -93,9 +91,4 @@ public class SvnLazyPropertyContentRevision extends SvnBaseContentRevision imple
public VcsRevisionNumber getRevisionNumber() {
return myNumber;
}
@Override
public VcsKey getVcsKey() {
return SvnVcs.getKey();
}
}
@@ -28,9 +28,7 @@ import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.VcsKey;
import com.intellij.openapi.vcs.changes.ByteBackedContentRevision;
import com.intellij.openapi.vcs.changes.MarkerVcsContentRevision;
import com.intellij.openapi.vcs.impl.ContentRevisionCache;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.vcsUtil.VcsUtil;
@@ -47,7 +45,7 @@ import java.io.OutputStream;
import static com.intellij.util.ObjectUtils.notNull;
public class SvnRepositoryContentRevision extends SvnBaseContentRevision implements ByteBackedContentRevision, MarkerVcsContentRevision {
public class SvnRepositoryContentRevision extends SvnBaseContentRevision implements ByteBackedContentRevision {
@NotNull private final String myPath;
private final long myRevision;
@@ -190,11 +188,6 @@ public class SvnRepositoryContentRevision extends SvnBaseContentRevision impleme
return SvnUtil.getRelativePath(repositoryUrl, myPath);
}
@Override
public VcsKey getVcsKey() {
return SvnVcs.getKey();
}
@NotNull
public SvnTarget toTarget() throws SvnBindException {
return SvnTarget.fromURL(SvnUtil.createUrl(getFullPath()), getRevisionNumber().getRevision());