【问题标题】:How to make the Mercurial (hgwebdir) rss/atom feed display the branch name如何使 Mercurial (hgwebdir) rss/atom 提要显示分支名称
【发布时间】:2010-10-12 14:19:53
【问题描述】:

我想配置我们的 Mercurial 服务器安装,以便 rss/atom 提要将发布变更集的分支名称,以及标准字段(标题、guid、描述、作者、pubDate)。

【问题讨论】:

    标签: mercurial rss atom-feed


    【解决方案1】:

    安装位置不同,但在 ubuntu 上你会发现相关文件为 /usr/share/mercurial/templates/atom/changelogentry.tmpl

    它开始看起来像:

     <entry>
      <title>{desc|strip|firstline|strip|escape|nonempty}</title>
      <id>{urlbase}{url}#changeset-{node}</id>
      <link href="{urlbase}{url}rev/{node|short}"/>
      <author>
       <name>{author|person|escape}</name>
       <email>{author|email|obfuscate}</email>
          </author>
      <updated>{date|rfc3339date}</updated>
      <published>{date|rfc3339date}</published>
      <content type="xhtml">
       <div xmlns="http://www.w3.org/1999/xhtml">
        <pre xml:space="preserve">{desc|escape|nonempty}</pre>
       </div>
      </content>
     </entry>
    

    您可以添加您在hg help templates 中找到的任何内容,包括:

    branches    String. The name of the branch on which the changeset was committed. Will be
                empty if the branch name was default.
    

    【讨论】:

      【解决方案2】:

      我终于在the Mercurial mailing lists上找到了solution

      我必须像这样编辑 templates\rss-log\changelogentry.tmpl

      <item>
        <title>{desc|strip|firstline|strip|escape}</title>
        <guid isPermaLink="true">{urlbase}{url}rev/{node|short}</guid>
        <description>
          <![CDATA[<i>{inbranch%branchname}{branches%branchname}</i>
          <p>{desc|strip|escape|addbreaks|nonempty}]]>
        </description>
        <files>{file_mods}</files>
        <author>{author|obfuscate}</author>
        <pubDate>{date|rfc822date}</pubDate>
      </item>
      

      我必须将以下行添加到 templates\rss-log\map

      branchname = '{name}'
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-01-03
        • 2012-07-19
        • 2011-07-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-12-06
        • 1970-01-01
        相关资源
        最近更新 更多