diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/RootsToWorkingCopies.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/RootsToWorkingCopies.java index 16000bbcaa3a..6a61b00f7fbf 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/RootsToWorkingCopies.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/RootsToWorkingCopies.java @@ -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) { diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnFormatSelector.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnFormatSelector.java index c7be1ca05f3b..d089f859d917 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnFormatSelector.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnFormatSelector.java @@ -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; } diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnUtil.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnUtil.java index 29b8ed3de4cf..19ed255dddd7 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnUtil.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnUtil.java @@ -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) { diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandRuntime.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandRuntime.java index e41e43c57743..60d4c1c37a8f 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandRuntime.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandRuntime.java @@ -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 " // TODO: check if we could "configure" commands (or make command to explicitly ask) if cleanup is required - not to search diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnFormatWorker.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnFormatWorker.java index a79ee3001eee..57f498168297 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnFormatWorker.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnFormatWorker.java @@ -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());