use of org.jetbrains.idea.svn.branchConfig.SvnBranchItem 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());
}
Aggregations