public class SVNPatchTarget
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.io.File |
absPath |
private boolean |
added |
private java.io.File |
canonPathFromPatchfile |
private int |
currentLine |
private boolean |
deleted |
private boolean |
eof |
private java.lang.String |
eolStr |
private java.lang.String |
eolStyle |
private boolean |
executable |
private java.io.RandomAccessFile |
file |
private boolean |
hadRejects |
private java.util.List |
hunks |
private java.util.Map |
keywords |
private SVNNodeKind |
kind |
private java.util.List |
lines |
private boolean |
localMods |
private static int |
MAX_FUZZ |
private boolean |
modified |
private boolean |
parentDirExists |
private SVNPatch |
patch |
private java.io.OutputStream |
patched |
private java.io.File |
patchedPath |
private java.io.OutputStream |
patchedRaw |
private SVNPatchFileStream |
reject |
private java.io.File |
rejectPath |
private java.io.File |
relPath |
private boolean |
skipped |
private SVNPatchFileStream |
stream |
Modifier | Constructor and Description |
---|---|
private |
SVNPatchTarget() |
Modifier and Type | Method and Description |
---|---|
void |
applyHunk(SVNPatchHunkInfo hi)
Write the modified text of hunk described by HI to the patched stream of
TARGET.
|
static SVNPatchTarget |
applyPatch(SVNPatch patch,
java.io.File absWCPath,
int stripCount,
SVNAdminArea wc)
Apply a PATCH to a working copy at ABS_WC_PATH.
|
void |
copyLinesToTarget(int line)
Copy lines to the patched stream until the specified LINE has been
reached.
|
static java.lang.String[] |
decomposePath(java.io.File path) |
private static java.lang.String |
detectFileEOL(java.io.RandomAccessFile file)
Detect the EOL marker used in file and return it.
|
java.io.File |
getAbsPath() |
java.io.File |
getCanonPathFromPatchfile() |
private java.io.File |
getChildPath(java.io.File basePath,
java.io.File childPath) |
int |
getCurrentLine() |
java.lang.String |
getEolStr() |
java.lang.String |
getEolStyle() |
java.io.RandomAccessFile |
getFile() |
SVNPatchHunkInfo |
getHunkInfo(SVNPatchHunk hunk,
int fuzz)
Determine the line at which a HUNK applies to the TARGET file, and return
an appropriate hunk_info object in *HI, allocated from RESULT_POOL.
|
java.util.List |
getHunks() |
java.util.Map |
getKeywords() |
SVNNodeKind |
getKind() |
java.util.List |
getLines() |
SVNPatch |
getPatch() |
java.io.OutputStream |
getPatched() |
java.io.File |
getPatchedPath() |
java.io.OutputStream |
getPatchedRaw() |
SVNPatchFileStream |
getReject() |
java.io.File |
getRejectPath() |
java.io.File |
getRelPath() |
SVNPatchFileStream |
getStream() |
static SVNPatchTarget |
initPatchTarget(SVNPatch patch,
java.io.File baseDir,
int stripCount,
SVNAdminArea wc)
Attempt to initialize a patch TARGET structure for a target file
described by PATCH.
|
void |
installPatchedTarget(java.io.File absWCPath,
boolean dryRun,
SVNAdminArea wc)
Install a patched TARGET into the working copy at ABS_WC_PATH.
|
boolean |
isAdded() |
static boolean |
isChildPath(java.io.File baseFile,
java.io.File file) |
boolean |
isDeleted() |
boolean |
isEof() |
boolean |
isExecutable() |
boolean |
isHadRejects() |
boolean |
isLocalMods() |
boolean |
isModified() |
boolean |
isParentDirExists() |
boolean |
isSkipped() |
private boolean |
matchHunk(SVNPatchHunk hunk,
int fuzz)
Indicate in *MATCHED whether the original text of HUNK matches the patch
TARGET at its current line.
|
void |
readLine(java.lang.StringBuffer line)
Read a *LINE from TARGET.
|
void |
rejectHunk(SVNPatchHunkInfo hi)
Write the diff text of the hunk described by HI to the reject stream of
TARGET, and mark TARGET as having had rejects.
|
private void |
resolveTargetPath(java.io.File pathFromPatchfile,
java.io.File absWCPath,
int stripCount,
SVNAdminArea wc)
Resolve the exact path for a patch TARGET at path PATH_FROM_PATCHFILE,
which is the path of the target as it appeared in the patch file.
|
int |
scanForMatch(SVNPatchHunk hunk,
boolean matchFirst,
int upperLine,
int fuzz)
Scan lines of TARGET for a match of the original text of HUNK, up to but
not including the specified UPPER_LINE.
|
void |
seekToLine(int line)
Seek to the specified LINE in TARGET.
|
void |
sendPatchNotification(SVNAdminArea wc)
Use client context CTX to send a suitable notification for a patch
TARGET.
|
static java.io.File |
stripPath(java.io.File path,
int stripCount) |
private void |
tryWrite(java.io.OutputStream stream,
java.lang.StringBuffer buffer)
Attempt to write LEN bytes of DATA to STREAM, the underlying file of
which is at ABSPATH.
|
private static final int MAX_FUZZ
private SVNPatch patch
private java.util.List lines
private java.util.List hunks
private boolean localMods
private boolean executable
private boolean skipped
private java.lang.String eolStr
private java.util.Map keywords
private java.lang.String eolStyle
private SVNNodeKind kind
private int currentLine
private boolean modified
private boolean hadRejects
private boolean deleted
private boolean eof
private boolean added
private java.io.File absPath
private java.io.File relPath
private java.io.File canonPathFromPatchfile
private java.io.RandomAccessFile file
private SVNPatchFileStream stream
private java.io.File patchedPath
private java.io.OutputStream patchedRaw
private java.io.OutputStream patched
private java.io.File rejectPath
private SVNPatchFileStream reject
private boolean parentDirExists
public boolean isLocalMods()
public java.lang.String getEolStr()
public java.util.Map getKeywords()
public java.lang.String getEolStyle()
public java.io.RandomAccessFile getFile()
public java.io.OutputStream getPatchedRaw()
public java.io.File getCanonPathFromPatchfile()
public SVNPatch getPatch()
public int getCurrentLine()
public boolean isModified()
public boolean isEof()
public java.util.List getLines()
public boolean isSkipped()
public java.util.List getHunks()
public SVNNodeKind getKind()
public SVNPatchFileStream getStream()
public java.io.OutputStream getPatched()
public SVNPatchFileStream getReject()
public java.io.File getPatchedPath()
public boolean isAdded()
public boolean isDeleted()
public boolean isExecutable()
public java.io.File getRejectPath()
public java.io.File getAbsPath()
public java.io.File getRelPath()
public boolean isHadRejects()
public boolean isParentDirExists()
public static SVNPatchTarget initPatchTarget(SVNPatch patch, java.io.File baseDir, int stripCount, SVNAdminArea wc) throws SVNException, java.io.IOException
SVNException
java.io.IOException
private static java.lang.String detectFileEOL(java.io.RandomAccessFile file) throws java.io.IOException
java.io.IOException
private void resolveTargetPath(java.io.File pathFromPatchfile, java.io.File absWCPath, int stripCount, SVNAdminArea wc) throws SVNException, java.io.IOException
SVNException
java.io.IOException
public static boolean isChildPath(java.io.File baseFile, java.io.File file) throws java.io.IOException
java.io.IOException
private java.io.File getChildPath(java.io.File basePath, java.io.File childPath) throws java.io.IOException
java.io.IOException
public static java.io.File stripPath(java.io.File path, int stripCount)
public void rejectHunk(SVNPatchHunkInfo hi) throws SVNException, java.io.IOException
java.io.IOException
SVNException
public void applyHunk(SVNPatchHunkInfo hi) throws SVNException, java.io.IOException
SVNException
java.io.IOException
public void seekToLine(int line) throws SVNException, java.io.IOException
SVNException
java.io.IOException
public void readLine(java.lang.StringBuffer line) throws SVNException, java.io.IOException
SVNException
java.io.IOException
public void copyLinesToTarget(int line) throws SVNException, java.io.IOException
java.io.IOException
SVNException
public void installPatchedTarget(java.io.File absWCPath, boolean dryRun, SVNAdminArea wc) throws SVNException
SVNException
public static java.lang.String[] decomposePath(java.io.File path)
public static SVNPatchTarget applyPatch(SVNPatch patch, java.io.File absWCPath, int stripCount, SVNAdminArea wc) throws SVNException, java.io.IOException
SVNException
java.io.IOException
public SVNPatchHunkInfo getHunkInfo(SVNPatchHunk hunk, int fuzz) throws SVNException, java.io.IOException
SVNException
java.io.IOException
public int scanForMatch(SVNPatchHunk hunk, boolean matchFirst, int upperLine, int fuzz) throws SVNException, java.io.IOException
SVNException
java.io.IOException
private boolean matchHunk(SVNPatchHunk hunk, int fuzz) throws SVNException, java.io.IOException
SVNException
java.io.IOException
private void tryWrite(java.io.OutputStream stream, java.lang.StringBuffer buffer) throws java.io.IOException
java.io.IOException
public void sendPatchNotification(SVNAdminArea wc) throws SVNException
SVNException