use of org.jetbrains.idea.svn.RootUrlInfo in project intellij-community by JetBrains.
the class SvnMergeInfoTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
myTrunkUrl = myRepoUrl + "/trunk";
myBranchUrl = myRepoUrl + "/branch";
myBranchVcsRoot = new File(myTempDirFixture.getTempDirPath(), "branch");
myBranchVcsRoot.mkdir();
myProjectLevelVcsManager = (ProjectLevelVcsManagerImpl) ProjectLevelVcsManager.getInstance(myProject);
myProjectLevelVcsManager.setDirectoryMapping(myBranchVcsRoot.getAbsolutePath(), SvnVcs.VCS_NAME);
VirtualFile vcsRoot = LocalFileSystem.getInstance().findFileByIoFile(myBranchVcsRoot);
Node node = new Node(vcsRoot, SVNURL.parseURIEncoded(myBranchUrl), SVNURL.parseURIEncoded(myRepoUrl));
RootUrlInfo root = new RootUrlInfo(node, WorkingCopyFormat.ONE_DOT_SIX, vcsRoot, null);
myWCInfo = new WCInfo(root, true, Depth.INFINITY);
myMergeContext = new MergeContext(SvnVcs.getInstance(myProject), myTrunkUrl, myWCInfo, SVNPathUtil.tail(myTrunkUrl), vcsRoot);
myOneShotMergeInfoHelper = new OneShotMergeInfoHelper(myMergeContext);
myVcs = SvnVcs.getInstance(myProject);
myVcs.getSvnConfiguration().setCheckNestedForQuickMerge(true);
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
final String repoUrl = SVNURL.parseURIDecoded(myRepoUrl).toString();
myWCInfoWithBranches = new WCInfoWithBranches(myWCInfo, Collections.emptyList(), vcsRoot, new WCInfoWithBranches.Branch(repoUrl + "/trunk"));
myMergeChecker = new BranchInfo(myVcs, myWCInfoWithBranches, new WCInfoWithBranches.Branch(repoUrl + "/branch"));
}
use of org.jetbrains.idea.svn.RootUrlInfo 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.RootUrlInfo in project intellij-community by JetBrains.
the class SingleCommittedListProvider method setup.
private boolean setup() {
boolean result = false;
RootUrlInfo rootUrlInfo = myVcs.getSvnFileUrlMapping().getWcRootForFilePath(virtualToIoFile(file));
if (rootUrlInfo != null) {
changeList = new SvnChangeList[1];
revisionBefore = ((SvnRevisionNumber) number).getRevision();
repositoryUrl = rootUrlInfo.getRepositoryUrlUrl();
svnRootUrl = rootUrlInfo.getAbsoluteUrlAsUrl();
svnRootLocation = new SvnRepositoryLocation(rootUrlInfo.getAbsoluteUrl());
repositoryRelativeUrl = SvnUtil.ensureStartSlash(SvnUtil.join(SvnUtil.getRelativeUrl(repositoryUrl.toDecodedString(), svnRootUrl.toDecodedString()), SvnUtil.getRelativePath(rootUrlInfo.getPath(), file.getPath())));
filePath = VcsUtil.getFilePath(file);
result = true;
}
return result;
}
use of org.jetbrains.idea.svn.RootUrlInfo in project intellij-community by JetBrains.
the class WcInfoLoader method createInfo.
@Nullable
private WCInfoWithBranches createInfo(@NotNull WCInfo info) {
if (!info.getFormat().supportsMergeInfo()) {
return null;
}
final String url = info.getUrl().toString();
if (myLocation != null && !myLocation.toPresentableString().startsWith(url) && !url.startsWith(myLocation.toPresentableString())) {
return null;
}
if (!SvnUtil.checkRepositoryVersion15(myVcs, url)) {
return null;
}
// check of WC version
RootUrlInfo rootForUrl = myVcs.getSvnFileUrlMapping().getWcRootForUrl(url);
return rootForUrl != null ? createInfoWithBranches(info, rootForUrl) : null;
}
use of org.jetbrains.idea.svn.RootUrlInfo 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;
}
Aggregations