summaryrefslogtreecommitdiff
path: root/vcs-svn/fast_export.h
diff options
context:
space:
mode:
authorLibravatar David Barr <david.barr@cordelta.com>2011-03-19 18:20:54 +1100
committerLibravatar Jonathan Nieder <jrnieder@gmail.com>2011-05-26 02:28:04 -0500
commit7a75e661c5cef9fcd7c84fe0fb22672a57d6373e (patch)
tree43305b6ba2247fc4a3d798ed6b6e479eabeea140 /vcs-svn/fast_export.h
parentMerge branch 'db/delta-applier' into db/text-delta (diff)
downloadtgif-7a75e661c5cef9fcd7c84fe0fb22672a57d6373e.tar.xz
vcs-svn: implement text-delta handling
Handle input in Subversion's dumpfile format, version 3. This is the format produced by "svnrdump dump" and "svnadmin dump --deltas", and the main difference between v3 dumpfiles and the dumpfiles already handled is that these can include nodes whose properties and text are expressed relative to some other node. To handle such nodes, we find which node the text and properties are based on, handle its property changes, use the cat-blob command to request the basis blob from the fast-import backend, use the svndiff0_apply() helper to apply the text delta on the fly, writing output to a temporary file, and then measure that postimage file's length and write its content to the fast-import stream. The temporary postimage file is shared between delta-using nodes to avoid some file system overhead. The svn-fe interface needs to be more complicated to accomodate the backward flow of information from the fast-import backend to svn-fe. The backflow fd is not needed when parsing streams without deltas, though, so existing scripts using svn-fe on v2 dumps should continue to work. NEEDSWORK: generalize interface so caller sets the backflow fd, close temporary file before exiting Signed-off-by: David Barr <david.barr@cordelta.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: David Barr <david.barr@cordelta.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Diffstat (limited to 'vcs-svn/fast_export.h')
-rw-r--r--vcs-svn/fast_export.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/vcs-svn/fast_export.h b/vcs-svn/fast_export.h
index 2d392e370d..43d05b65ef 100644
--- a/vcs-svn/fast_export.h
+++ b/vcs-svn/fast_export.h
@@ -15,6 +15,9 @@ void fast_export_begin_commit(uint32_t revision, const char *author,
const char *url, unsigned long timestamp);
void fast_export_end_commit(uint32_t revision);
void fast_export_data(uint32_t mode, uint32_t len, struct line_buffer *input);
+void fast_export_blob_delta(uint32_t mode,
+ uint32_t old_mode, const char *old_data,
+ uint32_t len, struct line_buffer *input);
/* If there is no such file at that rev, returns -1, errno == ENOENT. */
int fast_export_ls_rev(uint32_t rev, const char *path,