package com.perforce.common.depot; import java.io.File; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.perforce.common.client.Connection; import com.perforce.common.client.ConnectionFactory; import com.perforce.common.node.PathMapTranslator; import com.perforce.config.CFG; import com.perforce.config.CaseSensitivity; import com.perforce.config.Config; import com.perforce.config.ConfigException; import com.perforce.p4java.server.IOptionsServer; public class DepotImport implements DepotInterface { private Logger logger = LoggerFactory.getLogger(DepotImport.class); private String depotName; private String depotSub; private String depotPath; private String user; private String client; private String defaultClientRoot; private CaseSensitivity caseMode; private IOptionsServer iserver; public DepotImport(String name, CaseSensitivity mode) throws Exception { depotName = name; depotSub = (String) Config.get(CFG.P4_DEPOT_SUB); if (!depotSub.endsWith("/")) { depotSub = new String(depotSub + "/"); } if (!depotSub.startsWith("/")) { depotSub = new String("/" + depotSub); } depotPath = (String) Config.get(CFG.P4_ROOT); if (!depotPath.endsWith("/")) { depotPath = new String(depotPath + "/"); } caseMode = mode; user = (String) Config.get(CFG.P4_USER); client = (String) Config.get(CFG.P4_CLIENT); defaultClientRoot = (String) Config.get(CFG.P4_CLIENT_ROOT); if (!defaultClientRoot.endsWith("/") && !defaultClientRoot.endsWith("\\")) { defaultClientRoot = new String(defaultClientRoot + "/"); logger.info("Adding missing delimiter '/' or '\\' to end of Client path"); Config.set(CFG.P4_CLIENT_ROOT, defaultClientRoot); } // Initial connection Connection p4 = ConnectionFactory.getConnection(); iserver = p4.getIserver(); } @Override public String getClient() { return client; } @Override public long getDefaultDate() { // TODO Auto-generated method stub return 0; } @Override public String getUser() { // Not used (satisfy interface) return user; } @Override public String getName() { return depotName; } @Override public String getPath(String scmPath) { String p4Path = PathMapTranslator.translate(scmPath); return p4Path; } @Override public String getRoot() throws ConfigException { return depotPath; } public IOptionsServer getIServer() { return iserver; } @Override public String getDefaultClientRoot() throws Exception { File file = new File(defaultClientRoot); return file.getCanonicalPath() + "/"; } public CaseSensitivity getCaseMode() { return caseMode; } public int getServerVersion() { return iserver.getServerVersionNumber(); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 26953 | Paul Allen | Move //guest/perforce_software/p4convert to //guest/perforce_software/p4convert/main | ||
#2 | 14229 | Paul Allen | Update p4java to 15.1 and use RSH connection for Unit tests. | ||
#1 | 13920 | Paul Allen | copy part 2 (no errors) | ||
//guest/paul_allen/p4convert-maven/src/main/java/com/perforce/common/depot/DepotImport.java | |||||
#1 | 13876 | Paul Allen | Rename/move file(s) | ||
//guest/paul_allen/p4convert-maven/src/com/perforce/common/depot/DepotImport.java | |||||
#1 | 13873 | Paul Allen | Branching using p4convert-maven | ||
//guest/perforce_software/p4convert/src/com/perforce/common/depot/DepotImport.java | |||||
#4 | 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. |
||
#3 | 12552 | Paul Allen |
Remove warning count on message: "Adding missing delimiter '/' or '\\' to end of Client path." |
||
#2 | 11071 | Paul Allen |
Path map translator for CVS and SVN paths. (undoc) To use create a path.map file with regex and group match. Only the first matching entry is used. The regex and group match are seperated by ', ' (or in regex terms ',\s+'). Lines starting with '#' are ignored. For example, 'trunk' is renamed to 'main', but other entries are left as-is. # path.map trunk/(.*), //import/main/{1} (.*), //import/{1} Note: if no file is found the default 'depot' and 'subPath' options are used to generate the map, preserving the original behaviour. CVS paths will always stat with the 'branch' name. 'main' for 1.1 and the symbol for other branches. # path.map main/projA/(.*), //import/projA/MAIN/{1} release_(.*)/projA/(.*), //import/projA/REL{1}/{2} (.*)/projA/(.*), //import/projA/TAG-{1}/{2} (.*), //import/unexpected/{1} Node: adding a catch all is a good idea. |
||
#1 | 9807 | Paul Allen | Initial import of p4-convert (from change 894340) |