Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 24096:bb8b6d44fe1d
webcommands: document "archive" web command
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 06 Feb 2015 22:19:59 -0800 |
parents | 1f48b157dccf |
children | 8e04a73b5502 |
comparison
equal
deleted
inserted
replaced
24095:1f48b157dccf | 24096:bb8b6d44fe1d |
---|---|
1074 latestentry=latestentry, | 1074 latestentry=latestentry, |
1075 revcount=revcount, morevars=morevars, lessvars=lessvars) | 1075 revcount=revcount, morevars=morevars, lessvars=lessvars) |
1076 | 1076 |
1077 @webcommand('archive') | 1077 @webcommand('archive') |
1078 def archive(web, req, tmpl): | 1078 def archive(web, req, tmpl): |
1079 """ | |
1080 /archive/{revision}.{format}[/{path}] | |
1081 ------------------------------------- | |
1082 | |
1083 Obtain an archive of repository content. | |
1084 | |
1085 The content and type of the archive is defined by a URL path parameter. | |
1086 ``format`` is the file extension of the archive type to be generated. e.g. | |
1087 ``zip`` or ``tar.bz2``. Not all archive types may be allowed by your | |
1088 server configuration. | |
1089 | |
1090 The optional ``path`` URL parameter controls content to include in the | |
1091 archive. If omitted, every file in the specified revision is present in the | |
1092 archive. If included, only the specified file or contents of the specified | |
1093 directory will be included in the archive. | |
1094 | |
1095 No template is used for this handler. Raw, binary content is generated. | |
1096 """ | |
1097 | |
1079 type_ = req.form.get('type', [None])[0] | 1098 type_ = req.form.get('type', [None])[0] |
1080 allowed = web.configlist("web", "allow_archive") | 1099 allowed = web.configlist("web", "allow_archive") |
1081 key = req.form['node'][0] | 1100 key = req.form['node'][0] |
1082 | 1101 |
1083 if type_ not in web.archives: | 1102 if type_ not in web.archives: |