package com.perforce.common.label; import java.util.ArrayList; import java.util.Date; import java.util.List; import com.perforce.common.depot.DepotConvert; import com.perforce.common.journal.BuildLabel; import com.perforce.common.process.ChangeInfo; public class LabelConvert implements LabelInterface { private final DepotConvert depot; private final String name; private final ChangeInfo change; private long automatic = 0; private ArrayList<String> views = new ArrayList<String>(); private List<TagConvert> revs = new ArrayList<TagConvert>(); public LabelConvert(String label, ChangeInfo change, DepotConvert depot) { this.depot = depot; this.name = label; this.change = change; } @Override public String getName() { return name; } @Override public String getOwner() { return change.getUser(); } @Override public Long getDate() { Date date = change.getDate(); long time = date.getTime() / 1000; return time; } @Override public void setAutomatic(long automatic) { this.automatic = automatic; } @Override public String getAutomatic() { if (automatic > 0) { return "@" + automatic; } return ""; } @Override public String getDesc() { return change.getDescription(); } @Override public List<TagConvert> getTags() { return revs; } @Override public void add(TagConvert tag) { revs.add(tag); } @Override public void addView(String view) throws Exception { views.add(view); } public ArrayList<String> getView() { return views; } public String toString() { StringBuffer sb = new StringBuffer(); sb.append(name + " by: " + getOwner() + "\n"); int i = 0; for(String view : views) { sb.append(" view[" + i + "] " + view); i++; } for (TagConvert tags : revs) { sb.append("... " + tags + "\n"); } return sb.toString(); } @Override public void submit() throws Exception { ArrayList<String> journal = BuildLabel.toJournal(depot, this); depot.getJournal().write(journal); depot.getJournal().flush(); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#9 | 13920 | Paul Allen | copy part 2 (no errors) | ||
#8 | 11760 | Paul Allen |
Use default label description and append label type. Previously I used the change description, which is ok for Automatic labels, but Static labels may include more than one change. Includes: - Fix parsing of RCS descriptions (support descriptions without new line) - Update to test cases. |
||
#7 | 11298 | Paul Allen | Restrict label history to SVN + CONVERT mode | ||
#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 | 11024 | Paul Allen | SVN: Minor fixes to automatic labels. | ||
#3 | 11018 | Paul Allen | SVN: Support automatic labels for IMPORT and CONVERT modes. | ||
#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 | 9807 | Paul Allen | Initial import of p4-convert (from change 894340) |