コード例 #1
0
ファイル: RtcTagList.java プロジェクト: reinhapa/rtc2gitcli
 public RtcTag add(RtcTag tag) {
   long creationDate = tag.getCreationDate();
   int tagIndex = rtcTags.indexOf(tag);
   if (tagIndex < 0) {
     for (RtcTag tagToCheck : rtcTags) {
       if (tagToCheck.getOriginalName().equals(tag.getOriginalName())) {
         tag.setMakeNameUnique(true);
         break;
       }
     }
     rtcTags.add(tag);
   } else {
     tag = rtcTags.get(tagIndex);
     tag.setCreationDate(creationDate / 2 + tag.getCreationDate() / 2);
   }
   return tag;
 }
コード例 #2
0
ファイル: RtcTagList.java プロジェクト: reinhapa/rtc2gitcli
 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;
     }
   }
 }
コード例 #3
0
ファイル: RtcTagList.java プロジェクト: reinhapa/rtc2gitcli
 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 **********");
 }
コード例 #4
0
ファイル: RtcTagList.java プロジェクト: reinhapa/rtc2gitcli
  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;
  }