use of org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew in project intellij-community by JetBrains.
the class WcInfoLoader method createInfoWithBranches.
@NotNull
private WCInfoWithBranches createInfoWithBranches(@NotNull WCInfo info, @NotNull RootUrlInfo rootUrlInfo) {
SvnBranchConfigurationNew configuration = SvnBranchConfigurationManager.getInstance(myVcs.getProject()).get(rootUrlInfo.getVirtualFile());
Ref<WCInfoWithBranches.Branch> workingCopyBranch = Ref.create();
List<WCInfoWithBranches.Branch> branches = ContainerUtil.newArrayList();
String url = info.getUrl().toString();
// TODO: Probably could utilize SvnBranchConfigurationNew.UrlListener and SvnBranchConfigurationNew.iterateUrls() behavior
String trunkUrl = configuration.getTrunkUrl();
if (trunkUrl != null) {
add(url, trunkUrl, branches, workingCopyBranch);
}
for (String branchUrl : configuration.getBranchUrls()) {
for (SvnBranchItem branchItem : configuration.getBranches(branchUrl)) {
add(url, branchItem.getUrl(), branches, workingCopyBranch);
}
}
Collections.sort(branches, (o1, o2) -> Comparing.compare(o1.getUrl(), o2.getUrl()));
return new WCInfoWithBranches(info, branches, rootUrlInfo.getRoot(), workingCopyBranch.get());
}
use of org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew in project intellij-community by JetBrains.
the class SvnUtil method getBranchForUrl.
@Nullable
public static SVNURL getBranchForUrl(@NotNull SvnVcs vcs, @NotNull VirtualFile vcsRoot, @NotNull SVNURL url) {
SVNURL result = null;
SvnBranchConfigurationNew configuration = SvnBranchConfigurationManager.getInstance(vcs.getProject()).get(vcsRoot);
try {
result = configuration.getWorkingBranch(url);
} catch (SvnBindException e) {
LOG.debug(e);
}
return result;
}
use of org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew in project intellij-community by JetBrains.
the class SvnQuickMergeTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
myVcs = SvnVcs.getInstance(myProject);
myChangeListManager = ChangeListManager.getInstance(myProject);
myBranchUrl = prepareBranchesStructure();
myBranchRoot = new File(myTempDirFixture.getTempDirPath(), "b1");
runInAndVerifyIgnoreOutput("co", myBranchUrl, myBranchRoot.getPath());
Assert.assertTrue(myBranchRoot.exists());
myBranchVf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(myBranchRoot);
Assert.assertNotNull(myBranchVf);
myBranchTree = new SubTree(myBranchVf);
myTree = new SubTree(myWorkingCopyDir);
final SvnBranchConfigurationManager branchConfigurationManager = SvnBranchConfigurationManager.getInstance(myProject);
final SvnBranchConfigurationNew configuration = new SvnBranchConfigurationNew();
configuration.setTrunkUrl(myRepoUrl + "/trunk");
configuration.addBranches(myRepoUrl + "/branches", new InfoStorage<>(new ArrayList<>(), InfoReliability.empty));
branchConfigurationManager.setConfiguration(myWorkingCopyDir, configuration);
//((ApplicationImpl) ApplicationManager.getApplication()).setRunPooledInTest(true);
runInAndVerifyIgnoreOutput(virtualToIoFile(myWorkingCopyDir), "up");
Thread.sleep(10);
}
use of org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew in project intellij-community by JetBrains.
the class SvnUpdateRootOptionsPanel method chooseBranch.
private void chooseBranch() {
if (mySourceUrl == null) {
myBranchField.setEnabled(false);
return;
}
SelectBranchPopup.show(myVcs.getProject(), myRoot.getVirtualFile(), (project, configuration, url, revision) -> {
// TODO: It seems that we could reuse configuration passed as parameter to this callback
SvnBranchConfigurationNew branchConfiguration = getBranchConfiguration();
String branchRelativeUrl = branchConfiguration != null ? branchConfiguration.getRelativeUrl(mySourceUrl.toString()) : null;
if (mySourceUrl == null || branchRelativeUrl == null) {
myBranchField.setText("");
} else {
try {
myURLText.setText(SVNURL.parseURIEncoded(url).appendPath(branchRelativeUrl, true).toDecodedString());
} catch (SVNException e) {
LOG.error(e);
}
myBranchField.setText(SVNPathUtil.tail(url));
}
}, SvnBundle.message("select.branch.popup.general.title"), myPanel);
}
Aggregations