104
84
svn_wc__node_get_children_of_working_node(const apr_array_header_t **children,
105
85
svn_wc_context_t *wc_ctx,
106
86
const char *dir_abspath,
107
svn_boolean_t show_hidden,
108
87
apr_pool_t *result_pool,
109
88
apr_pool_t *scratch_pool)
111
const apr_array_header_t *rel_children;
90
const apr_array_header_t *child_names;
113
SVN_ERR(svn_wc__db_read_children_of_working_node(&rel_children,
92
SVN_ERR(svn_wc__db_read_children_of_working_node(&child_names,
114
93
wc_ctx->db, dir_abspath,
115
94
scratch_pool, scratch_pool));
116
SVN_ERR(filter_and_make_absolute(children, wc_ctx, dir_abspath,
117
rel_children, show_hidden,
118
result_pool, scratch_pool));
95
make_absolute(children, dir_abspath, child_names, result_pool);
100
svn_wc__node_get_not_present_children(const apr_array_header_t **children,
101
svn_wc_context_t *wc_ctx,
102
const char *dir_abspath,
103
apr_pool_t *result_pool,
104
apr_pool_t *scratch_pool)
106
const apr_array_header_t *child_names;
108
SVN_ERR(svn_wc__db_base_read_not_present_children(
110
wc_ctx->db, dir_abspath,
111
scratch_pool, scratch_pool));
112
make_absolute(children, dir_abspath, child_names, result_pool);
123
svn_wc__node_get_children(const apr_array_header_t **children,
124
svn_wc_context_t *wc_ctx,
125
const char *dir_abspath,
126
svn_boolean_t show_hidden,
127
apr_pool_t *result_pool,
128
apr_pool_t *scratch_pool)
130
const apr_array_header_t *rel_children;
132
SVN_ERR(svn_wc__db_read_children(&rel_children, wc_ctx->db, dir_abspath,
133
scratch_pool, scratch_pool));
134
SVN_ERR(filter_and_make_absolute(children, wc_ctx, dir_abspath,
135
rel_children, show_hidden,
136
result_pool, scratch_pool));
142
svn_wc__internal_get_repos_info(svn_revnum_t *revision,
143
const char **repos_relpath,
144
const char **repos_root_url,
145
const char **repos_uuid,
147
const char *local_abspath,
148
apr_pool_t *result_pool,
149
apr_pool_t *scratch_pool)
151
svn_wc__db_status_t status;
152
svn_boolean_t have_work;
154
SVN_ERR(svn_wc__db_read_info(&status, NULL, revision, repos_relpath,
155
repos_root_url, repos_uuid,
156
NULL, NULL, NULL, NULL, NULL, NULL,
157
NULL, NULL, NULL, NULL, NULL, NULL,
158
NULL, NULL, NULL, NULL, NULL, NULL,
159
NULL, NULL, &have_work,
161
result_pool, scratch_pool));
163
if ((repos_relpath ? *repos_relpath != NULL : TRUE)
164
&& (repos_root_url ? *repos_root_url != NULL: TRUE)
165
&& (repos_uuid ? *repos_uuid != NULL : TRUE))
166
return SVN_NO_ERROR; /* We got the requested information */
168
if (!have_work) /* not-present, (server-)excluded? */
170
return SVN_NO_ERROR; /* Can't fetch more */
173
if (status == svn_wc__db_status_deleted)
175
const char *base_del_abspath, *wrk_del_abspath;
177
SVN_ERR(svn_wc__db_scan_deletion(&base_del_abspath, NULL,
178
&wrk_del_abspath, NULL,
180
scratch_pool, scratch_pool));
182
if (base_del_abspath)
184
SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, NULL, repos_relpath,
185
repos_root_url, repos_uuid, NULL,
186
NULL, NULL, NULL, NULL, NULL, NULL,
188
db, base_del_abspath,
189
result_pool, scratch_pool));
191
/* If we have a repos_relpath, it is of the op-root */
193
*repos_relpath = svn_relpath_join(*repos_relpath,
194
svn_dirent_skip_ancestor(base_del_abspath,
197
/* We keep revision as SVN_INVALID_REVNUM */
199
else if (wrk_del_abspath)
201
const char *op_root_abspath = NULL;
203
SVN_ERR(svn_wc__db_scan_addition(NULL, repos_relpath
204
? &op_root_abspath : NULL,
205
repos_relpath, repos_root_url,
206
repos_uuid, NULL, NULL, NULL, NULL,
207
db, svn_dirent_dirname(
210
result_pool, scratch_pool));
212
/* If we have a repos_relpath, it is of the op-root */
214
*repos_relpath = svn_relpath_join(
216
svn_dirent_skip_ancestor(op_root_abspath,
221
else /* added, or WORKING incomplete */
223
const char *op_root_abspath = NULL;
225
/* We have an addition. scan_addition() will find the intended
226
repository location by scanning up the tree. */
227
SVN_ERR(svn_wc__db_scan_addition(NULL, repos_relpath
228
? &op_root_abspath : NULL,
229
repos_relpath, repos_root_url,
230
repos_uuid, NULL, NULL, NULL, NULL,
118
svn_wc__node_get_repos_info(svn_revnum_t *revision,
119
const char **repos_relpath,
120
const char **repos_root_url,
121
const char **repos_uuid,
122
svn_wc_context_t *wc_ctx,
123
const char *local_abspath,
124
apr_pool_t *result_pool,
125
apr_pool_t *scratch_pool)
127
return svn_error_trace(
128
svn_wc__db_read_repos_info(revision,
132
wc_ctx->db, local_abspath,
232
133
result_pool, scratch_pool));
235
SVN_ERR_ASSERT(repos_root_url == NULL || *repos_root_url != NULL);
236
SVN_ERR_ASSERT(repos_uuid == NULL || *repos_uuid != NULL);
241
svn_wc__node_get_repos_info(svn_revnum_t *revision,
242
const char **repos_relpath,
243
const char **repos_root_url,
244
const char **repos_uuid,
245
svn_wc_context_t *wc_ctx,
246
const char *local_abspath,
247
apr_pool_t *result_pool,
248
apr_pool_t *scratch_pool)
250
return svn_error_trace(
251
svn_wc__internal_get_repos_info(revision,
255
wc_ctx->db, local_abspath,
256
result_pool, scratch_pool));
259
136
/* Convert DB_KIND into the appropriate NODE_KIND value.
326
svn_wc__node_get_depth(svn_depth_t *depth,
327
svn_wc_context_t *wc_ctx,
328
const char *local_abspath,
329
apr_pool_t *scratch_pool)
331
return svn_error_trace(
332
svn_wc__db_read_info(NULL, NULL, NULL, NULL, NULL, NULL, NULL,
333
NULL, NULL, depth, NULL, NULL, NULL, NULL,
334
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
335
NULL, NULL, NULL, NULL, NULL, NULL,
336
wc_ctx->db, local_abspath, scratch_pool,
341
203
svn_wc__node_get_changed_info(svn_revnum_t *changed_rev,
342
204
apr_time_t *changed_date,
343
205
const char **changed_author,
501
373
SVN_ERR(svn_wc__db_read_info(&status, &db_kind, NULL, NULL, NULL, NULL,
502
374
NULL, NULL, NULL, NULL, NULL, NULL,
503
375
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
504
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
376
changelist_hash ? &changelist : NULL,
377
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
505
378
db, local_abspath, scratch_pool, scratch_pool));
507
380
SVN_ERR(convert_db_kind_to_node_kind(&kind, db_kind, status, show_hidden));
509
if (svn_wc__internal_changelist_match(db, local_abspath,
510
changelist_hash, scratch_pool))
511
SVN_ERR(walk_callback(local_abspath, kind, walk_baton, scratch_pool));
383
|| (changelist && svn_hash_gets(changelist_hash, changelist)))
385
SVN_ERR(walk_callback(local_abspath, kind, walk_baton, scratch_pool));
513
388
if (db_kind == svn_node_file
514
389
|| status == svn_wc__db_status_not_present
534
svn_wc__node_is_status_deleted(svn_boolean_t *is_deleted,
535
svn_wc_context_t *wc_ctx,
536
const char *local_abspath,
537
apr_pool_t *scratch_pool)
539
svn_wc__db_status_t status;
541
SVN_ERR(svn_wc__db_read_info(&status,
542
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
543
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
544
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
545
NULL, NULL, NULL, NULL, NULL,
546
wc_ctx->db, local_abspath,
547
scratch_pool, scratch_pool));
549
*is_deleted = (status == svn_wc__db_status_deleted);
555
svn_wc__node_get_deleted_ancestor(const char **deleted_ancestor_abspath,
556
svn_wc_context_t *wc_ctx,
557
const char *local_abspath,
558
apr_pool_t *result_pool,
559
apr_pool_t *scratch_pool)
561
svn_wc__db_status_t status;
563
*deleted_ancestor_abspath = NULL;
565
SVN_ERR(svn_wc__db_read_info(&status,
566
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
567
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
568
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
569
NULL, NULL, NULL, NULL, NULL,
570
wc_ctx->db, local_abspath,
571
scratch_pool, scratch_pool));
573
if (status == svn_wc__db_status_deleted)
574
SVN_ERR(svn_wc__db_scan_deletion(deleted_ancestor_abspath, NULL, NULL,
575
NULL, wc_ctx->db, local_abspath,
576
result_pool, scratch_pool));
582
409
svn_wc__node_is_not_present(svn_boolean_t *is_not_present,
583
410
svn_boolean_t *is_excluded,
584
411
svn_boolean_t *is_server_excluded,
786
svn_wc__internal_node_get_schedule(svn_wc_schedule_t *schedule,
787
svn_boolean_t *copied,
789
const char *local_abspath,
790
apr_pool_t *scratch_pool)
792
svn_wc__db_status_t status;
793
svn_boolean_t op_root;
794
svn_boolean_t have_base;
795
svn_boolean_t have_work;
796
svn_boolean_t have_more_work;
797
const char *copyfrom_relpath;
800
*schedule = svn_wc_schedule_normal;
804
SVN_ERR(svn_wc__db_read_info(&status, NULL, NULL, NULL, NULL, NULL, NULL,
805
NULL, NULL, NULL, NULL, NULL, ©from_relpath,
806
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
807
&op_root, NULL, NULL,
808
&have_base, &have_more_work, &have_work,
809
db, local_abspath, scratch_pool, scratch_pool));
813
case svn_wc__db_status_not_present:
814
case svn_wc__db_status_server_excluded:
815
case svn_wc__db_status_excluded:
816
/* We used status normal in the entries world. */
818
*schedule = svn_wc_schedule_normal;
820
case svn_wc__db_status_normal:
821
case svn_wc__db_status_incomplete:
824
case svn_wc__db_status_deleted:
827
*schedule = svn_wc_schedule_delete;
832
if (have_more_work || !have_base)
836
const char *work_del_abspath;
838
/* Find out details of our deletion. */
839
SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
840
&work_del_abspath, NULL,
842
scratch_pool, scratch_pool));
844
if (work_del_abspath)
845
*copied = TRUE; /* Working deletion */
849
case svn_wc__db_status_added:
857
*schedule = svn_wc_schedule_normal;
863
*copied = (copyfrom_relpath != NULL);
866
*schedule = svn_wc_schedule_add;
870
/* Check for replaced */
871
if (have_base || have_more_work)
873
svn_wc__db_status_t below_working;
874
SVN_ERR(svn_wc__db_info_below_working(&have_base, &have_work,
879
/* If the node is not present or deleted (read: not present
880
in working), then the node is not a replacement */
881
if (below_working != svn_wc__db_status_not_present
882
&& below_working != svn_wc__db_status_deleted)
884
*schedule = svn_wc_schedule_replace;
891
SVN_ERR_MALFUNCTION();
898
svn_wc__node_get_schedule(svn_wc_schedule_t *schedule,
899
svn_boolean_t *copied,
900
svn_wc_context_t *wc_ctx,
901
const char *local_abspath,
902
apr_pool_t *scratch_pool)
904
return svn_error_trace(
905
svn_wc__internal_node_get_schedule(schedule,
913
611
svn_wc__node_clear_dav_cache_recursive(svn_wc_context_t *wc_ctx,
914
612
const char *local_abspath,
915
613
apr_pool_t *scratch_pool)
964
663
const char *original_repos_uuid;
965
664
svn_revnum_t original_revision;
966
665
svn_wc__db_status_t status;
666
svn_boolean_t have_more_work;
667
svn_boolean_t op_root;
968
669
const char *tmp_repos_relpath;
671
if (copy_root_abspath)
672
*copy_root_abspath = NULL;
970
673
if (!repos_relpath)
971
674
repos_relpath = &tmp_repos_relpath;
973
676
SVN_ERR(svn_wc__db_read_info(&status, NULL, revision, repos_relpath,
974
677
repos_root_url, repos_uuid, NULL, NULL, NULL,
976
679
&original_repos_relpath,
977
680
&original_repos_root_url,
978
681
&original_repos_uuid, &original_revision,
979
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
682
NULL, NULL, NULL, NULL, NULL, &op_root, NULL,
683
NULL, NULL, &have_more_work, is_copy,
981
684
db, local_abspath, result_pool, scratch_pool));
983
686
if (*repos_relpath)
1364
1067
apr_pool_t *result_pool,
1365
1068
apr_pool_t *scratch_pool)
1367
svn_boolean_t is_deleted;
1070
svn_wc__db_status_t status;
1369
1072
if (moved_to_abspath)
1370
1073
*moved_to_abspath = NULL;
1371
1074
if (op_root_abspath)
1372
1075
*op_root_abspath = NULL;
1374
SVN_ERR(svn_wc__node_is_status_deleted(&is_deleted, wc_ctx, local_abspath,
1077
SVN_ERR(svn_wc__db_read_info(&status,
1078
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1079
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1080
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1081
NULL, NULL, NULL, NULL, NULL,
1082
wc_ctx->db, local_abspath,
1083
scratch_pool, scratch_pool));
1085
if (status == svn_wc__db_status_deleted)
1377
1086
SVN_ERR(svn_wc__db_scan_deletion(NULL, moved_to_abspath, NULL,
1378
1087
op_root_abspath, wc_ctx->db,