use of org.jetbrains.idea.svn.dialogs.WCInfo 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.dialogs.WCInfo in project intellij-community by JetBrains.
the class SvnQuickMergeTest method getWcInfo.
private WCInfo getWcInfo() {
WCInfo found = null;
final File workingIoFile = virtualToIoFile(myWorkingCopyDir);
final List<WCInfo> infos = myVcs.getAllWcInfos();
for (WCInfo info : infos) {
if (FileUtil.filesEqual(workingIoFile, new File(info.getPath()))) {
found = info;
break;
}
}
Assert.assertNotNull(found);
return found;
}
use of org.jetbrains.idea.svn.dialogs.WCInfo in project intellij-community by JetBrains.
the class SvnVcs method getAllWcInfos.
/**
* Returns real working copies roots - if there is <Project Root> -> Subversion setting,
* and there is one working copy, will return one root
*/
public List<WCInfo> getAllWcInfos() {
final SvnFileUrlMapping urlMapping = getSvnFileUrlMapping();
final List<RootUrlInfo> infoList = urlMapping.getAllWcInfos();
final List<WCInfo> infos = new ArrayList<>();
for (RootUrlInfo info : infoList) {
final File file = info.getIoFile();
infos.add(new WCInfo(info, SvnUtil.isWorkingCopyRoot(file), SvnUtil.getDepth(this, file)));
}
return infos;
}
use of org.jetbrains.idea.svn.dialogs.WCInfo in project intellij-community by JetBrains.
the class SvnVcs method cleanup17copies.
/**
* TODO: This seems to be related to some issues when upgrading from 1.6 to 1.7. So it is not currently required for 1.8 and later
* TODO: formats. And should be removed when 1.6 working copies are no longer supported by IDEA.
*/
private void cleanup17copies() {
Runnable callCleanupWorker = () -> {
if (myProject.isDisposed())
return;
new CleanupWorker(this, emptyList()) {
@Override
protected void fillRoots() {
for (WCInfo info : getAllWcInfos()) {
if (WorkingCopyFormat.ONE_DOT_SEVEN.equals(info.getFormat())) {
VirtualFile file = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(info.getRootInfo().getIoFile());
if (file == null) {
LOG.info("Wasn't able to find virtual file for wc root: " + info.getPath());
} else {
myRoots.add(file);
}
}
}
}
}.execute();
};
myCopiesRefreshManager.waitRefresh(() -> ApplicationManager.getApplication().invokeLater(callCleanupWorker));
}
use of org.jetbrains.idea.svn.dialogs.WCInfo 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"));
}
Aggregations