Inconsistent meaning of delete_unversioned_target in WC
From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Thu, 22 Nov 2012 22:49:22 +0000 (GMT)
The attached patch factors out some code, but it reveals an inconsistency.
In svn_wc__delete_many(), an unversioned target is handled as:
if (delete_unversioned_target && !keep_local):
Delete it.
Continue successfully.
In svn_wc__delete_internal() -- the single-file variant -- an unversioned target is handled as:
if (delete_unversioned_target):
Delete it if !keep_local. Return successfully.
else:
Return the 'unversioned' error.
The difference is, if a target is unversioned and delete_unversioned_target is FALSE, __delete_many will continue whereas __delete_internal will throw an error.
Documentation is found on svn_wc_delete4():
* If @a delete_unversioned_target is TRUE and @a local_abspath is not
* versioned, @a local_abspath will be handled as an added files without
* history. So it will be deleted if @a keep_local is FALSE. If @a
* delete_unversioned is FALSE and @a local_abspath is not versioned a
* #SVN_ERR_WC_PATH_NOT_FOUND error will be returned.
(The two private API's don't document anything about this.)
According to that doc string, __delete_many is wrong.
This version of the patch selects the __delete_internal variant ("throw an error"), and many tests fail. That suggests thatin some cases we are expecting the opposite behaviour.
So what do we want to do?
- Julian
--
Certified & Supported Apache Subversion Downloads: http://www.wandisco.com/subversion/download
|
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.