Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-2738

Define a "base" attribute for <index> in the browser xml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • trunk
    • 1.5.0
    • mod_dav_svn

    Description

      In
      http://subversion.tigris.org/servlets/BrowseList?list=dev&by=thread&from=561613
      I think we reached consensus that it would be useful to have the repository base
      name separated from the SVNReposName.  I attach a diff for your consideration.
      
      Index: subversion/mod_dav_svn/dav_svn.h
      ===================================================================
      --- subversion/mod_dav_svn/dav_svn.h	(revision 23741)
      +++ subversion/mod_dav_svn/dav_svn.h	(working copy)
      @@ -90,6 +90,9 @@
         /* The name of this repository */
         const char *repo_name;
       
      +  /* The repository filesystem basename */
      +  const char *repo_basename;
      +
         /* The URI of the XSL transform for directory indexes */
         const char *xslt_uri;
       
      Index: subversion/mod_dav_svn/repos.c
      ===================================================================
      --- subversion/mod_dav_svn/repos.c	(revision 23741)
      +++ subversion/mod_dav_svn/repos.c	(working copy)
      @@ -1484,6 +1484,10 @@
                                 &repos_name, &relative, &repos_path);
         if (err)
           return err;
      +  /* CMS Original Patch:
      +   * if (repo_name == NULL)
      +   *	repo_name = repos_name;
      +   */
       
         /* The path that we will eventually try to open as an svn
            repository.  Normally defined by the SVNPath directive. */
      @@ -1566,6 +1570,9 @@
         /* A name for the repository */
         repos->repo_name = repo_name;
       
      +  /* The repository filesystem basename */
      +  repos->repo_basename = repos_name;
      +
         /* An XSL transformation */
         repos->xslt_uri = xslt_uri;
       
      @@ -2575,7 +2582,8 @@
               "  <!ELEMENT index (updir?, (file | dir)*)>\n"
               "  <!ATTLIST index name    CDATA #IMPLIED\n"
               "                  path    CDATA #IMPLIED\n"
      -        "                  rev     CDATA #IMPLIED>\n"
      +        "                  rev     CDATA #IMPLIED\n"
      +	"                  base    CDATA #IMPLIED>\n"
               "  <!ELEMENT updir EMPTY>\n"
               "  <!ELEMENT file  EMPTY>\n"
               "  <!ATTLIST file  name    CDATA #REQUIRED\n"
      @@ -2674,6 +2682,7 @@
               {
                 const char *name = resource->info->repos->repo_name;
                 const char *href = resource->info->repos_path;
      +	  const char *base = resource->info->repos->repo_basename;
       
                 ap_fputs(output, bb, "<?xml version=\"1.0\"?>\n");
                 ap_fprintf(output, bb,
      @@ -2695,6 +2704,9 @@
                              apr_xml_quote_string(resource->pool,
                                                   href,
                                                   1));
      +	  if (base)
      +	    ap_fprintf(output, bb, " base=\"%s\"", base);
      +
                 ap_fputs(output, bb, ">\n");
               }
       
      Index: tools/xslt/svnindex.xsl
      ===================================================================
      --- tools/xslt/svnindex.xsl	(revision 23741)
      +++ tools/xslt/svnindex.xsl	(working copy)
      @@ -42,15 +42,19 @@
       
         <xsl:template match="index">
           <div class="rev">
      -      <xsl:if test="string-length(@name) != 0">
      -        <xsl:value-of select="@name"/>
      -        <xsl:if test="string-length(@rev) != 0">
      -          <xsl:text> &#8212; </xsl:text>
      -        </xsl:if>
      +      <xsl:value-of select="@name"/>
      +      <xsl:if test="@base">
      +	<xsl:if test="@name">
      +	  <xsl:text>:&#xA0; </xsl:text>
      +	</xsl:if>
      +	<xsl:value-of select="@base" />
             </xsl:if>
      -      <xsl:if test="string-length(@rev) != 0">
      -        <xsl:text>Revision </xsl:text>
      -        <xsl:value-of select="@rev"/>
      +      <xsl:if test="@rev">
      +	<xsl:if test="@base | @name">
      +	  <xsl:text> &#x2014; </xsl:text>
      +	</xsl:if>
      +	<xsl:text>Revision </xsl:text>
      +	<xsl:value-of select="@rev"/>
             </xsl:if>
           </div>
           <div class="path">
      @@ -70,7 +74,6 @@
             </xsl:element>
             <xsl:text>]</xsl:text>
           </div>
      -    <!-- xsl:apply-templates/ -->
         </xsl:template>
       
         <xsl:template match="dir">
      @@ -83,7 +86,6 @@
               <xsl:text>/</xsl:text>
             </xsl:element>
           </div>
      -    <!-- <xsl:apply-templates/ -->
         </xsl:template>
       
         <xsl:template match="file">
      @@ -95,7 +97,6 @@
               <xsl:value-of select="@name"/>
             </xsl:element>
           </div>
      -    <!-- xsl:apply-templates/ -->
         </xsl:template>
       
       </xsl:stylesheet>
      

      Original issue reported by cliff_stanford

      Attachments

        Activity

          People

            Unassigned Unassigned
            subversion-importer Subversion Importer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: