1251881Speter/* 2251881Speter * cleanup.c: wrapper around wc cleanup functionality. 3251881Speter * 4251881Speter * ==================================================================== 5251881Speter * Licensed to the Apache Software Foundation (ASF) under one 6251881Speter * or more contributor license agreements. See the NOTICE file 7251881Speter * distributed with this work for additional information 8251881Speter * regarding copyright ownership. The ASF licenses this file 9251881Speter * to you under the Apache License, Version 2.0 (the 10251881Speter * "License"); you may not use this file except in compliance 11251881Speter * with the License. You may obtain a copy of the License at 12251881Speter * 13251881Speter * http://www.apache.org/licenses/LICENSE-2.0 14251881Speter * 15251881Speter * Unless required by applicable law or agreed to in writing, 16251881Speter * software distributed under the License is distributed on an 17251881Speter * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18251881Speter * KIND, either express or implied. See the License for the 19251881Speter * specific language governing permissions and limitations 20251881Speter * under the License. 21251881Speter * ==================================================================== 22251881Speter */ 23251881Speter 24251881Speter/* ==================================================================== */ 25251881Speter 26251881Speter 27251881Speter 28251881Speter/*** Includes. ***/ 29251881Speter 30251881Speter#include "svn_time.h" 31251881Speter#include "svn_wc.h" 32251881Speter#include "svn_client.h" 33251881Speter#include "svn_config.h" 34251881Speter#include "svn_dirent_uri.h" 35251881Speter#include "svn_path.h" 36251881Speter#include "svn_pools.h" 37251881Speter#include "client.h" 38251881Speter#include "svn_props.h" 39251881Speter 40251881Speter#include "svn_private_config.h" 41251881Speter 42251881Speter 43251881Speter/*** Code. ***/ 44251881Speter 45251881Spetersvn_error_t * 46251881Spetersvn_client_cleanup(const char *path, 47251881Speter svn_client_ctx_t *ctx, 48251881Speter apr_pool_t *scratch_pool) 49251881Speter{ 50251881Speter const char *local_abspath; 51251881Speter svn_error_t *err; 52251881Speter 53251881Speter if (svn_path_is_url(path)) 54251881Speter return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL, 55251881Speter _("'%s' is not a local path"), path); 56251881Speter 57251881Speter SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool)); 58251881Speter 59251881Speter err = svn_wc_cleanup3(ctx->wc_ctx, local_abspath, ctx->cancel_func, 60251881Speter ctx->cancel_baton, scratch_pool); 61251881Speter svn_io_sleep_for_timestamps(path, scratch_pool); 62251881Speter return svn_error_trace(err); 63251881Speter} 64