use of org.jetbrains.idea.svn.SvnFileUrlMapping in project intellij-community by JetBrains.
the class SvnExternalCommitNoticedTest method testExternalRootSwitch.
@Test
public void testExternalRootSwitch() throws Exception {
final String branchUrl = prepareBranchesStructure();
final SubTree tree = new SubTree(myWorkingCopyDir);
myVcs.invokeRefreshSvnRoots();
clManager.ensureUpToDate(false);
clManager.ensureUpToDate(false);
SvnFileUrlMapping workingCopies = myVcs.getSvnFileUrlMapping();
List<RootUrlInfo> infos = workingCopies.getAllWcInfos();
Assert.assertEquals(1, infos.size());
Assert.assertEquals(myRepoUrl + "/trunk", infos.get(0).getAbsoluteUrl());
runInAndVerifyIgnoreOutput("switch", branchUrl, myWorkingCopyDir.getPath());
myWorkingCopyDir.refresh(false, true);
imitateEvent(myWorkingCopyDir);
sleep(300);
// no dirty scope externally provided! just VFS refresh
clManager.ensureUpToDate(false);
//first run queries one more update
clManager.ensureUpToDate(false);
workingCopies = myVcs.getSvnFileUrlMapping();
infos = workingCopies.getAllWcInfos();
Assert.assertEquals(1, infos.size());
Assert.assertEquals(branchUrl, infos.get(0).getAbsoluteUrl());
}
use of org.jetbrains.idea.svn.SvnFileUrlMapping in project intellij-community by JetBrains.
the class UpdateEventHandler method itemSwitched.
private boolean itemSwitched(final ProgressEvent event) {
final File file = event.getFile();
final SvnFileUrlMapping urlMapping = myVCS.getSvnFileUrlMapping();
final SVNURL currentUrl = urlMapping.getUrlForFile(file);
return (currentUrl != null) && (!currentUrl.equals(event.getURL()));
}
use of org.jetbrains.idea.svn.SvnFileUrlMapping in project intellij-community by JetBrains.
the class SvnCopyPathTracker method getFilePath.
@Nullable
public FilePath getFilePath(final SvnVcs vcs) {
if (!myHadChanged)
return null;
final SvnFileUrlMapping svnFileUrlMapping = vcs.getSvnFileUrlMapping();
final String absolutePath = SVNPathUtil.append(myRepositoryRoot, myCurrentPath);
final File localPath = svnFileUrlMapping.getLocalPath(absolutePath);
if (localPath == null) {
LOG.info("Cannot find local path for url: " + absolutePath);
return null;
}
return VcsUtil.getFilePath(localPath, false);
}
use of org.jetbrains.idea.svn.SvnFileUrlMapping in project intellij-community by JetBrains.
the class LatestExistentSearcher method detectStartRevision.
private boolean detectStartRevision() {
if (!myStartExistsKnown) {
final SvnFileUrlMapping mapping = myVcs.getSvnFileUrlMapping();
final RootUrlInfo rootUrlInfo = mapping.getWcRootForUrl(myUrl.toString());
if (rootUrlInfo == null)
return true;
final VirtualFile vf = rootUrlInfo.getVirtualFile();
final Info info = myVcs.getInfo(vf);
if ((info == null) || (info.getRevision() == null)) {
return false;
}
myStartNumber = info.getRevision().getNumber();
myStartExistsKnown = true;
}
return true;
}
use of org.jetbrains.idea.svn.SvnFileUrlMapping in project intellij-community by JetBrains.
the class SelectBranchPopup method show.
public static void show(Project project, VirtualFile file, BranchSelectedCallback callback, final String title, final Component component) {
final SvnFileUrlMapping urlMapping = SvnVcs.getInstance(project).getSvnFileUrlMapping();
final SVNURL svnurl = urlMapping.getUrlForFile(virtualToIoFile(file));
if (svnurl == null) {
return;
}
final RootUrlInfo rootUrlInfo = urlMapping.getWcRootForUrl(svnurl.toString());
if (rootUrlInfo == null) {
return;
}
// not vcs root but wc root is ok
showForBranchRoot(project, rootUrlInfo.getVirtualFile(), callback, title, component);
}
Aggregations