private List<SymbolicName> getSymbolicNames(final CvsRevisionNumber revisionNumber) { final int[] subRevisions = revisionNumber.getSubRevisions(); CvsRevisionNumber headRevNumber = revisionNumber.removeTailVersions(1); CvsRevisionNumber symRevNumber; if (subRevisions != null && subRevisions.length > 1) { // checking just in case - it should always be true int lastSubRevision = subRevisions[subRevisions.length - 1]; symRevNumber = headRevNumber.addTailVersions(0, lastSubRevision); } else { symRevNumber = headRevNumber.addTailVersions(0, 2); } return myLogInformation.getSymNamesForRevision(symRevNumber.asString()); }
private Collection<String> getBranchList(final boolean includeRevisionNumbers) { final ArrayList<String> result = new ArrayList<String>(); final Set<SymbolicName> processedSymbolicNames = new HashSet<SymbolicName>(); final String branches = myCvsRevision.getBranches(); if (branches != null && branches.length() != 0) { final String[] branchNames = branches.split(";"); for (String branchName : branchNames) { final CvsRevisionNumber revisionNumber = new CvsRevisionNumber(branchName.trim()); final List<SymbolicName> symNames = getSymbolicNames(revisionNumber); if (!symNames.isEmpty()) { for (final SymbolicName symName : symNames) { processedSymbolicNames.add(symName); if (includeRevisionNumbers) { result.add(symName.getName() + " (" + revisionNumber.asString() + ")"); } else { result.add(symName.getName()); } } } } } // IDEADEV-15186 - show branch name for just created branch with no revisions yet //noinspection unchecked final List<SymbolicName> symNames = myLogInformation.getAllSymbolicNames(); for (final SymbolicName symName : symNames) { if (StringUtil.startsWithConcatenationOf( symName.getRevision(), myCvsRevision.getNumber(), ".") && !processedSymbolicNames.contains(symName)) { CvsRevisionNumber number = new CvsRevisionNumber(symName.getRevision().trim()); final int[] subRevisions = number.getSubRevisions(); if (subRevisions.length == 4) { int lastSubRevision = subRevisions[subRevisions.length - 1]; number = number.removeTailVersions(2); number = number.addTailVersions(lastSubRevision); } if (includeRevisionNumbers) { result.add(symName.getName() + " (" + number.asString() + ")"); } else { result.add(symName.getName()); } } } return result; }