# HG changeset patch # User Thomas Arendsen Hein # Date 1131039927 -3600 # Node ID 78590fb4a82b5e7f3879f0a91892d219bc0fe519 # Parent f0b13c019b043efe592c7703d6a2e3ee6b8eddc6 hgweb: Added archive download buttons to manifest page. diff -r f0b13c019b04 -r 78590fb4a82b mercurial/hgweb.py --- a/mercurial/hgweb.py Thu Nov 03 00:45:54 2005 -0800 +++ b/mercurial/hgweb.py Thu Nov 03 18:45:27 2005 +0100 @@ -196,6 +196,11 @@ self.maxfiles = int(self.repo.ui.config("web", "maxfiles", 10)) self.allowpull = self.repo.ui.configbool("web", "allowpull", True) + def archivelist(self, nodeid): + for i in self.archives: + if self.repo.ui.configbool("web", "allow" + i, False): + yield {"type" : i, "node" : nodeid} + def listfiles(self, files, mf): for f in files[:self.maxfiles]: yield self.t("filenodelink", node=hex(mf[f]), file=f) @@ -414,11 +419,6 @@ def diff(**map): yield self.diff(p1, n, None) - def archivelist(): - for i in self.archives: - if self.repo.ui.configbool("web", "allow" + i, False): - yield {"type" : i, "node" : nodeid} - yield self.t('changeset', diff=diff, rev=cl.rev(n), @@ -430,7 +430,7 @@ desc=changes[4], date=changes[2], files=files, - archives=archivelist()) + archives=self.archivelist(nodeid)) def filelog(self, f, filenode): cl = self.repo.changelog @@ -618,7 +618,8 @@ path=path, up=up(path), fentries=filelist, - dentries=dirlist) + dentries=dirlist, + archives=self.archivelist(hex(node))) def tags(self): cl = self.repo.changelog diff -r f0b13c019b04 -r 78590fb4a82b templates/manifest.tmpl --- a/templates/manifest.tmpl Thu Nov 03 00:45:54 2005 -0800 +++ b/templates/manifest.tmpl Thu Nov 03 18:45:27 2005 +0100 @@ -7,6 +7,7 @@ changelog tags changeset +#archives%archiveentry#

manifest for changeset #node|short#: #path#