diff -ru subversion-1.1.4/subversion/mod_dav_svn/repos.c mod_dav_svn/repos.c --- subversion-1.1.4/subversion/mod_dav_svn/repos.c 2004-12-18 15:18:12.000000000 +0100 +++ mod_dav_svn/repos.c 2005-06-10 20:23:31.000000000 +0200 @@ -41,7 +41,6 @@ #include "dav_svn.h" #include "mod_dav_svn.h" - struct dav_stream { const dav_resource *res; @@ -1967,6 +1966,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: @@ -1985,10 +1986,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" " \n" "]>\n"; @@ -2077,6 +2085,11 @@ entry_pool = svn_pool_create(resource->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, @@ -2112,13 +2125,69 @@ else { const char *const tag = (is_dir ? "dir" : "file"); - - /* ### This is where the we could search for props */ - - ap_fprintf(output, bb, - " <%s name=\"%s\" href=\"%s\">\n", - tag, name, href, tag); + 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; + + 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\"", + 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"); + } } + svn_pool_clear(entry_pool); }