package com.perforce.common.process; import com.perforce.common.depot.DepotConvert; import com.perforce.common.depot.DepotImport; import com.perforce.common.depot.DepotInterface; import com.perforce.common.label.LabelConvert; import com.perforce.common.label.LabelImport; import com.perforce.common.label.LabelInterface; import com.perforce.common.node.NodeConvert; import com.perforce.common.node.NodeImport; import com.perforce.common.node.NodeInterface; import com.perforce.config.CFG; import com.perforce.config.CaseSensitivity; import com.perforce.config.Config; import com.perforce.config.ConfigException; import com.perforce.config.ScmType; import com.perforce.svn.change.ChangeConvert; import com.perforce.svn.change.ChangeImport; import com.perforce.svn.change.ChangeInterface; import com.perforce.svn.history.RevisionTree; import com.perforce.svn.query.QueryHistory; import com.perforce.svn.query.QueryInterface; import com.perforce.svn.query.QueryPerforce; public class ProcessFactory { private static RevisionTree tree; // don't like this being stored here! private static boolean pendingBlock; public static NodeInterface getNode(ChangeInterface cl, DepotInterface nodeDepot, boolean subBlock) throws ConfigException { NodeInterface node; if (Config.isImportMode()) { // Import mode (front-door) node = new NodeImport((ChangeImport) cl, tree, subBlock, pendingBlock); } else { // Convert mode (back-door) node = new NodeConvert((ChangeConvert) cl, (DepotConvert) nodeDepot, tree, subBlock); } // update pending block for next node (as 'Import mode' has no state) pendingBlock = subBlock; return node; } public static QueryInterface getQuery(DepotInterface depot) throws ConfigException { if (Config.isImportMode()) { return new QueryPerforce((DepotImport) depot, tree); } else { return new QueryHistory(tree); } } public static ChangeInterface getChange(long c, ChangeInfo info, DepotInterface depot) throws Exception { if (Config.isImportMode()) { return new ChangeImport(c, info, (DepotImport) depot); } else { switch ((ScmType) Config.get(CFG.SCM_TYPE)) { case CVS: return new ChangeConvert(c, info, (DepotConvert) depot); case SVN: return new ChangeConvert(c, info, (DepotConvert) depot); default: return null; } } } public static DepotInterface getDepot(String name, CaseSensitivity caseMode) throws Exception { if (Config.isImportMode()) { tree = new RevisionTree(name, caseMode); return new DepotImport(name, caseMode); } else { tree = new RevisionTree(name, caseMode); return new DepotConvert(tree.getName()); } } public static LabelInterface getLabel(String label, ChangeInfo change, DepotInterface depot) throws Exception { if (Config.isImportMode()) { return new LabelImport(label, change, (DepotImport) depot); } else { return new LabelConvert(label, change, (DepotConvert) depot); } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 12446 | Paul Allen | Branching using p4convert-rusty | ||
//guest/perforce_software/p4convert/src/com/perforce/common/process/ProcessFactory.java | |||||
#3 | 11066 | Paul Allen |
Code refactor: Moved 'node' package from 'svn' to 'common'. |
||
#2 | 11018 | Paul Allen | SVN: Support automatic labels for IMPORT and CONVERT modes. | ||
#1 | 9807 | Paul Allen | Initial import of p4-convert (from change 894340) |