diff -r 1300271ba8de -r e9a80ad9a6b5 mercurial/hgweb.py --- a/mercurial/hgweb.py Thu Aug 18 02:52:27 2005 +++ b/mercurial/hgweb.py Fri Aug 19 02:57:48 2005 @@ -6,7 +6,7 @@ # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. -import os, cgi, time, re, difflib, socket, sys, zlib +import os, cgi, time, re, difflib, socket, sys, zlib, zipfile from mercurial.hg import * from mercurial.ui import * @@ -702,6 +702,27 @@ sys.stdout.write(z.compress(chunk)) sys.stdout.write(z.flush()) + + elif args['cmd'][0] == 'zip': + mnode = args['manifest'][0] + tmp = tempfile.mkstemp()[1] + zf = zipfile.ZipFile(tmp, "w", zipfile.ZIP_DEFLATED) + mf = self.repo.manifest.read(bin(mnode)) + + for fname in mf.keys(): + r = self.repo.file(fname) + zf.writestr(fname, r.read(mf[fname])) + zf.close() + + f = open(tmp, 'r') + sys.stdout.write('Content-type: application/zip\n') + sys.stdout.write('Content-disposition: attachment; filename=' + + mnode + '.zip\n') + sys.stdout.write('Content-length: ' + + str(os.path.getsize(tmp)) + '\n\n') + sys.stdout.write(f.read()) + f.close() + os.unlink(tmp) else: write(self.t("error")) diff -r 1300271ba8de -r e9a80ad9a6b5 templates/changeset.tmpl --- a/templates/changeset.tmpl Thu Aug 18 02:52:27 2005 +++ b/templates/changeset.tmpl Fri Aug 19 02:57:48 2005 @@ -8,6 +8,7 @@ tags manifest raw +zip