package com.perforce.common.journal; import com.perforce.common.ConverterException; import com.perforce.common.node.Action; public class Credit { public enum Dir { FORWARD, REVERSE; } public enum How { MERGE_FROM(0), // merge from: integration with other changes MERGE_INTO(1), // merge into: reverse merge BRANCH_FROM(2), // branch from: integration was branch of file BRANCH_INTO(3), // branch into: reverse branch COPY_FROM(4), // copy from: integration took source file whole COPY_INTO(5), // copy into: reverse take IGNORED(6), // ignored: integration ignored source changes IGNORED_BY(7), // ignored by: reverse copy DELETE_FROM(8), // delete from: integration of delete DELETE_INTO(9), // delete into: reverse delete EDIT_INTO(10), // edit into: reverse of integration downgraded to edit ADD_INTO(11), // add into: reverse of branch downgraded to add EDIT_FROM(12), // edit from; merge that the user edited ADD_FROM(13), // add from; branch downgraded to add MOVED_INTO(14), // moved into; file was renamed MOVED_FROM(15), // moved from: reverse of renamed file NULL(-1); final int id; How(int i) { id = i; } public int value() { return id; } } // Used by From or the Source public static How forward(Action action, boolean edit) throws ConverterException { if (edit) { switch (action) { case ADD: return How.BRANCH_FROM; case EDIT: return How.EDIT_FROM; case REMOVE: return How.DELETE_FROM; case BRANCH: return How.BRANCH_FROM; case INTEG: return How.EDIT_FROM; case MERGE_EDIT: return How.EDIT_FROM; case MERGE_COPY: return How.COPY_FROM; case MERGE_IGNORE: return How.IGNORED; default: throw new ConverterException("Forward credit (edit): " + action); } } else { switch (action) { case ADD: return How.BRANCH_FROM; case EDIT: return How.EDIT_FROM; case REMOVE: return How.DELETE_FROM; case BRANCH: return How.BRANCH_FROM; case INTEG: return How.COPY_FROM; case MERGE_EDIT: return How.EDIT_FROM; case MERGE_COPY: return How.COPY_FROM; case MERGE_IGNORE: return How.IGNORED; default: throw new ConverterException("Forward credit (lazy): " + action); } } } // Used by To or the Target public static How reverse(Action action, boolean edit) throws ConverterException { if (edit) { switch (action) { case ADD: return How.ADD_INTO; case EDIT: return How.EDIT_INTO; case REMOVE: return How.DELETE_INTO; case BRANCH: return How.ADD_INTO; case INTEG: return How.EDIT_INTO; case MERGE_EDIT: return How.EDIT_INTO; case MERGE_COPY: return How.COPY_INTO; case MERGE_IGNORE: return How.IGNORED_BY; default: throw new ConverterException("Reverse credit (lazy): " + action); } } else { switch (action) { case ADD: return How.ADD_INTO; case EDIT: return How.EDIT_INTO; case REMOVE: return How.DELETE_INTO; case BRANCH: return How.BRANCH_INTO; case INTEG: return How.COPY_INTO; case MERGE_EDIT: return How.EDIT_INTO; case MERGE_COPY: return How.COPY_INTO; case MERGE_IGNORE: return How.IGNORED_BY; default: throw new ConverterException("Reverse credit (lazy): " + action); } } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 13876 | Paul Allen | Rename/move file(s) | ||
//guest/paul_allen/p4convert-maven/src/com/perforce/common/journal/Credit.java | |||||
#1 | 13873 | Paul Allen | Branching using p4convert-maven | ||
//guest/perforce_software/p4convert/src/com/perforce/common/journal/Credit.java | |||||
#3 | 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. |
||
#2 | 11263 | Paul Allen | Refactor the enum Action outside of ChangeAction. | ||
#1 | 9807 | Paul Allen | Initial import of p4-convert (from change 894340) |