2018-10-18 01:13:26 +03:00
|
|
|
#ifndef FAST_EXPORT_H
|
|
|
|
#define FAST_EXPORT_H
|
2010-08-10 02:48:10 +04:00
|
|
|
|
2011-03-26 08:49:37 +03:00
|
|
|
struct strbuf;
|
2010-12-10 13:00:55 +03:00
|
|
|
struct line_buffer;
|
2010-10-11 06:41:06 +04:00
|
|
|
|
2011-03-05 05:30:23 +03:00
|
|
|
void fast_export_init(int fd);
|
|
|
|
void fast_export_deinit(void);
|
|
|
|
|
2010-12-13 08:41:12 +03:00
|
|
|
void fast_export_delete(const char *path);
|
|
|
|
void fast_export_modify(const char *path, uint32_t mode, const char *dataref);
|
2012-09-19 19:21:24 +04:00
|
|
|
void fast_export_note(const char *committish, const char *dataref);
|
2012-09-19 19:21:25 +04:00
|
|
|
void fast_export_begin_note(uint32_t revision, const char *author,
|
2017-04-26 22:29:31 +03:00
|
|
|
const char *log, timestamp_t timestamp, const char *note_ref);
|
2011-05-26 10:51:38 +04:00
|
|
|
void fast_export_begin_commit(uint32_t revision, const char *author,
|
2012-09-19 19:21:27 +04:00
|
|
|
const struct strbuf *log, const char *uuid,const char *url,
|
2017-04-26 22:29:31 +03:00
|
|
|
timestamp_t timestamp, const char *local_ref);
|
2010-12-10 13:00:55 +03:00
|
|
|
void fast_export_end_commit(uint32_t revision);
|
2012-02-02 14:19:35 +04:00
|
|
|
void fast_export_data(uint32_t mode, off_t len, struct line_buffer *input);
|
2012-09-19 19:21:24 +04:00
|
|
|
void fast_export_buf_to_data(const struct strbuf *data);
|
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>
2011-03-19 10:20:54 +03:00
|
|
|
void fast_export_blob_delta(uint32_t mode,
|
|
|
|
uint32_t old_mode, const char *old_data,
|
2012-02-02 14:19:35 +04:00
|
|
|
off_t len, struct line_buffer *input);
|
2010-12-10 13:00:55 +03:00
|
|
|
|
|
|
|
/* If there is no such file at that rev, returns -1, errno == ENOENT. */
|
2010-12-13 08:41:12 +03:00
|
|
|
int fast_export_ls_rev(uint32_t rev, const char *path,
|
2010-12-10 13:00:55 +03:00
|
|
|
uint32_t *mode_out, struct strbuf *dataref_out);
|
2010-12-13 08:41:12 +03:00
|
|
|
int fast_export_ls(const char *path,
|
2010-12-10 13:00:55 +03:00
|
|
|
uint32_t *mode_out, struct strbuf *dataref_out);
|
2010-08-10 02:48:10 +04:00
|
|
|
|
2017-08-23 03:04:47 +03:00
|
|
|
void fast_export_copy(uint32_t revision, const char *src, const char *dst);
|
|
|
|
const char *fast_export_read_path(const char *path, uint32_t *mode_out);
|
|
|
|
|
2010-08-10 02:48:10 +04:00
|
|
|
#endif
|