[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] libsvn_wc losing properties?

From: Justin Erenkrantz <justin_at_erenkrantz.com>
Date: 2006-03-07 02:46:43 CET

A weird corner case that I seem to be hitting with ra_serf is that
when I do an update any directory props (like svn:ignore) get lost
each time. ra_serf doesn't have any ability to know what properties
have changed from one revision to the next (mainly because the server
can't tell us unless we were to change mod_dav_svn - which would break
compat) - so ra_serf calls change_file_prop or change_dir_prop with
the 'current' list and lets libsvn_wc sort the property situation out.
 Which it does for files, but for dirs libsvn_wc goes and deletes all
properties for a directory instead. Oops.

I've confirmed that libsvn_wc is indeed issuing the rm command from
props.c:416 which produces in the WC log:

<rm
   name=".svn/dir-props"/>

The below patch fixes it for me, but am I missing something?

Also, cosmetically, because libsvn_wc is doing the reduction itself
(instead of being able to do it at the RA layer), svn always reports
that properties are changed even when they aren't. Ideally, we could
make libsvn_wc smarter when it doesn't have any core propchanges (the
base props always change - i.e. the checked-in href wcprop) - such as
the checks around props.c:568. (So, before ra_dav has been lying to
everyone as it silently changes the properties of the directories...)

In case you're interested, the reproduction case I'm using here is
'svn update' from 18738 to HEAD (18747 now) using ra_serf from trunk -
after the update, we lose all of the dir-props in any touched
directory (i.e. svn:ignore in svn/www).

Thanks. -- justin

* subversion/libsvn_wc/props.c
  (svn_wc__install_props): Only delete our props if we now have no items.

Index: subversion/libsvn_wc/props.c
===================================================================
--- subversion/libsvn_wc/props.c (revision 18738)
+++ subversion/libsvn_wc/props.c (working copy)
@@ -410,9 +410,9 @@
       SVN_ERR(svn_wc__loggy_set_readonly(log_accum, adm_access,
                                          real_props, pool));
     }
- else
+ else if (!tmp_entry.has_props)
     {
- /* No property modifications, remove the file instead. */
+ /* No property modifications and no more props, remove the file. */
       SVN_ERR(svn_wc__loggy_remove(log_accum, adm_access, real_props, pool));
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 7 02:47:10 2006

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.