subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1133418 - /subversion/trunk/subversion/mod_dav_svn/repos.c
Date Wed, 08 Jun 2011 15:08:32 GMT
Author: ivan
Date: Wed Jun  8 15:08:31 2011
New Revision: 1133418

URL: http://svn.apache.org/viewvc?rev=1133418&view=rev
Log:
mod_dav_svn: Fix problem that pegged revision gets lost from URL when 
navigating to parent directory and SVNIndexXSLT is enabled.

Found by: stsp

* subversion/mod_dav_svn/repos.c
  (deliver): Add href attribute to <updir /> element in generated XML.

Modified:
    subversion/trunk/subversion/mod_dav_svn/repos.c

Modified: subversion/trunk/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/repos.c?rev=1133418&r1=1133417&r2=1133418&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/repos.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/repos.c Wed Jun  8 15:08:31 2011
@@ -3200,6 +3200,7 @@ deliver(const dav_resource *resource, ap
         "                  rev     CDATA #IMPLIED\n"
         "                  base    CDATA #IMPLIED>\n"
         "  <!ELEMENT updir EMPTY>\n"
+        "  <!ATTLIST updir href    CDATA #REQUIRED\n"
         "  <!ELEMENT file  EMPTY>\n"
         "  <!ATTLIST file  name    CDATA #REQUIRED\n"
         "                  href    CDATA #REQUIRED>\n"
@@ -3351,23 +3352,25 @@ deliver(const dav_resource *resource, ap
           && ((resource->info->repos_path[1] != '\0')
               || dav_svn__get_list_parentpath_flag(resource->info->r)))
         {
+          const char *href;
+          if (resource->info->pegged)
+            {
+              href = apr_psprintf(resource->pool, "../?p=%ld",
+                                  resource->info->root.rev);
+            }
+          else
+            {
+              href = "../";
+            }
+
           if (gen_html)
             {
-              if (resource->info->pegged)
-                {
-                  ap_fprintf(output, bb,
-                             "  <li><a href=\"../?p=%ld\">..</a></li>\n",
-                             resource->info->root.rev);
-                }
-              else
-                {
-                  ap_fprintf(output, bb,
-                             "  <li><a href=\"../\">..</a></li>\n");
-                }
+              ap_fprintf(output, bb,
+                         "  <li><a href=\"%s\">..</a></li>\n", href);
             }
           else
             {
-              ap_fprintf(output, bb, "    <updir />\n");
+              ap_fprintf(output, bb, "    <updir href=\"%s\"/>\n", href);
             }
         }
 



Mime
View raw message