Author: cmpilato
Date: Thu May 10 18:19:51 2012
New Revision: 1336822
URL: http://svn.apache.org/viewvc?rev=1336822&view=rev
Log:
Make some comment tweaks and additions, plus a small logic change for
strict (if negligible) memory savings.
* subversion/mod_dav_svn/reports/update.c
(update_ctx_t, item_baton_t): Comment tweaks.
(upd_change_xxx_prop): Comment tweaks mostly, but also, only cache
removed_props in the one case we'll actually use them -- for copied
directories and files.
Modified:
subversion/trunk/subversion/mod_dav_svn/reports/update.c
Modified: subversion/trunk/subversion/mod_dav_svn/reports/update.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/reports/update.c?rev=1336822&r1=1336821&r2=1336822&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/reports/update.c Thu May 10
18:19:51 2012
@@ -45,6 +45,7 @@
#include "../dav_svn.h"
+/* State baton for the overall update process. */
typedef struct update_ctx_t {
const dav_resource *resource;
@@ -89,22 +90,38 @@ typedef struct update_ctx_t {
} update_ctx_t;
+
+/* State baton for a file or directory. */
typedef struct item_baton_t {
apr_pool_t *pool;
update_ctx_t *uc;
- struct item_baton_t *parent; /* the parent of this item. */
- const char *name; /* the single-component name of this item */
- const char *path; /* a telescoping extension of uc->anchor */
- const char *path2; /* a telescoping extension of uc->dst_path */
- const char *path3; /* a telescoping extension of uc->dst_path
- without dst_path as prefix. */
-
- const char *base_checksum; /* base_checksum (from apply_textdelta) */
-
- svn_boolean_t text_changed; /* Did the file's contents change? */
- svn_boolean_t added; /* File added? (Implies text_changed.) */
- svn_boolean_t copyfrom; /* File copied? */
- apr_array_header_t *removed_props; /* array of const char * prop names */
+
+ /* Uplink -- the parent of this item. */
+ struct item_baton_t *parent;
+
+ /* Single-component name of this item. */
+ const char *name;
+
+ /* Telescoping extension paths ... */
+ const char *path; /* ... of uc->anchor. */
+ const char *path2; /* ... of uc->dst_path. */
+ const char *path3; /* ... uc->dst_path, without dst_path prefix. */
+
+ /* Base_checksum (from apply_textdelta). */
+ const char *base_checksum;
+
+ /* Did the file's contents change? */
+ svn_boolean_t text_changed;
+
+ /* File/dir added? (Implies text_changed for files.) */
+ svn_boolean_t added;
+
+ /* File/dir copied? */
+ svn_boolean_t copyfrom;
+
+ /* Array of const char * names of removed properties. (Used only
+ for copied files/dirs in skelta mode.) */
+ apr_array_header_t *removed_props;
} item_baton_t;
@@ -638,16 +655,26 @@ upd_change_xxx_prop(void *baton,
qname));
}
}
- else if (!value) /* This is an addition in 'skelta' mode so there is no
- need for an inline response since property fetching
- is implied in addition. We still need to cache
- property removals because a copied path might
- have removed properties. */
+ else if (!value)
{
- if (! b->removed_props)
- b->removed_props = apr_array_make(b->pool, 1, sizeof(name));
+ /* This is an addition in "skelta" (that is, "not send-all")
+ mode so there is no strict need for an inline response.
+ Clients will assume that added objects need all to have all
+ their properties explicitly fetched from the server. */
+
+ /* Now, if the object is actually a copy, we'll still need to
+ cache (and later transmit) property removals, because
+ fetching the object's current property set alone isn't
+ sufficient to communicate the fact that additional properties
+ were, in fact, removed from the copied base object in order
+ to arrive at that set. */
+ if (b->copyfrom)
+ {
+ if (! b->removed_props)
+ b->removed_props = apr_array_make(b->pool, 1, sizeof(name));
- APR_ARRAY_PUSH(b->removed_props, const char *) = qname;
+ APR_ARRAY_PUSH(b->removed_props, const char *) = qname;
+ }
}
return SVN_NO_ERROR;