Index: subversion/mod_dav_svn/repos.c =================================================================== --- subversion/mod_dav_svn/repos.c (revision 15026) +++ subversion/mod_dav_svn/repos.c (working copy) @@ -42,7 +42,6 @@ #include "dav_svn.h" #include "mod_dav_svn.h" - struct dav_stream { const dav_resource *res; @@ -2197,6 +2196,8 @@ apr_hash_t *entries; apr_pool_t *entry_pool; apr_array_header_t *sorted; + svn_stringbuf_t *repos_path; + apr_size_t repos_len; int i; /* XML schema for the directory index if xslt_uri is set: @@ -2215,10 +2216,17 @@ " \n" " \n" " \n" + " href CDATA #REQUIRED\n" + " length CDATA #IMPLIED\n" + " author CDATA #IMPLIED\n" + " date CDATA #IMPLIED\n" + " rev CDATA #IMPLIED>\n" " \n" " \n" + " href CDATA #REQUIRED\n" + " author CDATA #IMPLIED\n" + " date CDATA #IMPLIED\n" + " rev CDATA #IMPLIED>\n" "]>\n"; /* pool); + repos_path = svn_stringbuf_create(resource->info->repos_path, + resource->pool); + svn_stringbuf_appendcstr(repos_path, "/"); + repos_len = repos_path->len; + for (i = 0; i < sorted->nelts; ++i) { const svn_sort__item_t *item = &APR_ARRAY_IDX(sorted, i, @@ -2340,12 +2353,67 @@ else { const char *const tag = (is_dir ? "dir" : "file"); + svn_revnum_t committed_rev = SVN_INVALID_REVNUM; + const char *committed_date = NULL; + const char *last_author = NULL; + apr_hash_t *props = NULL; + svn_filesize_t length = 0; - /* This is where we could search for props */ + svn_stringbuf_appendcstr(repos_path, href); + svn_fs_node_proplist(&props, + resource->info->root.root, repos_path->data, entry_pool); + svn_repos_get_committed_info( + &committed_rev, &committed_date, &last_author, + resource->info->root.root, repos_path->data, entry_pool); + + repos_path->len = repos_len; + ap_fprintf(output, bb, - " <%s name=\"%s\" href=\"%s\" />\n", + " <%s name=\"%s\" href=\"%s\"", tag, name, href); + + if (!is_dir && + !svn_fs_file_length(&length, resource->info->root.root, + repos_path->data, entry_pool)) + ap_fprintf(output, bb, " length=\"%ld\"", length); + + if (SVN_INVALID_REVNUM != committed_rev) + ap_fprintf(output, bb, " rev=\"%ld\"", committed_rev); + if (committed_date) + ap_fprintf(output, bb, " date=\"%s\"", + apr_xml_quote_string(entry_pool, committed_date, 1)); + if (last_author) + ap_fprintf(output, bb, " author=\"%s\"", + apr_xml_quote_string(entry_pool, last_author, 1)); + + if (props) + { + ap_fputs(output, bb, ">\n"); + + apr_hash_index_t *iter; + + for (iter = apr_hash_first(entry_pool, props); iter; + iter = apr_hash_next(iter)) + { + char *name; + svn_string_t *value; + + apr_hash_this(iter, (void*) &name, NULL, + (void*) &value); + + ap_fprintf(output, bb, + " %s\n", + name, apr_xml_quote_string(entry_pool, + value->data, 1)); + } + + ap_fprintf(output, bb, " \n", tag); + } + else + { + ap_fputs(output, bb, "/>\n"); + } } }