comparison mercurial/hgweb/hgweb_mod.py @ 4282:a1406a50ca83

hgweb: short hash for tip archive name
author Christian Ebert <blacktrash@gmx.net>
date Tue, 13 Mar 2007 13:17:26 +0100
parents b11a2fb59cf5
children 05d15c456fb2
comparison
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' %