Search in sources :

Example 1 with SvnBranchItem

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());
}
Also used : SvnBranchItem(org.jetbrains.idea.svn.branchConfig.SvnBranchItem) SvnBranchConfigurationNew(org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew) WCInfoWithBranches(org.jetbrains.idea.svn.dialogs.WCInfoWithBranches) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

NotNull (org.jetbrains.annotations.NotNull)1 SvnBranchConfigurationNew (org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew)1 SvnBranchItem (org.jetbrains.idea.svn.branchConfig.SvnBranchItem)1 WCInfoWithBranches (org.jetbrains.idea.svn.dialogs.WCInfoWithBranches)1