Skip to content

Commit

Permalink
Resolve file mode issue.
Browse files Browse the repository at this point in the history
File modes were not being updated when executable bits toggled.
There were three causes in play:
The handle_node() code did nothing in this case.
repo_modify() needed to be extended so that the blob is optional.
The diff implementation wasn't checking mode.

Signed-off-by: David Barr <david.barr@cordelta.com>
  • Loading branch information
barrbrain committed May 27, 2010
1 parent c486301 commit 6e92fe9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 7 additions & 1 deletion repo_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ uint32_t repo_replace(uint32_t *path, uint32_t blob_mark)

void repo_modify(uint32_t *path, uint32_t mode, uint32_t blob_mark)
{
repo_dirent_t *src_dirent;
src_dirent = repo_read_dirent(active_commit, path);
if (src_dirent != NULL && blob_mark == 0) {
blob_mark = src_dirent->content_offset;
}
repo_write_dirent(path, mode, blob_mark, 0);
}

Expand Down Expand Up @@ -258,7 +263,8 @@ repo_diff_r(uint32_t depth, uint32_t *path, repo_dir_t *dir1,
fast_export_delete(depth + 1, path);
} else if (de1->name_offset == de2->name_offset) {
path[depth] = de1->name_offset;
if (de1->content_offset != de2->content_offset) {
if (de1->mode != de2->mode ||
de1->content_offset != de2->content_offset) {
if (repo_dirent_is_dir(de1) && repo_dirent_is_dir(de2)) {
repo_diff_r(depth + 1, path,
repo_dir_from_dirent(de1),
Expand Down
11 changes: 3 additions & 8 deletions svndump.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,9 @@ static void read_props(void)
strptime(val, "%FT%T", &tm);
rev_ctx.timestamp = mkgmtime(&tm);
} else if (key == keys.svn_executable) {
if (node_ctx.type == REPO_MODE_BLB) {
node_ctx.type = REPO_MODE_EXE;
}
node_ctx.type = REPO_MODE_EXE;
} else if (key == keys.svn_special) {
if (node_ctx.type == REPO_MODE_BLB) {
node_ctx.type = REPO_MODE_LNK;
}
node_ctx.type = REPO_MODE_LNK;
}
key = ~0;
buffer_read_line();
Expand Down Expand Up @@ -176,8 +172,7 @@ 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 &&
node_ctx.textLength != LENGTH_UNKNOWN) {
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 6e92fe9

Please sign in to comment.