diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2017-08-23 02:04:47 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-23 19:41:26 +0200 |
commit | b8f43b120b4d7bd0638eb072f8527c5a33a70579 (patch) | |
tree | 6f39ec3a42a13afad2f5262a7462b59429740e41 /vcs-svn/svndump.c | |
parent | vcs-svn: remove repo_delete wrapper function (diff) | |
download | git-b8f43b120b4d7bd0638eb072f8527c5a33a70579.tar.xz git-b8f43b120b4d7bd0638eb072f8527c5a33a70579.zip |
vcs-svn: move remaining repo_tree functions to fast_export.h
These used to be for manipulating the in-memory repo_tree structure,
but nowadays they are convenience wrappers to handle a few git-vs-svn
mismatches:
1. Git does not track empty directories but Subversion does. When
looking up a path in git that Subversion thinks exists and finding
nothing, we can safely assume that the path represents a
directory. This is needed when a later Subversion revision
modifies that directory.
2. Subversion allows deleting a file by copying. In Git fast-import
we have to handle that more explicitly as a deletion.
These are details of the tool's interaction with git fast-import.
Move them to fast_export.c, where other such details are handled.
This way the function names do not start with a repo_ prefix that
would clash with the repository object introduced in
v2.14.0-rc0~38^2~16 (repository: introduce the repository object,
2017-06-22) or an svn_ prefix that would clash with libsvn (in case
someone wants to link this code with libsvn some day).
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | vcs-svn/svndump.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c index 41113119bd..01b6ded400 100644 --- a/vcs-svn/svndump.c +++ b/vcs-svn/svndump.c @@ -8,7 +8,6 @@ */ #include "cache.h" -#include "repo_tree.h" #include "fast_export.h" #include "line_buffer.h" #include "strbuf.h" @@ -233,7 +232,7 @@ static void handle_node(void) node_ctx.action = NODEACT_ADD; } if (node_ctx.srcRev) { - svn_repo_copy(node_ctx.srcRev, node_ctx.src.buf, node_ctx.dst.buf); + fast_export_copy(node_ctx.srcRev, node_ctx.src.buf, node_ctx.dst.buf); if (node_ctx.action == NODEACT_ADD) node_ctx.action = NODEACT_CHANGE; } @@ -249,7 +248,7 @@ static void handle_node(void) old_data = NULL; } else if (node_ctx.action == NODEACT_CHANGE) { uint32_t mode; - old_data = svn_repo_read_path(node_ctx.dst.buf, &mode); + old_data = fast_export_read_path(node_ctx.dst.buf, &mode); if (mode == S_IFDIR && type != S_IFDIR) die("invalid dump: cannot modify a directory into a file"); if (mode != S_IFDIR && type == S_IFDIR) |