2 * revision_status.c: report the revision range and status of a working copy
4 * ====================================================================
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
21 * ====================================================================
25 #include "svn_dirent_uri.h"
30 #include "private/svn_wc_private.h"
32 #include "svn_private_config.h"
35 svn_wc_revision_status2(svn_wc_revision_status_t **result_p,
36 svn_wc_context_t *wc_ctx,
37 const char *local_abspath,
38 const char *trail_url,
39 svn_boolean_t committed,
40 svn_cancel_func_t cancel_func,
42 apr_pool_t *result_pool,
43 apr_pool_t *scratch_pool)
45 svn_wc_revision_status_t *result = apr_pcalloc(result_pool, sizeof(*result));
49 SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
51 /* set result as nil */
52 result->min_rev = SVN_INVALID_REVNUM;
53 result->max_rev = SVN_INVALID_REVNUM;
54 result->switched = FALSE;
55 result->modified = FALSE;
56 result->sparse_checkout = FALSE;
58 SVN_ERR(svn_wc__db_revision_status(&result->min_rev, &result->max_rev,
59 &result->sparse_checkout,
62 wc_ctx->db, local_abspath, trail_url,
66 if (!result->modified)
67 SVN_ERR(svn_wc__node_has_local_mods(&result->modified, NULL,
68 wc_ctx->db, local_abspath, TRUE,
69 cancel_func, cancel_baton,