Skip to content

Commit

Permalink
vcs-svn: Replace = Delete + Add
Browse files Browse the repository at this point in the history
Simplify by reducing the "Node-action: replace" case to "Node-action:
add".  This way, the main part of handle_node() only has to deal with
"add" and "change" nodes.

Functional change: replacing a symlink or executable without setting
properties will reset the mode.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Nov 24, 2010
1 parent 5af8fae commit 6ee4a9b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions vcs-svn/svndump.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ static void handle_node(void)
return repo_delete(node_ctx.dst);
}

if (node_ctx.action == NODEACT_REPLACE) {
repo_delete(node_ctx.dst);
node_ctx.action = NODEACT_ADD;
}

if (have_props && node_ctx.propLength)
read_props();

Expand All @@ -175,12 +180,8 @@ static void handle_node(void)
if (mark && node_ctx.type == REPO_MODE_DIR)
die("invalid dump: directories cannot have text attached");

if (node_ctx.action == NODEACT_CHANGE ||
node_ctx.action == NODEACT_REPLACE) {
if (node_ctx.action == NODEACT_REPLACE &&
node_ctx.type == REPO_MODE_DIR)
repo_replace(node_ctx.dst, mark);
else if (have_props)
if (node_ctx.action == NODEACT_CHANGE) {
if (have_props)
repo_modify(node_ctx.dst, node_ctx.type, mark);
else if (mark)
old_mode = repo_replace(node_ctx.dst, mark);
Expand Down

0 comments on commit 6ee4a9b

Please sign in to comment.