# HG changeset patch # User Thomas Arendsen Hein # Date 1146470537 -7200 # Node ID 290534ee163c8416f914f71c809025bc578c0c2a # Parent 29eeb2717915701bac033df1a7409f28f4f2d6ca Add download links to hgwebdir index page for allowed archive types. Based on a patch by Colin McMillen diff -r 29eeb2717915 -r 290534ee163c mercurial/hgweb.py --- a/mercurial/hgweb.py Mon May 01 09:01:59 2006 +0200 +++ b/mercurial/hgweb.py Mon May 01 10:02:17 2006 +0200 @@ -125,7 +125,7 @@ def archivelist(self, nodeid): for i in self.archives: if self.repo.ui.configbool("web", "allow" + i, False): - yield {"type" : i, "node" : nodeid} + yield {"type" : i, "node" : nodeid, "url": ""} def listfiles(self, files, mf): for f in files[:self.maxfiles]: @@ -1045,6 +1045,11 @@ defaults={"header": header, "footer": footer}) + def archivelist(ui, nodeid, url): + for i in ['zip', 'gz', 'bz2']: + if ui.configbool("web", "allow" + i, False): + yield {"type" : i, "node": nodeid, "url": url} + def entries(**map): parity = 0 for name, path in self.repos: @@ -1071,7 +1076,8 @@ url=url, parity=parity, shortdesc=get("web", "description", "unknown"), - lastupdate=d) + lastupdate=d, + archives=archivelist(u, "tip", url)) parity = 1 - parity diff -r 29eeb2717915 -r 290534ee163c templates/map --- a/templates/map Mon May 01 09:01:59 2006 +0200 +++ b/templates/map Mon May 01 10:02:17 2006 +0200 @@ -43,8 +43,8 @@ filelogparent = 'parent #rev#:#node|short#' filediffchild = 'child #rev#:#node|short#' filelogchild = 'child #rev#:#node|short#' -indexentry = '#name|escape##shortdesc##contact|obfuscate##lastupdate|age# agoRSS' +indexentry = '#name|escape##shortdesc##contact|obfuscate##lastupdate|age# agoRSS #archives%archiveentry#' index = index.tmpl -archiveentry = '#type|escape# ' +archiveentry = '#type|escape# ' notfound = notfound.tmpl error = error.tmpl diff -r 29eeb2717915 -r 290534ee163c templates/static/style.css --- a/templates/static/style.css Mon May 01 09:01:59 2006 +0200 +++ b/templates/static/style.css Mon May 01 10:02:17 2006 +0200 @@ -1,5 +1,6 @@ a { text-decoration:none; } .age { white-space:nowrap; } +.indexlinks { white-space:nowrap; } .parity0 { background-color: #dddddd; } .parity1 { background-color: #eeeeee; } .lineno { width: 60px; color: #aaaaaa; font-size: smaller;