Restore "SvnUtil.getWorkingCopyRoot()" for api compatibility, @NotNull

Deprecate "SvnUtil.getWorkingCopyRootNew()"
This commit is contained in:
Konstantin Kolosovsky
2018-01-19 21:27:27 +03:00
parent 6dd4274124
commit ac3d7ee043
5 changed files with 18 additions and 16 deletions
@@ -98,7 +98,7 @@ public class RootsToWorkingCopies implements VcsListener {
@Nullable
private WorkingCopy calculateRoot(@NotNull VirtualFile root) {
File workingCopyRoot = SvnUtil.getWorkingCopyRootNew(virtualToIoFile(root));
File workingCopyRoot = SvnUtil.getWorkingCopyRoot(virtualToIoFile(root));
WorkingCopy workingCopy = null;
if (workingCopyRoot != null) {
@@ -22,8 +22,8 @@ import java.io.File;
public class SvnFormatSelector {
@NotNull
public static WorkingCopyFormat findRootAndGetFormat(final File path) {
File root = SvnUtil.getWorkingCopyRootNew(path);
public static WorkingCopyFormat findRootAndGetFormat(@NotNull File path) {
File root = SvnUtil.getWorkingCopyRoot(path);
return root != null ? SvnUtil.getFormat(root) : WorkingCopyFormat.UNKNOWN;
}
@@ -411,8 +411,8 @@ public class SvnUtil {
return (info == null) ? null : info.getRepositoryRootURL();
}
public static boolean isWorkingCopyRoot(final File file) {
return FileUtil.filesEqual(file, getWorkingCopyRootNew(file));
public static boolean isWorkingCopyRoot(@NotNull File file) {
return FileUtil.filesEqual(file, getWorkingCopyRoot(file));
}
@NotNull
@@ -544,15 +544,8 @@ public class SvnUtil {
return new File(file, SVN_ADMIN_DIR_NAME + "/wc.db");
}
/**
* Utility method that deals also with 1.8 working copies.
* TODO: Should be renamed when all parts updated for 1.8.
*
* @param file
* @return
*/
@Nullable
public static File getWorkingCopyRootNew(final File file) {
public static File getWorkingCopyRoot(@NotNull File file) {
File current = getParentWithDb(file);
if (current == null) return null;
@@ -561,8 +554,17 @@ public class SvnUtil {
return format.isOrGreater(WorkingCopyFormat.ONE_DOT_SEVEN) ? current : null;
}
/**
* @deprecated Use {@link SvnUtil#getWorkingCopyRoot(File)} instead.
*/
@Deprecated
@Nullable
public static File getParentWithDb(File file) {
public static File getWorkingCopyRootNew(@NotNull File file) {
return getWorkingCopyRoot(file);
}
@Nullable
public static File getParentWithDb(@NotNull File file) {
File current = file;
boolean wcDbFound = false;
while (current != null) {
@@ -190,7 +190,7 @@ public class CommandRuntime {
private void cleanup(@NotNull CommandExecutor executor, @NotNull File workingDirectory) throws SvnBindException {
if (executor.getCommandName().isWriteable()) {
File wcRoot = SvnUtil.getWorkingCopyRootNew(workingDirectory);
File wcRoot = SvnUtil.getWorkingCopyRoot(workingDirectory);
// not all commands require cleanup - for instance, some commands operate only with repository - like "svn info <url>"
// TODO: check if we could "configure" commands (or make command to explicitly ask) if cleanup is required - not to search
@@ -99,7 +99,7 @@ public class SvnFormatWorker extends Task.Backgroundable {
for (WCInfo wcInfo : myWcInfos) {
File path = new File(wcInfo.getPath());
if (! wcInfo.isIsWcRoot()) {
path = SvnUtil.getWorkingCopyRootNew(path);
path = SvnUtil.getWorkingCopyRoot(path);
}
try {
String cleanupMessage = SvnBundle.message("action.Subversion.cleanup.progress.text", path.getAbsolutePath());