path: root/vcs-svn/svndiff.h
diff options
authorJonathan Nieder <>2010-12-25 11:11:32 (GMT)
committerJonathan Nieder <>2011-03-28 03:41:38 (GMT)
commitddcc8c5b469d2564dbacd629a873e7703f2dbd83 (patch)
treebe76203eaed1f7e29a0c148dbaaae9b4b1156504 /vcs-svn/svndiff.h
parent896e4bfcec4f6b489aba2197f60a59bc7f45a8ac (diff)
vcs-svn: skeleton of an svn delta parser
A delta in the subversion delta (svndiff0) format consists of the magic bytes SVN\0 followed by a sequence of windows of a certain well specified format (starting with five integers). Add an svndiff0_apply function and test-svn-fe -d commandline tool to parse such a delta in the special case of not including any windows. Later patches will add features to turn this into a fully functional delta applier for svn-fe to use to parse the streams produced by "svnrdump dump" and "svnadmin dump --deltas". The content of symlinks starts with the word "link " in Subversion's worldview, so we need to be able to prepend that text to input for the sake of delta application. So initialization of the input state of the delta preimage is left to the calling program, giving callers a chance to seed the buffer with text of their choice. Improved-by: Ramkumar Ramachandra <> Improved-by: David Barr <> Signed-off-by: Jonathan Nieder <>
Diffstat (limited to 'vcs-svn/svndiff.h')
1 files changed, 10 insertions, 0 deletions
diff --git a/vcs-svn/svndiff.h b/vcs-svn/svndiff.h
new file mode 100644
index 0000000..74eb464
--- /dev/null
+++ b/vcs-svn/svndiff.h
@@ -0,0 +1,10 @@
+#ifndef SVNDIFF_H_
+#define SVNDIFF_H_
+struct line_buffer;
+struct sliding_view;
+extern int svndiff0_apply(struct line_buffer *delta, off_t delta_len,
+ struct sliding_view *preimage, FILE *postimage);