diff options
Diffstat (limited to 'subversion/libsvn_wc/ambient_depth_filter_editor.c')
-rw-r--r-- | subversion/libsvn_wc/ambient_depth_filter_editor.c | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/subversion/libsvn_wc/ambient_depth_filter_editor.c b/subversion/libsvn_wc/ambient_depth_filter_editor.c index d8ebc75..ff9a5c3 100644 --- a/subversion/libsvn_wc/ambient_depth_filter_editor.c +++ b/subversion/libsvn_wc/ambient_depth_filter_editor.c @@ -113,11 +113,15 @@ struct dir_baton void *wrapped_baton; }; -/* Helper to call either svn_wc__db_base_get_info or svn_wc__db_read_info for - obtaining information for the ambient depth editor */ +/* Fetch the STATUS, KIND and DEPTH of the base node at LOCAL_ABSPATH. + * If there is no such base node, report 'normal', 'unknown' and 'unknown' + * respectively. + * + * STATUS and/or DEPTH may be NULL if not wanted; KIND must not be NULL. + */ static svn_error_t * ambient_read_info(svn_wc__db_status_t *status, - svn_wc__db_kind_t *kind, + svn_node_kind_t *kind, svn_depth_t *depth, svn_wc__db_t *db, const char *local_abspath, @@ -128,7 +132,7 @@ ambient_read_info(svn_wc__db_status_t *status, err = svn_wc__db_base_get_info(status, kind, NULL, NULL, NULL, NULL, NULL, NULL, NULL, depth, NULL, NULL, - NULL, NULL, NULL, + NULL, NULL, NULL, NULL, db, local_abspath, scratch_pool, scratch_pool); @@ -136,7 +140,7 @@ ambient_read_info(svn_wc__db_status_t *status, { svn_error_clear(err); - *kind = svn_wc__db_kind_unknown; + *kind = svn_node_unknown; if (status) *status = svn_wc__db_status_normal; if (depth) @@ -186,7 +190,7 @@ make_dir_baton(struct dir_baton **d_p, { svn_boolean_t exclude; svn_wc__db_status_t status; - svn_wc__db_kind_t kind; + svn_node_kind_t kind; svn_boolean_t exists = TRUE; if (!added) @@ -197,10 +201,10 @@ make_dir_baton(struct dir_baton **d_p, else { status = svn_wc__db_status_not_present; - kind = svn_wc__db_kind_unknown; + kind = svn_node_unknown; } - exists = (kind != svn_wc__db_kind_unknown); + exists = (kind != svn_node_unknown); if (pb->ambient_depth == svn_depth_empty || pb->ambient_depth == svn_depth_files) @@ -246,7 +250,7 @@ make_file_baton(struct file_baton **f_p, struct file_baton *f = apr_pcalloc(pool, sizeof(*f)); struct edit_baton *eb = pb->edit_baton; svn_wc__db_status_t status; - svn_wc__db_kind_t kind; + svn_node_kind_t kind; const char *abspath; SVN_ERR_ASSERT(path); @@ -268,7 +272,7 @@ make_file_baton(struct file_baton **f_p, else { status = svn_wc__db_status_not_present; - kind = svn_wc__db_kind_unknown; + kind = svn_node_unknown; } if (pb->ambient_depth == svn_depth_empty) @@ -281,7 +285,7 @@ make_file_baton(struct file_baton **f_p, if (status == svn_wc__db_status_not_present || status == svn_wc__db_status_server_excluded || status == svn_wc__db_status_excluded - || kind == svn_wc__db_kind_unknown) + || kind == svn_node_unknown) { f->ambiently_excluded = TRUE; *f_p = f; @@ -308,7 +312,7 @@ make_file_baton(struct file_baton **f_p, /*** Editor Functions ***/ -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * set_target_revision(void *edit_baton, svn_revnum_t target_revision, @@ -321,7 +325,7 @@ set_target_revision(void *edit_baton, target_revision, pool); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * open_root(void *edit_baton, svn_revnum_t base_revision, @@ -340,7 +344,7 @@ open_root(void *edit_baton, if (! *eb->target) { /* For an update with a NULL target, this is equivalent to open_dir(): */ - svn_wc__db_kind_t kind; + svn_node_kind_t kind; svn_wc__db_status_t status; svn_depth_t depth; @@ -349,7 +353,7 @@ open_root(void *edit_baton, eb->db, eb->anchor_abspath, pool)); - if (kind != svn_wc__db_kind_unknown + if (kind != svn_node_unknown && status != svn_wc__db_status_not_present && status != svn_wc__db_status_excluded && status != svn_wc__db_status_server_excluded) @@ -362,7 +366,7 @@ open_root(void *edit_baton, pool, &b->wrapped_baton); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * delete_entry(const char *path, svn_revnum_t base_revision, @@ -380,7 +384,7 @@ delete_entry(const char *path, /* If the entry we want to delete doesn't exist, that's OK. It's probably an old server that doesn't understand depths. */ - svn_wc__db_kind_t kind; + svn_node_kind_t kind; svn_wc__db_status_t status; const char *abspath; @@ -389,7 +393,7 @@ delete_entry(const char *path, SVN_ERR(ambient_read_info(&status, &kind, NULL, eb->db, abspath, pool)); - if (kind == svn_wc__db_kind_unknown + if (kind == svn_node_unknown || status == svn_wc__db_status_not_present || status == svn_wc__db_status_excluded || status == svn_wc__db_status_server_excluded) @@ -400,7 +404,7 @@ delete_entry(const char *path, pb->wrapped_baton, pool); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * add_directory(const char *path, void *parent_baton, @@ -446,7 +450,7 @@ add_directory(const char *path, pool, &b->wrapped_baton); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * open_directory(const char *path, void *parent_baton, @@ -458,7 +462,7 @@ open_directory(const char *path, struct edit_baton *eb = pb->edit_baton; struct dir_baton *b; const char *local_abspath; - svn_wc__db_kind_t kind; + svn_node_kind_t kind; svn_wc__db_status_t status; svn_depth_t depth; @@ -480,7 +484,7 @@ open_directory(const char *path, SVN_ERR(ambient_read_info(&status, &kind, &depth, eb->db, local_abspath, pool)); - if (kind != svn_wc__db_kind_unknown + if (kind != svn_node_unknown && status != svn_wc__db_status_not_present && status != svn_wc__db_status_excluded && status != svn_wc__db_status_server_excluded) @@ -491,7 +495,7 @@ open_directory(const char *path, return SVN_NO_ERROR; } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * add_file(const char *path, void *parent_baton, @@ -515,7 +519,7 @@ add_file(const char *path, pool, &b->wrapped_baton); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * open_file(const char *path, void *parent_baton, @@ -537,7 +541,7 @@ open_file(const char *path, &b->wrapped_baton); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * apply_textdelta(void *file_baton, const char *base_checksum, @@ -561,7 +565,7 @@ apply_textdelta(void *file_baton, handler, handler_baton); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * close_file(void *file_baton, const char *text_checksum, @@ -577,7 +581,7 @@ close_file(void *file_baton, text_checksum, pool); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * absent_file(const char *path, void *parent_baton, @@ -592,7 +596,7 @@ absent_file(const char *path, return eb->wrapped_editor->absent_file(path, pb->wrapped_baton, pool); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * close_directory(void *dir_baton, apr_pool_t *pool) @@ -606,7 +610,7 @@ close_directory(void *dir_baton, return eb->wrapped_editor->close_directory(db->wrapped_baton, pool); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * absent_directory(const char *path, void *parent_baton, @@ -622,7 +626,7 @@ absent_directory(const char *path, return eb->wrapped_editor->absent_directory(path, pb->wrapped_baton, pool); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * change_file_prop(void *file_baton, const char *name, @@ -639,7 +643,7 @@ change_file_prop(void *file_baton, name, value, pool); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * change_dir_prop(void *dir_baton, const char *name, @@ -656,7 +660,7 @@ change_dir_prop(void *dir_baton, name, value, pool); } -/* */ +/* An svn_delta_editor_t function. */ static svn_error_t * close_edit(void *edit_baton, apr_pool_t *pool) |