[PATCH [RFC]] hgweb: add branches RSS and Atom feeds

Angel Ezquerra angel.ezquerra at gmail.com
Tue Dec 4 00:34:52 CST 2012


On Tue, Dec 4, 2012 at 12:38 AM, Angel Ezquerra
<angel.ezquerra at gmail.com> wrote:
> # HG changeset patch
> # User Angel Ezquerra <angel.ezquerra at gmail.com>
> # Date 1354577870 -3600
> # Node ID 41d3a5a1c8495cd599e5b422fddcdf93609b8101
> # Parent  9b05b31b413c55d750ca8be41330ff65fa9ed8c1
> hgweb: add branches RSS and Atom feeds
>
> There were no RSS nor Atom feeds for the branches page. Different hgweb
> templates linked to different feeds on their branches page (some linked to the
> tags feed, some to the log feed and some to the unexisting branches feed).
>
> Note that while the RSS feed is functional, the Atom feed is not (it is empty).
> Comments and help to make it work are welcome.
>
> diff --git a/mercurial/templates/atom/map b/mercurial/templates/atom/map
> --- a/mercurial/templates/atom/map
> +++ b/mercurial/templates/atom/map
> @@ -10,4 +10,6 @@
>  tagentry = tagentry.tmpl
>  bookmarks = bookmarks.tmpl
>  bookmarkentry = bookmarkentry.tmpl
> +branches = branches.tmpl
> +branchentry = branchentry.tmpl
>  error = error.tmpl
> diff --git a/mercurial/templates/gitweb/branches.tmpl b/mercurial/templates/gitweb/branches.tmpl
> --- a/mercurial/templates/gitweb/branches.tmpl
> +++ b/mercurial/templates/gitweb/branches.tmpl
> @@ -1,9 +1,9 @@
>  {header}
>  <title>{repo|escape}: Branches</title>
>  <link rel="alternate" type="application/atom+xml"
> -   href="{url}atom-tags" title="Atom feed for {repo|escape}"/>
> +   href="{url}atom-branches" title="Atom feed for {repo|escape}"/>
>  <link rel="alternate" type="application/rss+xml"
> -   href="{url}rss-tags" title="RSS feed for {repo|escape}"/>
> +   href="{url}rss-branches" title="RSS feed for {repo|escape}"/>
>  </head>
>  <body>
>
> diff --git a/mercurial/templates/monoblue/branches.tmpl b/mercurial/templates/monoblue/branches.tmpl
> --- a/mercurial/templates/monoblue/branches.tmpl
> +++ b/mercurial/templates/monoblue/branches.tmpl
> @@ -1,7 +1,7 @@
>  {header}
>      <title>{repo|escape}: Branches</title>
> -    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
> -    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
> +    <link rel="alternate" type="application/atom+xml" href="{url}atom-branches" title="Atom feed for {repo|escape}"/>
> +    <link rel="alternate" type="application/rss+xml" href="{url}rss-branches" title="RSS feed for {repo|escape}"/>
>  </head>
>
>  <body>
> diff --git a/mercurial/templates/paper/branches.tmpl b/mercurial/templates/paper/branches.tmpl
> --- a/mercurial/templates/paper/branches.tmpl
> +++ b/mercurial/templates/paper/branches.tmpl
> @@ -1,9 +1,9 @@
>  {header}
>  <title>{repo|escape}: branches</title>
>  <link rel="alternate" type="application/atom+xml"
> -   href="{url}atom-tags" title="Atom feed for {repo|escape}: branches" />
> +   href="{url}atom-branches" title="Atom feed for {repo|escape}: branches" />
>  <link rel="alternate" type="application/rss+xml"
> -   href="{url}rss-tags" title="RSS feed for {repo|escape}: branches" />
> +   href="{url}rss-branches" title="RSS feed for {repo|escape}: branches" />
>  </head>
>  <body>
>
> diff --git a/mercurial/templates/rss/map b/mercurial/templates/rss/map
> --- a/mercurial/templates/rss/map
> +++ b/mercurial/templates/rss/map
> @@ -9,4 +9,6 @@
>  tagentry = tagentry.tmpl
>  bookmarks = bookmarks.tmpl
>  bookmarkentry = bookmarkentry.tmpl
> +branches = branches.tmpl
> +branchentry = branchentry.tmpl
>  error = error.tmpl

Note that up to a point this could be considered a bug, since the
spartan template was linking to feeds that did not exist, and all
other templates were linking to feeds other than the (non-existing)
branches feeds.

Cheers,

Angel


More information about the Mercurial-devel mailing list