This breaks copy_tests 33.
With regards
Kamesh Jayachandran
-----Original Message-----
From: lgo@tigris.org [mailto:lgo@tigris.org]
Sent: Fri 4/27/2007 1:03 AM
To: svn@subversion.tigris.org
Subject: svn commit: r24793 - in trunk/subversion: libsvn_wc tests/cmdline
Author: lgo
Date: Thu Apr 26 12:33:44 2007
New Revision: 24793
Log:
Fix issue 2743: when replacing a local file, the properties of the original
file should be ignored, they're only needed when reverting.
* subversion/libsvn_wc/adm_ops.c
(svn_wc_add2): clean the cached property flags when replacing a file.
(revert_admin_things): add support for the scenario where replacing a file
with another local doesn't create a revert props base, but there might be a
normal props base.
* subversion/libsvn_wc/props.c
(svn_wc__load_props): don't load the base properties when the file is
scheduled for replacement.
* subversion/tests/cmdline/prop_tests.py
(test_list): props_on_replaced_file passes now.
Modified:
trunk/subversion/libsvn_wc/adm_ops.c
trunk/subversion/libsvn_wc/props.c
trunk/subversion/tests/cmdline/prop_tests.py
Modified: trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/adm_ops.c?pathrev=24793&r1=24792&r2=24793
==============================================================================
--- trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ trunk/subversion/libsvn_wc/adm_ops.c Thu Apr 26 12:33:44 2007
@@ -1494,12 +1494,17 @@
modify_flags |= SVN_WC__ENTRY_MODIFY_COPIED;
}
- /* If this is a replacement we want to remove the checksum so it is not set
- * to the old value. */
+ /* If this is a replacement we want to remove the checksum and the property
+ flags so they are not set to their respective old values. */
if (is_replace)
{
tmp_entry.checksum = NULL;
modify_flags |= SVN_WC__ENTRY_MODIFY_CHECKSUM;
+
+ tmp_entry.has_props = FALSE;
+ tmp_entry.has_prop_mods = FALSE;
+ modify_flags |= SVN_WC__ENTRY_MODIFY_HAS_PROPS;
+ modify_flags |= SVN_WC__ENTRY_MODIFY_HAS_PROP_MODS;
}
tmp_entry.revision = 0;
@@ -1726,6 +1731,7 @@
svn_stringbuf_t *log_accum = svn_stringbuf_create("", pool);
apr_hash_t *baseprops = NULL;
const char *adm_path = svn_wc_adm_access_path(adm_access);
+ svn_boolean_t revert_base = FALSE;
/* Build the full path of the thing we're reverting. */
fullpath = svn_wc_adm_access_path(adm_access);
@@ -1733,24 +1739,34 @@
fullpath = svn_path_join(fullpath, name, pool);
/* Deal with properties. */
-
if (entry->schedule == svn_wc_schedule_replace)
{
const char *rprop;
svn_node_kind_t kind;
+ revert_base = TRUE;
/* Use the revertpath as the new propsbase if it exists. */
SVN_ERR(svn_wc__prop_revert_path(&rprop, fullpath, entry->kind, FALSE,
pool));
SVN_ERR(svn_io_check_path(rprop, &kind, pool));
+
+ /* If the revert-base doesn't exist, check for a normal propsbase */
+ if (kind != svn_node_file)
+ {
+ SVN_ERR(svn_wc__prop_base_path(&rprop, fullpath, entry->kind, FALSE,
+ pool));
+ SVN_ERR(svn_io_check_path(rprop, &kind, pool));
+ revert_base = FALSE;
+ }
if (kind == svn_node_file)
{
baseprops = apr_hash_make(pool);
SVN_ERR(svn_wc__load_prop_file(rprop, baseprops, pool));
/* Ensure the revert propfile gets removed. */
- SVN_ERR(svn_wc__loggy_remove
- (&log_accum, adm_access,
- svn_path_is_child(adm_path, rprop, pool), pool));
+ if (revert_base)
+ SVN_ERR(svn_wc__loggy_remove
+ (&log_accum, adm_access,
+ svn_path_is_child(adm_path, rprop, pool), pool));
*reverted = TRUE;
}
}
@@ -1786,7 +1802,7 @@
{
SVN_ERR(svn_wc__install_props(&log_accum, adm_access, name, baseprops,
baseprops,
- entry->schedule == svn_wc_schedule_replace,
+ revert_base,
pool));
*reverted = TRUE;
}
Modified: trunk/subversion/libsvn_wc/props.c
URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/props.c?pathrev=24793&r1=24792&r2=24793
==============================================================================
--- trunk/subversion/libsvn_wc/props.c (original)
+++ trunk/subversion/libsvn_wc/props.c Thu Apr 26 12:33:44 2007
@@ -306,15 +306,23 @@
our WC has prop caching, the user requested working props and there are no
prop mods. */
if (base_props_p
- || (has_propcaching && ! entry->has_prop_mods && entry->has_props))
+ || (has_propcaching && ! entry->has_prop_mods))
{
- const char *prop_base_path;
-
- SVN_ERR(svn_wc__prop_base_path(&prop_base_path, full_path,
- kind, FALSE, pool));
base_props = apr_hash_make(pool);
- SVN_ERR(svn_wc__load_prop_file(prop_base_path, base_props, pool));
+ /* When this entry is scheduled for replacement, the base property file
+ is only there to revert to the original item, so it should be ignored
+ here. */
+ if (entry->schedule != svn_wc_schedule_replace
+ || !(has_propcaching && entry->has_props))
+ {
+ const char *prop_base_path;
+
+ SVN_ERR(svn_wc__prop_base_path(&prop_base_path, full_path,
+ kind, FALSE, pool));
+
+ SVN_ERR(svn_wc__load_prop_file(prop_base_path, base_props, pool));
+ }
if (base_props_p)
*base_props_p = base_props;
}
Modified: trunk/subversion/tests/cmdline/prop_tests.py
URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/prop_tests.py?pathrev=24793&r1=24792&r2=24793
==============================================================================
--- trunk/subversion/tests/cmdline/prop_tests.py (original)
+++ trunk/subversion/tests/cmdline/prop_tests.py Thu Apr 26 12:33:44 2007
@@ -1303,7 +1303,7 @@
url_props_ops,
removal_schedule_added_props,
update_props_on_wc_root,
- XFail(props_on_replaced_file),
+ props_on_replaced_file,
]
if __name__ == '__main__':
---------------------------------------------------------------------
To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
For additional commands, e-mail: svn-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Apr 27 19:52:21 2007