From: Jonathan Nieder Date: Thu, 26 May 2011 07:12:14 +0000 (-0500) Subject: Merge branch 'db/svn-fe-code-purge' into svn-fe X-Git-Tag: v1.7.10-rc0~118^2~4^2~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c19d653c4fcdc93169507c09f8f66ebffbdbb9a5;p=git.git Merge branch 'db/svn-fe-code-purge' into svn-fe * db/svn-fe-code-purge: vcs-svn: drop obj_pool vcs-svn: drop treap vcs-svn: drop string_pool vcs-svn: pass paths through to fast-import Conflicts: vcs-svn/fast_export.c vcs-svn/fast_export.h vcs-svn/repo_tree.c vcs-svn/repo_tree.h vcs-svn/string_pool.c vcs-svn/svndump.c vcs-svn/trp.txt --- c19d653c4fcdc93169507c09f8f66ebffbdbb9a5 diff --cc vcs-svn/fast_export.h index 9c522d177,12b0bbb41..2d392e370 --- a/vcs-svn/fast_export.h +++ b/vcs-svn/fast_export.h @@@ -8,12 -8,11 +8,11 @@@ void fast_export_init(int fd) void fast_export_deinit(void); void fast_export_reset(void); - void fast_export_delete(uint32_t depth, const uint32_t *path); - void fast_export_modify(uint32_t depth, const uint32_t *path, - uint32_t mode, const char *dataref); + void fast_export_delete(const char *path); + void fast_export_modify(const char *path, uint32_t mode, const char *dataref); -void fast_export_begin_commit(uint32_t revision, const char *author, char *log, - const char *uuid, const char *url, - unsigned long timestamp); +void fast_export_begin_commit(uint32_t revision, const char *author, + const struct strbuf *log, const char *uuid, + 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); diff --cc vcs-svn/repo_tree.c index 1681b654d,f2466bc63..67d27f0b6 --- a/vcs-svn/repo_tree.c +++ b/vcs-svn/repo_tree.c @@@ -8,13 -8,14 +8,13 @@@ #include "repo_tree.h" #include "fast_export.h" - const char *repo_read_path(const uint32_t *path, uint32_t *mode_out) -const char *repo_read_path(const char *path) ++const char *repo_read_path(const char *path, uint32_t *mode_out) { int err; - uint32_t dummy; static struct strbuf buf = STRBUF_INIT; strbuf_reset(&buf); - err = fast_export_ls(REPO_MAX_PATH_DEPTH, path, mode_out, &buf); - err = fast_export_ls(path, &dummy, &buf); ++ err = fast_export_ls(path, mode_out, &buf); if (err) { if (errno != ENOENT) die_errno("BUG: unexpected fast_export_ls error"); @@@ -25,7 -24,24 +25,7 @@@ return buf.buf; } - void repo_copy(uint32_t revision, const uint32_t *src, const uint32_t *dst) -uint32_t repo_read_mode(const char *path) -{ - int err; - uint32_t result; - static struct strbuf dummy = STRBUF_INIT; - - strbuf_reset(&dummy); - err = fast_export_ls(path, &result, &dummy); - if (err) { - if (errno != ENOENT) - die_errno("BUG: unexpected fast_export_ls error"); - /* Treat missing paths as directories. */ - return REPO_MODE_DIR; - } - return result; -} - + void repo_copy(uint32_t revision, const char *src, const char *dst) { int err; uint32_t mode; diff --cc vcs-svn/repo_tree.h index ce69fa7e5,44e6e8fab..889c6a3c9 --- a/vcs-svn/repo_tree.h +++ b/vcs-svn/repo_tree.h @@@ -8,16 -8,14 +8,13 @@@ struct strbuf #define REPO_MODE_EXE 0100755 #define REPO_MODE_LNK 0120000 - #define REPO_MAX_PATH_LEN 4096 - #define REPO_MAX_PATH_DEPTH 1000 - uint32_t next_blob_mark(void); - void repo_copy(uint32_t revision, const uint32_t *src, const uint32_t *dst); - void repo_add(uint32_t *path, uint32_t mode, uint32_t blob_mark); - const char *repo_read_path(const uint32_t *path, uint32_t *mode_out); - void repo_delete(uint32_t *path); + void repo_copy(uint32_t revision, const char *src, const char *dst); + void repo_add(const char *path, uint32_t mode, uint32_t blob_mark); -const char *repo_read_path(const char *path); -uint32_t repo_read_mode(const char *path); ++const char *repo_read_path(const char *path, uint32_t *mode_out); + void repo_delete(const char *path); void repo_commit(uint32_t revision, const char *author, - char *log, const char *uuid, const char *url, + const struct strbuf *log, const char *uuid, const char *url, long unsigned timestamp); void repo_diff(uint32_t r1, uint32_t r2); void repo_init(void); diff --cc vcs-svn/svndump.c index 35a8af3c9,363503d4e..11c59f18b --- a/vcs-svn/svndump.c +++ b/vcs-svn/svndump.c @@@ -11,9 -11,10 +11,8 @@@ #include "repo_tree.h" #include "fast_export.h" #include "line_buffer.h" - #include "string_pool.h" #include "strbuf.h" -#define REPORT_FILENO 3 - /* * Compare start of string to literal of equal length; * must be guarded by length test. @@@ -224,11 -229,10 +225,11 @@@ static void handle_node(void if (have_text || have_props || node_ctx.srcRev) die("invalid dump: deletion node has " "copyfrom info, text, or properties"); - repo_delete(node_ctx.dst); - return repo_delete(node_ctx.dst.buf); ++ repo_delete(node_ctx.dst.buf); + return; } if (node_ctx.action == NODEACT_REPLACE) { - repo_delete(node_ctx.dst); + repo_delete(node_ctx.dst.buf); node_ctx.action = NODEACT_ADD; } if (node_ctx.srcRev) { @@@ -248,7 -252,8 +249,7 @@@ old_data = NULL; } else if (node_ctx.action == NODEACT_CHANGE) { uint32_t mode; - old_data = repo_read_path(node_ctx.dst, &mode); - old_data = repo_read_path(node_ctx.dst.buf); - mode = repo_read_mode(node_ctx.dst.buf); ++ old_data = repo_read_path(node_ctx.dst.buf, &mode); if (mode == REPO_MODE_DIR && type != REPO_MODE_DIR) die("invalid dump: cannot modify a directory into a file"); if (mode != REPO_MODE_DIR && type == REPO_MODE_DIR)