package com.perforce.common.process; import java.util.HashMap; import java.util.Map; import com.perforce.common.depot.DepotInterface; import com.perforce.common.label.LabelInterface; import com.perforce.common.label.TagConvert; import com.perforce.cvs.RevisionEntry; import com.perforce.svn.query.QueryInterface; public class ProcessLabel { private QueryInterface query; private DepotInterface depot; private HashMap<String, LabelInterface> labelMap = new HashMap<String, LabelInterface>(); public ProcessLabel(DepotInterface depot) throws Exception { this.depot = depot; this.query = ProcessFactory.getQuery(depot); } protected QueryInterface getQuery() { return query; } public DepotInterface getDepot() { return depot; } public void labelRev(RevisionEntry entry, long change) throws Exception { for (String labelName : entry.getLabels()) { LabelInterface label; if (labelMap.containsKey(labelName)) { label = labelMap.get(labelName); } else { label = ProcessFactory.getLabel(labelName, entry, depot); } String path = entry.getPath(); int revision = query.findHeadRevision(path, change); TagConvert tag = new TagConvert(path, revision); label.add(tag); labelMap.put(labelName, label); } } public String toString() { StringBuffer sb = new StringBuffer(); for (Map.Entry<String, LabelInterface> entry : labelMap.entrySet()) { sb.append(entry.getValue()); } return sb.toString(); } public void submit() throws Exception { for (Map.Entry<String, LabelInterface> entry : labelMap.entrySet()) { entry.getValue().submit(); } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 13920 | Paul Allen | copy part 2 (no errors) | ||
#6 | 11294 | Paul Allen |
SVN: Improved label support for Subversion tag of another tag, when one or both get converted to a Perforce label. TODO: add aditional unit tests. |
||
#5 | 11043 | Paul Allen |
SVN: Added View support for Automatic labels (Convert and Import mode) - Update view metadata in test case 118 |
||
#4 | 11041 | Paul Allen | SVN: Fixes to support changelist numbering and AUTOMATIC labels in Import mode (front door). | ||
#3 | 11040 | Paul Allen |
SVN: Static label support - Push up shared label code for CVS/SVN - Update label description base for CVS test case 030 |
||
#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) |