package com.perforce.cvs; import java.util.HashMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.perforce.cvs.parser.RcsReader; public class BranchNavigator extends RcsNavigator { private Logger logger = LoggerFactory.getLogger(BranchNavigator.class); private BranchSorter sort; private HashMap<String, Integer> brCount; public BranchNavigator(BranchSorter brSort) { sort = brSort; } public void add(RcsReader rcs) throws Exception { // for each RCS file reset branch counters brCount = new HashMap<String, Integer>(); // add all revisions in RCS file and count branches super.add(rcs); // update branch max counts sort.join(brCount); } @Override protected void foundBranchEntry(String name, RevisionEntry entry) { countBranch(name); if (logger.isTraceEnabled()) { int count = brCount.get(name); logger.trace("... branch entry: " + name + " (" + count + ")"); } } @Override protected void foundBranchPoint(String name, RevisionEntry entry) { countBranch(name); if (logger.isTraceEnabled()) { int count = brCount.get(name); logger.trace("... branch point: " + name + " (" + count + ")"); } } private void countBranch(String name) { int count = 0; if (brCount.containsKey(name)) { count = brCount.get(name) + 1; } brCount.put(name, count); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 13876 | Paul Allen | Rename/move file(s) | ||
//guest/paul_allen/p4convert-maven/src/com/perforce/cvs/BranchNavigator.java | |||||
#1 | 13873 | Paul Allen | Branching using p4convert-maven | ||
//guest/perforce_software/p4convert/src/com/perforce/cvs/BranchNavigator.java | |||||
#1 | 10728 | Paul Allen |
CVS: new Label feature. Scans the RCS tree counting revisions on a branch. If the branch only has one revision it gets downgraded to a Label. Support added for Import and Convert mode. Activate using: com.p4convert.cvs.labels=true or in java Config.set(CFG.CVS_LABELS, true); (manual testing only -- automated tests will follow this change) |