Skip to content

Commit c373b4b

Browse files
committed
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>
1 parent 6e92fe9 commit c373b4b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

replay.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
}
5858

5959
if ($root->is_dir($file, $pool) ) {
60+
my $path = substr($file, 1);
61+
print $commitlog "D $path\n";
6062
modifydir($root, $file, $pool);
6163
} else {
6264
modifyfile($root, $file, $pool);

svndump.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ static void handle_node(void)
172172
repo_delete(node_ctx.dst);
173173
} else if (node_ctx.action == NODEACT_CHANGE ||
174174
node_ctx.action == NODEACT_REPLACE) {
175-
if (node_ctx.propLength != LENGTH_UNKNOWN) {
175+
if (node_ctx.action == NODEACT_REPLACE &&
176+
node_ctx.type == REPO_MODE_DIR) {
177+
repo_replace(node_ctx.dst, node_ctx.mark);
178+
} else if (node_ctx.propLength != LENGTH_UNKNOWN ) {
176179
repo_modify(node_ctx.dst, node_ctx.type, node_ctx.mark);
177180
} else if (node_ctx.textLength != LENGTH_UNKNOWN) {
178181
node_ctx.srcMode = repo_replace(node_ctx.dst, node_ctx.mark);

0 commit comments

Comments
 (0)