Mercurial > hg > mercurial-crew-with-dirclash
diff mercurial/hgweb.py @ 2171:290534ee163c
Add download links to hgwebdir index page for allowed archive types.
Based on a patch by Colin McMillen <mcmillen@cs.cmu.edu>
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Mon, 01 May 2006 10:02:17 +0200 |
parents | 29eeb2717915 |
children | d1943df604c4 |
line wrap: on
line diff
--- a/mercurial/hgweb.py +++ b/mercurial/hgweb.py @@ -125,7 +125,7 @@ class hgweb(object): 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 @@ class hgwebdir(object): 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 @@ class hgwebdir(object): url=url, parity=parity, shortdesc=get("web", "description", "unknown"), - lastupdate=d) + lastupdate=d, + archives=archivelist(u, "tip", url)) parity = 1 - parity