Skip to content

Commit

Permalink
Handle directory replacements correctly.
Browse files Browse the repository at this point in the history
It appears that the svn semantics for a directory replace are equivalent
to a delete and add blank directory.
Fixed both implementations to reflect this.

Signed-off-by: David Barr <david.barr@cordelta.com>
  • Loading branch information
barrbrain committed May 28, 2010
1 parent 6e92fe9 commit c373b4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions replay.pl
Expand Up @@ -57,6 +57,8 @@
}

if ($root->is_dir($file, $pool) ) {
my $path = substr($file, 1);
print $commitlog "D $path\n";
modifydir($root, $file, $pool);
} else {
modifyfile($root, $file, $pool);
Expand Down
5 changes: 4 additions & 1 deletion svndump.c
Expand Up @@ -172,7 +172,10 @@ static void handle_node(void)
repo_delete(node_ctx.dst);
} else if (node_ctx.action == NODEACT_CHANGE ||
node_ctx.action == NODEACT_REPLACE) {
if (node_ctx.propLength != LENGTH_UNKNOWN) {
if (node_ctx.action == NODEACT_REPLACE &&
node_ctx.type == REPO_MODE_DIR) {
repo_replace(node_ctx.dst, node_ctx.mark);
} else if (node_ctx.propLength != LENGTH_UNKNOWN ) {
repo_modify(node_ctx.dst, node_ctx.type, node_ctx.mark);
} else if (node_ctx.textLength != LENGTH_UNKNOWN) {
node_ctx.srcMode = repo_replace(node_ctx.dst, node_ctx.mark);
Expand Down

0 comments on commit c373b4b

Please sign in to comment.