You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by eh...@apache.org on 2010/10/21 22:26:30 UTC
svn commit: r1026128 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c
Author: ehu
Date: Thu Oct 21 20:26:30 2010
New Revision: 1026128
URL: http://svn.apache.org/viewvc?rev=1026128&view=rev
Log:
* subversion/libsvn_wc/adm_ops.c
(revert_internal): More safety checks after last week's cleanup.
Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c
Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1026128&r1=1026127&r2=1026128&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Thu Oct 21 20:26:30 2010
@@ -1336,6 +1336,7 @@ revert_internal(svn_wc__db_t *db,
svn_boolean_t unversioned;
svn_boolean_t have_base;
svn_boolean_t replaced;
+ svn_boolean_t reverted = FALSE;
const svn_wc_conflict_description2_t *tree_conflict;
const char *op_root_abspath = NULL;
svn_error_t *err;
@@ -1432,8 +1433,13 @@ revert_internal(svn_wc__db_t *db,
svn_dirent_local_style(local_abspath, pool));
/* Safeguard 3: can we deal with the node kind of PATH currently in
- the working copy? */
- if ((disk_kind != svn_node_none)
+ the working copy?
+
+ Note: we can reach this point for paths which have tree conflict info
+ set on them. Those are not necessarily nodes we can version,
+ meaning this check doesn't make sense for unversioned nodes. */
+ if (!unversioned
+ && (disk_kind != svn_node_none)
&& (disk_kind != svn_node_file)
&& (disk_kind != svn_node_dir))
return svn_error_createf
@@ -1441,13 +1447,14 @@ revert_internal(svn_wc__db_t *db,
_("Cannot revert '%s': unsupported node kind in working copy"),
svn_dirent_local_style(local_abspath, pool));
- if (status == svn_wc__db_status_added)
+ if (!unversioned && status == svn_wc__db_status_added)
SVN_ERR(svn_wc__db_scan_addition(NULL, &op_root_abspath, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
db, local_abspath, pool, pool));
/* Safeguard 4: Make sure we don't revert deeper then asked */
- if (status == svn_wc__db_status_added
+ if (!unversioned
+ && status == svn_wc__db_status_added
&& db_kind == svn_wc__db_kind_dir
&& depth >= svn_depth_empty
&& depth < svn_depth_infinity)
@@ -1463,7 +1470,6 @@ revert_internal(svn_wc__db_t *db,
if (svn_wc__internal_changelist_match(db, local_abspath, changelist_hash,
pool))
{
- svn_boolean_t reverted = FALSE;
const svn_wc_conflict_description2_t *conflict;
/* Clear any tree conflict on the path, even if it is not a versioned
@@ -1612,10 +1618,12 @@ revert_internal(svn_wc__db_t *db,
svn_pool_destroy(iterpool);
}
- if (! replaced && status == svn_wc__db_status_added
+ if (reverted
+ && ! replaced
+ && status == svn_wc__db_status_added
&& db_kind == svn_wc__db_kind_dir)
{
- /* Non-replacements have their admin area deleted. wc-1.0 */
+ /* Non-replaced directories have their admin area deleted. wc-1.0 */
SVN_ERR(svn_wc__adm_destroy(db, local_abspath,
cancel_func, cancel_baton, pool));
}
Re: svn commit: r1026128 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c
Posted by Erik Huelsmann <eh...@gmail.com>.
>> - if (! replaced && status == svn_wc__db_status_added
>> + if (reverted
>> + && ! replaced
>> + && status == svn_wc__db_status_added
>> && db_kind == svn_wc__db_kind_dir)
>> {
>> - /* Non-replacements have their admin area deleted. wc-1.0 */
>> + /* Non-replaced directories have their admin area deleted. wc-
>> 1.0 */
>> SVN_ERR(svn_wc__adm_destroy(db, local_abspath,
>> cancel_func, cancel_baton, pool));
>> }
>>
>
> I don't think we need this block with single-db. There is no administrative area to remove.
This call also destroys the adm-access which may be cached in the
db-handle. Removing that call makes one of our 'we should work with
our old entries code' tests fail. Maybe the comment should state
something to that effect?
Bye,
Erik.
RE: svn commit: r1026128 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c
Posted by Bert Huijben <be...@qqmail.nl>.
> -----Original Message-----
> From: ehu@apache.org [mailto:ehu@apache.org]
> Sent: donderdag 21 oktober 2010 22:27
> To: commits@subversion.apache.org
> Subject: svn commit: r1026128 -
> /subversion/trunk/subversion/libsvn_wc/adm_ops.c
>
> Author: ehu
> Date: Thu Oct 21 20:26:30 2010
> New Revision: 1026128
>
> URL: http://svn.apache.org/viewvc?rev=1026128&view=rev
> Log:
> * subversion/libsvn_wc/adm_ops.c
> (revert_internal): More safety checks after last week's cleanup.
>
> Modified:
> subversion/trunk/subversion/libsvn_wc/adm_ops.c
>
> Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_
> ops.c?rev=1026128&r1=1026127&r2=1026128&view=diff
> =======================================================================
> =======
> --- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Thu Oct 21 20:26:30
> 2010
<snip>
> @@ -1612,10 +1618,12 @@ revert_internal(svn_wc__db_t *db,
> svn_pool_destroy(iterpool);
> }
>
> - if (! replaced && status == svn_wc__db_status_added
> + if (reverted
> + && ! replaced
> + && status == svn_wc__db_status_added
> && db_kind == svn_wc__db_kind_dir)
> {
> - /* Non-replacements have their admin area deleted. wc-1.0 */
> + /* Non-replaced directories have their admin area deleted. wc-
> 1.0 */
> SVN_ERR(svn_wc__adm_destroy(db, local_abspath,
> cancel_func, cancel_baton, pool));
> }
>
I don't think we need this block with single-db. There is no administrative area to remove.
Bert
RE: svn commit: r1026128 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c
Posted by Bert Huijben <be...@qqmail.nl>.
> -----Original Message-----
> From: ehu@apache.org [mailto:ehu@apache.org]
> Sent: donderdag 21 oktober 2010 22:27
> To: commits@subversion.apache.org
> Subject: svn commit: r1026128 -
> /subversion/trunk/subversion/libsvn_wc/adm_ops.c
>
> Author: ehu
> Date: Thu Oct 21 20:26:30 2010
> New Revision: 1026128
>
> URL: http://svn.apache.org/viewvc?rev=1026128&view=rev
> Log:
> * subversion/libsvn_wc/adm_ops.c
> (revert_internal): More safety checks after last week's cleanup.
>
> Modified:
> subversion/trunk/subversion/libsvn_wc/adm_ops.c
>
> Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_
> ops.c?rev=1026128&r1=1026127&r2=1026128&view=diff
> =======================================================================
> =======
> --- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Thu Oct 21 20:26:30
> 2010
<snip>
> @@ -1612,10 +1618,12 @@ revert_internal(svn_wc__db_t *db,
> svn_pool_destroy(iterpool);
> }
>
> - if (! replaced && status == svn_wc__db_status_added
> + if (reverted
> + && ! replaced
> + && status == svn_wc__db_status_added
> && db_kind == svn_wc__db_kind_dir)
> {
> - /* Non-replacements have their admin area deleted. wc-1.0 */
> + /* Non-replaced directories have their admin area deleted. wc-
> 1.0 */
> SVN_ERR(svn_wc__adm_destroy(db, local_abspath,
> cancel_func, cancel_baton, pool));
> }
>
I don't think we need this block with single-db. There is no administrative area to remove.
Bert