Index: subversion/mod_dav_svn/liveprops.c =================================================================== --- subversion/mod_dav_svn/liveprops.c (revision 15885) +++ subversion/mod_dav_svn/liveprops.c (working copy) @@ -67,7 +67,8 @@ enum { SVN_PROPID_baseline_relative_path = 1, SVN_PROPID_md5_checksum, - SVN_PROPID_repository_uuid + SVN_PROPID_repository_uuid, + SVN_PROPID_deadprop_count }; static const dav_liveprop_spec dav_svn_props[] = @@ -96,6 +97,7 @@ SVN_RO_SVN_PROP(baseline_relative_path, baseline-relative-path), SVN_RO_SVN_PROP(md5_checksum, md5-checksum), SVN_RO_SVN_PROP(repository_uuid, repository-uuid), + SVN_RO_SVN_PROP(deadprop_count, deadprop-count), { 0 } /* sentinel */ }; @@ -563,6 +565,27 @@ } break; + case SVN_PROPID_deadprop_count: + { + unsigned int propcount; + + apr_hash_t *proplist; + serr = svn_fs_node_proplist(&proplist, + resource->info->root.root, + resource->info->repos_path, p); + if (serr != NULL) + { + /* ### what to do? */ + svn_error_clear(serr); + value = "###error###"; + break; + } + + propcount = apr_hash_count(proplist); + value = apr_psprintf(p, "%u", propcount); + break; + } + default: /* ### what the heck was this property? */ return DAV_PROP_INSERT_NOTDEF; Index: subversion/libsvn_ra_dav/ra_dav.h =================================================================== --- subversion/libsvn_ra_dav/ra_dav.h (revision 15885) +++ subversion/libsvn_ra_dav/ra_dav.h (working copy) @@ -368,6 +368,7 @@ #define SVN_RA_DAV__PROP_REPOSITORY_UUID SVN_DAV_PROP_NS_DAV "repository-uuid" +#define SVN_RA_DAV__PROP_DEADPROP_COUNT "deadprop-count" typedef struct { /* what is the URL for this resource */ @@ -707,7 +708,8 @@ ELEM_lock_owner, ELEM_lock_comment, ELEM_lock_creationdate, - ELEM_lock_expirationdate + ELEM_lock_expirationdate, + ELEM_deadprop_count }; /* ### docco */ Index: subversion/libsvn_ra_dav/props.c =================================================================== --- subversion/libsvn_ra_dav/props.c (revision 15885) +++ subversion/libsvn_ra_dav/props.c (working copy) @@ -111,6 +111,7 @@ { ELEM_baseline_relpath, SVN_RA_DAV__PROP_BASELINE_RELPATH, 1 }, { ELEM_md5_checksum, SVN_RA_DAV__PROP_MD5_CHECKSUM, 1 }, { ELEM_repository_uuid, SVN_RA_DAV__PROP_REPOSITORY_UUID, 1 }, + { ELEM_deadprop_count, SVN_RA_DAV__PROP_DEADPROP_COUNT, 1 }, { 0 } }; @@ -147,6 +148,8 @@ SVN_RA_DAV__XML_CDATA }, { SVN_DAV_PROP_NS_DAV, "repository-uuid", ELEM_repository_uuid, SVN_RA_DAV__XML_CDATA }, + { SVN_DAV_PROP_NS_DAV, "deadprop-count", ELEM_deadprop_count, + SVN_RA_DAV__XML_CDATA }, /* Unknowns */ { "", "", ELEM_unknown, SVN_RA_DAV__XML_COLLECT }, Index: subversion/libsvn_ra_dav/fetch.c =================================================================== --- subversion/libsvn_ra_dav/fetch.c (revision 15885) +++ subversion/libsvn_ra_dav/fetch.c (working copy) @@ -914,6 +914,18 @@ return SVN_NO_ERROR; } +/* the properties we need to fill in an svn_dirent_t, used by + svn_ra_get_dir(). */ +static const ne_propname dirent_props[] = +{ + { "DAV:", "resourcetype" }, /* kind */ + { "DAV:", "getcontentlength" }, /* size */ + { "DAV:", "version-name" }, /* created_rev */ + { "DAV:", "creationdate" }, /* time */ + { "DAV:", "creator-displayname" }, /* last_author */ + { SVN_DAV_PROP_NS_DAV, "deadprop-count" }, /* has_props */ + { NULL } +}; svn_error_t *svn_ra_dav__get_dir(svn_ra_session_t *session, const char *path, @@ -961,7 +973,7 @@ PROPFIND on the directory of depth 1. */ SVN_ERR( svn_ra_dav__get_props(&resources, ras->sess, final_url, NE_DEPTH_ONE, - NULL, NULL /* all props */, pool) ); + NULL, dirent_props, pool) ); /* Count the number of path components in final_url. */ final_url_n_components = svn_path_component_count(final_url); @@ -979,8 +991,9 @@ const char *childname; svn_ra_dav_resource_t *resource; const svn_string_t *propval; - apr_hash_index_t *h; + //apr_hash_index_t *h; svn_dirent_t *entry; + apr_int64_t prop_count; apr_hash_this (hi, &key, NULL, &val); childname = key; @@ -1009,21 +1022,37 @@ /* does this resource contain any 'svn' or 'custom' properties, i.e. ones actually created and set by the user? */ - for (h = apr_hash_first (pool, resource->propset); - h; h = apr_hash_next (h)) + propval = apr_hash_get(resource->propset, + SVN_RA_DAV__PROP_DEADPROP_COUNT, + APR_HASH_KEY_STRING); + + if (propval == NULL) + entry->has_props = FALSE; + else { - const void *kkey; - void *vval; - apr_hash_this (h, &kkey, NULL, &vval); + prop_count = svn__atoui64(propval->data); - if (strncmp((const char *)kkey, SVN_DAV_PROP_NS_CUSTOM, - sizeof(SVN_DAV_PROP_NS_CUSTOM) - 1) == 0) + if (prop_count == 0) + entry->has_props = FALSE; + else entry->has_props = TRUE; - - else if (strncmp((const char *)kkey, SVN_DAV_PROP_NS_SVN, - sizeof(SVN_DAV_PROP_NS_SVN) - 1) == 0) - entry->has_props = TRUE; } + + //for (h = apr_hash_first (pool, resource->propset); + // h; h = apr_hash_next (h)) + // { + // const void *kkey; + // void *vval; + // apr_hash_this (h, &kkey, NULL, &vval); + // + // if (strncmp((const char *)kkey, SVN_DAV_PROP_NS_CUSTOM, + // sizeof(SVN_DAV_PROP_NS_CUSTOM) - 1) == 0) + // entry->has_props = TRUE; + // + // else if (strncmp((const char *)kkey, SVN_DAV_PROP_NS_SVN, + // sizeof(SVN_DAV_PROP_NS_SVN) - 1) == 0) + // entry->has_props = TRUE; + // } /* created_rev & friends */ propval = apr_hash_get(resource->propset,