package com.perforce.cvs; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class RevisionSorter { private int index = 0; private List<DBRevisionWrapper> list = new ArrayList<DBRevisionWrapper>(); public void add(RevisionEntry entry) { DBRevisionWrapper wrap = new DBRevisionWrapper(entry); list.add(wrap); } public void sort() { Collections.sort((List<DBRevisionWrapper>) list); } public String toString() { StringBuffer sb = new StringBuffer(); for (DBRevisionWrapper wrap : list) { sb.append(wrap.get().toString()); sb.append("\n"); } return sb.toString(); } public RevisionEntry next() { if (hasNext()) { DBRevisionWrapper wrap = list.get(index); RevisionEntry entry = wrap.get(); index++; return entry; } return null; } public boolean hasNext() { return (index < list.size()); } public boolean isEmpty() { return list.isEmpty(); } public void drop() { if (index > 0) { index--; } list.remove(index); } public void reset() { index = 0; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 10826 | Paul Allen |
Experiment with H2 Java database. CVS revisions are stored as Blobs with an ID, the RevisionSorter uses the ID and accesses the Blobs to sort change order. Database is located in ${CWD}/db/rev.* |
||
#1 | 10825 | Paul Allen | Branching using paul_allen.p4convert | ||
//guest/perforce_software/p4convert/src/com/perforce/cvs/RevisionSorter.java | |||||
#2 | 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) |
||
#1 | 9807 | Paul Allen | Initial import of p4-convert (from change 894340) |