mercurial/hgweb/hgweb_mod.py
changeset 4282 a1406a50ca83
parent 4267 b11a2fb59cf5
child 4300 05d15c456fb2
equal deleted inserted replaced
4281:384672d8080f 4282:a1406a50ca83
   608 
   608 
   609     def archive(self, req, id, type_):
   609     def archive(self, req, id, type_):
   610         reponame = re.sub(r"\W+", "-", os.path.basename(self.reponame))
   610         reponame = re.sub(r"\W+", "-", os.path.basename(self.reponame))
   611         cnode = self.repo.lookup(id)
   611         cnode = self.repo.lookup(id)
   612         arch_version = id
   612         arch_version = id
   613         if cnode == id:
   613         if cnode == id or id == 'tip':
   614             arch_version = short(cnode)
   614             arch_version = short(cnode)
   615         name = "%s-%s" % (reponame, arch_version)
   615         name = "%s-%s" % (reponame, arch_version)
   616         mimetype, artype, extension, encoding = self.archive_specs[type_]
   616         mimetype, artype, extension, encoding = self.archive_specs[type_]
   617         headers = [('Content-type', mimetype),
   617         headers = [('Content-type', mimetype),
   618                    ('Content-disposition', 'attachment; filename=%s%s' %
   618                    ('Content-disposition', 'attachment; filename=%s%s' %