public void pruneExcludedTags(Pattern includePattern) { List<RtcTag> prunedList = new ArrayList<RtcTag>(); RtcTag tmpTag = null; for (RtcTag currentTag : rtcTags) { if (tmpTag == null) { tmpTag = currentTag; } else { tmpTag .setUuid(currentTag.getUuid()) .setOriginalName(currentTag.getOriginalName()) .setCreationDate(currentTag.getCreationDate()) .setMakeNameUnique(currentTag.isMakeNameUnique()) .setDoCreateTag(currentTag.doCreateTag()); tmpTag.addAll(currentTag.getComponentsChangeSets()); } Matcher matcher = includePattern.matcher(tmpTag.getOriginalName()); if (matcher.matches()) { prunedList.add(tmpTag); tmpTag = null; } } if (tmpTag != null) { prunedList.add(tmpTag); } rtcTags = prunedList; }
public void pruneInactiveTags() { RtcTag lastTagThatRequiresTagging = null; for (RtcTag tag : rtcTags) { if (tag.isContainingLastChangeset()) { lastTagThatRequiresTagging = tag; } } boolean lastTagReached = false; for (RtcTag tag : rtcTags) { tag.setDoCreateTag(!lastTagReached && tag.doCreateTag()); if (tag.equals(lastTagThatRequiresTagging)) { lastTagReached = true; } } }
public void printTagList(boolean printChangesetDetails) { output.writeLine("********** BASELINE INFOS **********"); int totalChangeSets = 0; for (RtcTag tag : rtcTags) { List<RtcChangeSet> orderedChangeSets = tag.getOrderedChangeSets(); int totalChangeSetsByBaseline = orderedChangeSets.size(); totalChangeSets += totalChangeSetsByBaseline; output.writeLine( " Baseline [" + tag.getName() + "] with original name [" + tag.getOriginalName() + "] created at [" + (new Date(tag.getCreationDate())) + "] total number of changesets [" + totalChangeSetsByBaseline + "] will be tagged [" + tag.doCreateTag() + "]"); for (Entry<String, List<RtcChangeSet>> entry : tag.getComponentsChangeSets().entrySet()) { output.writeLine( " number of changesets for component [" + entry.getKey() + "] is [" + entry.getValue().size() + "]"); } if (printChangesetDetails) { for (RtcChangeSet changeSet : orderedChangeSets) { output.writeLine( " -- " + new Date(changeSet.getCreationDate()) + " : [" + changeSet.getCreatorName() + "] " + changeSet.getComment()); } } } output.writeLine("TOTAL NUMBER OF CHANGESETS [" + totalChangeSets + "]"); output.writeLine("********** BASELINE INFOS **********"); }