package com.perforce.cvs; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.perforce.common.node.Action; import com.perforce.config.CFG; import com.perforce.config.Config; import com.perforce.config.ConfigException; import com.perforce.cvs.parser.rcstypes.RcsObjectDelta; public class RevisionNavigator extends RcsNavigator { private Logger logger = LoggerFactory.getLogger(RevisionNavigator.class); private RevisionSorter revList; private BranchSorter branchList; private boolean isLabel; public RevisionNavigator(RevisionSorter revisions, BranchSorter branches) { revList = revisions; branchList = branches; try { isLabel = (boolean) Config.get(CFG.CVS_LABELS); } catch (ConfigException e) { isLabel = false; } } @Override protected void foundBranchEntry(String tagName, RevisionEntry entry) { if (logger.isDebugEnabled()) { logger.debug("tag entry: " + tagName + " " + entry.getId()); } revList.add(entry); } @Override protected void foundBranchPoint(String toTag, RevisionEntry from) { if (logger.isDebugEnabled()) { logger.debug("tag point: " + toTag + " " + from.getId()); } if (branchList.isBranch(toTag) || !isLabel) { RevisionEntry brRev = createBranch(toTag, from); revList.add(brRev); } else { String format = formatName(toTag); from.addLabel(format); } } /** * Create a pseudo change for #1 revision entries * * @param tagName * @param id * @return * @throws Exception */ private RevisionEntry createBranch(String toTag, RevisionEntry from) { String basePath = getRcsRevision().getPath(); RcsObjectDelta revision = getRcsRevision().getDelta(from.getId()); RevisionEntry branch = new RevisionEntry(revision); branch.setState(Action.BRANCH); branch.setPseudo(true); branch.setReverse(from.isReverse()); branch.addDate(1L); branch.setProps(from.getProps()); branch.setTmpFile(from.getTmpFile()); String toPath = toTag + "/" + basePath; String fromPath = from.getFromPath(); if (from.isReverse()) { branch.setPath(fromPath); branch.setFromPath(toPath); } else { branch.setPath(toPath); branch.setFromPath(fromPath); } return branch; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 13876 | Paul Allen | Rename/move file(s) | ||
//guest/paul_allen/p4convert-maven/src/com/perforce/cvs/RevisionNavigator.java | |||||
#1 | 13873 | Paul Allen | Branching using p4convert-maven | ||
//guest/perforce_software/p4convert/src/com/perforce/cvs/RevisionNavigator.java | |||||
#14 | 13776 | Paul Allen |
CVS: Update to node Action detection. The RCS State is normally set to 'Exp' and 'dead', but this change allows more user defined states. - Move Action class to common.node package. - Modified test case061 to test custom states. |
||
#13 | 12516 | Paul Allen |
CVS: Label format fix. CVS branches downgraded to labels were missed during formatting. |
||
#12 | 12185 | Paul Allen |
CVS: Avoid labeling dead revisions. - includes a fix for missing revisions resulting from non-branched orphans. - test case 060 @rjackson |
||
#11 | 11263 | Paul Allen | Refactor the enum Action outside of ChangeAction. | ||
#10 | 11248 | Paul Allen | CVS: When branching from a label downgrade to ADD and use RCS content. | ||
#9 | 11227 | Paul Allen | CVS: Create MERGE action for branch with content on deleted revisions. | ||
#8 | 11064 | Paul Allen |
CVS: added detection and support for +x revisions - extended testcase 040 to test for exec bits |
||
#7 | 10987 | Paul Allen |
CVS new RCS undelta parser. Searches for the exact number of added lines, before looking for the next delta action. Should read RCS data with versioned RCS data inside it. - Updated logging. |
||
#6 | 10978 | Paul Allen |
CVS redesign of RCS Revision Navigation. - Disabled reverse RCS tag lookup for the moment. |
||
#5 | 10952 | Paul Allen |
CVS add 1ms delay to pseudo branches. - extra trace debug |
||
#4 | 10944 | Paul Allen |
CVS change-list processing. Create a delayed list for pseudo branches to prevent them falling into the wrong change. - updated test cases 006 007 047 |
||
#3 | 10770 | Paul Allen | Switched off debug/trace reporting. | ||
#2 | 10730 | Paul Allen |
CVS: Fix for Labels in Import mode. Unable to label a revision in a pending change, so store all tag entries and add them to label after the change is submitted. Includes basic test case 030 |
||
#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) |