Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/webcommands.py @ 28712:80e922479891
hgweb: generate last change date for an empty atom-bookmarks feed (issue5022)
RFC 4287 states that atom feeds must have an <updated> element, so let's add
one even when repo doesn't have a single bookmark.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 31 Mar 2016 15:37:21 +0800 |
parents | 06ae7a6daad0 |
children | ead25aa27a43 |
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py Thu Mar 31 15:22:06 2016 +0800 +++ b/mercurial/hgweb/webcommands.py Thu Mar 31 15:37:21 2016 +0800 @@ -620,8 +620,14 @@ "date": web.repo[n].date(), "node": hex(n)} + if i: + latestrev = i[0][1] + else: + latestrev = -1 + return tmpl("bookmarks", node=hex(web.repo.changelog.tip()), + lastchange=[{"date": web.repo[latestrev].date()}], entries=lambda **x: entries(latestonly=False, **x), latestentry=lambda **x: entries(latestonly=True, **x))