net.sf.statsvn.util
public class SvnDiffUtils extends Object implements ISvnDiffProcessor
Modifier and Type | Field and Description |
---|---|
protected static String |
BINARY_TYPE |
protected static String |
INDEX_MARKER |
protected ISvnProcessor |
processor |
protected static String |
PROPERTY_CHANGE |
protected static String |
PROPERTY_NAME |
protected static int |
PROPERTY_NAME_LINE |
static int |
RESULT_SIZE |
Constructor and Description |
---|
SvnDiffUtils(ISvnProcessor processor)
Invokes diffs using the svn diff command line.
|
Modifier and Type | Method and Description |
---|---|
protected void |
appendResults(Vector answer,
String currFile,
StringBuffer sb)
Append results to answer vector.
|
protected ProcessUtils |
callSvnDiff(String newRevNr)
Calls svn diff on all files for given revision and revision-1.
|
protected ProcessUtils |
callSvnDiff(String oldRevNr,
String newRevNr,
String filename)
Calls svn diff for the filename and revisions given.
|
Vector |
getLineDiff(String newRevNr)
Returns line count differences for all files in a particular revision.
|
int[] |
getLineDiff(String oldRevNr,
String newRevNr,
String filename)
Returns line count differences between two revisions of a file.
|
protected ISvnProcessor |
getProcessor() |
protected boolean |
isBinaryErrorMessage(String msg)
Returns true if msg is an error message display that the file is binary.
|
protected int[] |
parseDiff(net.sf.statcvs.util.LookaheadReader diffReader)
Returns line count differences between two revisions of a file.
|
protected void |
parseMultipleDiffStream(Vector answer,
InputStream diffStream) |
protected int[] |
parseSingleDiffStream(InputStream diffStream) |
protected void |
verifyOutput(ProcessUtils pUtils)
Verifies the process error stream.
|
public static final int RESULT_SIZE
protected static final int PROPERTY_NAME_LINE
protected static final String PROPERTY_CHANGE
protected static final String PROPERTY_NAME
protected static final String BINARY_TYPE
protected static final String INDEX_MARKER
protected ISvnProcessor processor
public SvnDiffUtils(ISvnProcessor processor)
protected ISvnProcessor getProcessor()
protected ProcessUtils callSvnDiff(String oldRevNr, String newRevNr, String filename) throws IOException
oldRevNr
- old revision numbernewRevNr
- new revision numberfilename
- filename.IOException
protected ProcessUtils callSvnDiff(String newRevNr) throws IOException
newRevNr
- revision numberIOException
public int[] getLineDiff(String oldRevNr, String newRevNr, String filename) throws IOException, BinaryDiffException
ISvnDiffProcessor
getLineDiff
in interface ISvnDiffProcessor
oldRevNr
- old revision numbernewRevNr
- new revision numberfilename
- the filenameIOException
- problem parsing the streamBinaryDiffException
- if the error message is due to trying to diff binary files.protected int[] parseSingleDiffStream(InputStream diffStream) throws IOException, BinaryDiffException
IOException
BinaryDiffException
protected void verifyOutput(ProcessUtils pUtils) throws IOException, BinaryDiffException
pUtils
- the process callIOException
- problem parsing the streamBinaryDiffException
- if the error message is due to trying to diff binary files.public Vector getLineDiff(String newRevNr) throws IOException, BinaryDiffException
ISvnDiffProcessor
getLineDiff
in interface ISvnDiffProcessor
newRevNr
- new revision numberIOException
- problem parsing the streamBinaryDiffException
- if the error message is due to trying to diff binary files.protected void parseMultipleDiffStream(Vector answer, InputStream diffStream) throws IOException
IOException
protected void appendResults(Vector answer, String currFile, StringBuffer sb) throws IOException
answer
- the current answerscurrFile
- the current file being added.sb
- the diff for this individual file.IOException
- problem parsing the streamBinaryDiffException
- if the error message is due to trying to diff binary files.protected boolean isBinaryErrorMessage(String msg)
msg
- the error message given by ProcessUtils.getErrorMessage();protected int[] parseDiff(net.sf.statcvs.util.LookaheadReader diffReader) throws IOException, BinaryDiffException
diffReader
- the stream reader for svn diffIOException
- problem parsing the streamBinaryDiffException