diff options
author | David Barr <david.barr@cordelta.com> | 2011-03-05 13:30:23 +1100 |
---|---|---|
committer | Jonathan Nieder <jrnieder@gmail.com> | 2011-03-07 01:43:57 -0600 |
commit | 41529bbce407fbf1a925cfbc7c1aa30064f66ae7 (patch) | |
tree | 5a6d8500d360c55d0e32d7c85c78fd17e5c5e678 /vcs-svn/svndump.c | |
parent | efc749b48f729992d838484d652ba24f5291ee28 (diff) | |
download | git-41529bbce407fbf1a925cfbc7c1aa30064f66ae7.tar.gz git-41529bbce407fbf1a925cfbc7c1aa30064f66ae7.tar.xz |
vcs-svn: set up channel to read fast-import cat-blob response
Set up some plumbing: teach the svndump lib to pass a file descriptor
number to the fast_export lib, representing where cat-blob/ls
responses can be read from, and add a get_response_line helper
function to the fast_export lib to read a line from that file.
Unfortunately this means that svn-fe needs file descriptor 3 to be
redirected from somewhere (preferrably the cat-blob stream of a
fast-import backend); otherwise it will fail:
$ svndump <path> | svn-fe
fatal: cannot read from file descriptor 3: Bad file descriptor
For the moment, "svn-fe 3</dev/null" works as a workaround but it
will not work for very long. A fast-import backend that can retrieve
old commits is needed in order to be able to fulfill svn
"Node-copyfrom-rev" requests that refer to revs from a previous run.
[jn: with new change description]
Based-on-patch-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/svndump.c')
-rw-r--r-- | vcs-svn/svndump.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c index e6d84bada..e05a99d51 100644 --- a/vcs-svn/svndump.c +++ b/vcs-svn/svndump.c @@ -14,6 +14,8 @@ #include "obj_pool.h" #include "string_pool.h" +#define REPORT_FILENO 3 + #define NODEACT_REPLACE 4 #define NODEACT_DELETE 3 #define NODEACT_ADD 2 @@ -367,6 +369,7 @@ int svndump_init(const char *filename) if (buffer_init(&input, filename)) return error("cannot open %s: %s", filename, strerror(errno)); repo_init(); + fast_export_init(REPORT_FILENO); reset_dump_ctx(~0); reset_rev_ctx(0); reset_node_ctx(NULL); @@ -377,6 +380,7 @@ int svndump_init(const char *filename) void svndump_deinit(void) { log_reset(); + fast_export_deinit(); repo_reset(); reset_dump_ctx(~0); reset_rev_ctx(0); @@ -390,6 +394,7 @@ void svndump_deinit(void) void svndump_reset(void) { log_reset(); + fast_export_reset(); buffer_reset(&input); repo_reset(); reset_dump_ctx(~0); |