1251875Speter/* 2251875Speter * cleanup.c: wrapper around wc cleanup functionality. 3251875Speter * 4251875Speter * ==================================================================== 5251875Speter * Licensed to the Apache Software Foundation (ASF) under one 6251875Speter * or more contributor license agreements. See the NOTICE file 7251875Speter * distributed with this work for additional information 8251875Speter * regarding copyright ownership. The ASF licenses this file 9251875Speter * to you under the Apache License, Version 2.0 (the 10251875Speter * "License"); you may not use this file except in compliance 11251875Speter * with the License. You may obtain a copy of the License at 12251875Speter * 13251875Speter * http://www.apache.org/licenses/LICENSE-2.0 14251875Speter * 15251875Speter * Unless required by applicable law or agreed to in writing, 16251875Speter * software distributed under the License is distributed on an 17251875Speter * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18251875Speter * KIND, either express or implied. See the License for the 19251875Speter * specific language governing permissions and limitations 20251875Speter * under the License. 21251875Speter * ==================================================================== 22251875Speter */ 23251875Speter 24251875Speter/* ==================================================================== */ 25251875Speter 26251875Speter 27251875Speter 28251875Speter/*** Includes. ***/ 29251875Speter 30251875Speter#include "svn_time.h" 31251875Speter#include "svn_wc.h" 32251875Speter#include "svn_client.h" 33251875Speter#include "svn_config.h" 34251875Speter#include "svn_dirent_uri.h" 35251875Speter#include "svn_path.h" 36251875Speter#include "svn_pools.h" 37251875Speter#include "client.h" 38251875Speter#include "svn_props.h" 39251875Speter 40251875Speter#include "svn_private_config.h" 41251875Speter 42251875Speter 43251875Speter/*** Code. ***/ 44251875Speter 45251875Spetersvn_error_t * 46251875Spetersvn_client_cleanup(const char *path, 47251875Speter svn_client_ctx_t *ctx, 48251875Speter apr_pool_t *scratch_pool) 49251875Speter{ 50251875Speter const char *local_abspath; 51251875Speter svn_error_t *err; 52251875Speter 53251875Speter if (svn_path_is_url(path)) 54251875Speter return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL, 55251875Speter _("'%s' is not a local path"), path); 56251875Speter 57251875Speter SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool)); 58251875Speter 59251875Speter err = svn_wc_cleanup3(ctx->wc_ctx, local_abspath, ctx->cancel_func, 60251875Speter ctx->cancel_baton, scratch_pool); 61251875Speter svn_io_sleep_for_timestamps(path, scratch_pool); 62251875Speter return svn_error_trace(err); 63251875Speter} 64251875Speter