Permalink
Browse files

Handle directory replacements correctly.

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 c373b4bcf59a1fcf4f75425c16a7c5a542abd227
Showing with 6 additions and 1 deletion.
  1. +2 −0 replay.pl
  2. +4 −1 svndump.c
View
@@ -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);
View
@@ -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);

0 comments on commit c373b4b

Please sign in to comment.