repo_write_dirent(path, mode, blob_mark, 0);
}
-uint32_t repo_replace(uint32_t *path, uint32_t blob_mark)
+uint32_t repo_modify_path(uint32_t *path, uint32_t mode, uint32_t blob_mark)
{
- uint32_t mode = 0;
struct repo_dirent *src_dent;
src_dent = repo_read_dirent(active_commit, path);
- if (src_dent != NULL) {
- mode = src_dent->mode;
- repo_write_dirent(path, mode, blob_mark, 0);
- }
- return mode;
-}
-
-void repo_modify(uint32_t *path, uint32_t mode, uint32_t blob_mark)
-{
- struct repo_dirent *src_dent;
- src_dent = repo_read_dirent(active_commit, path);
- if (src_dent != NULL && blob_mark == 0)
+ if (!src_dent)
+ return 0;
+ if (!blob_mark)
blob_mark = src_dent->content_offset;
+ if (!mode)
+ mode = src_dent->mode;
repo_write_dirent(path, mode, blob_mark, 0);
+ return mode;
}
void repo_delete(uint32_t *path)
uint32_t next_blob_mark(void);
uint32_t repo_copy(uint32_t revision, uint32_t *src, uint32_t *dst);
void repo_add(uint32_t *path, uint32_t mode, uint32_t blob_mark);
-uint32_t repo_replace(uint32_t *path, uint32_t blob_mark);
-void repo_modify(uint32_t *path, uint32_t mode, uint32_t blob_mark);
+uint32_t repo_modify_path(uint32_t *path, uint32_t mode, uint32_t blob_mark);
void repo_delete(uint32_t *path);
void repo_commit(uint32_t revision, uint32_t author, char *log, uint32_t uuid,
uint32_t url, long unsigned timestamp);
if (node_ctx.action == NODEACT_CHANGE) {
if (have_props)
- repo_modify(node_ctx.dst, node_ctx.type, mark);
+ repo_modify_path(node_ctx.dst, node_ctx.type, mark);
else if (mark)
- old_mode = repo_replace(node_ctx.dst, mark);
+ old_mode = repo_modify_path(node_ctx.dst, 0, mark);
} else if (node_ctx.action == NODEACT_ADD) {
if (node_ctx.srcRev && have_props)
- repo_modify(node_ctx.dst, node_ctx.type, mark);
+ repo_modify_path(node_ctx.dst, node_ctx.type, mark);
else if (node_ctx.srcRev && mark)
- old_mode = repo_replace(node_ctx.dst, mark);
+ old_mode = repo_modify_path(node_ctx.dst, 0, mark);
else if ((node_ctx.type == REPO_MODE_DIR && !node_ctx.srcRev) ||
mark)
repo_add(node_ctx.dst, node_ctx.type, mark);