Mercurial > hg
comparison mercurial/hgweb/webcommands.py @ 17933:8243dd66e0e3
webcommands: allow hgweb's archive to recurse into subrepos
Currently when obtaining an archive snapshot of a repository via the
web interface, subrepositories are not taken in the snapshot. I
introduce an option, archivesubrepos, which allows this.
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Mon, 29 Oct 2012 10:53:46 -0400 |
parents | 7124f984dc8d |
children | d605a82cf189 |
comparison
equal
deleted
inserted
replaced
17932:c8ffde272653 | 17933:8243dd66e0e3 |
---|---|
12 from mercurial.util import binary | 12 from mercurial.util import binary |
13 from common import paritygen, staticfile, get_contact, ErrorResponse | 13 from common import paritygen, staticfile, get_contact, ErrorResponse |
14 from common import HTTP_OK, HTTP_FORBIDDEN, HTTP_NOT_FOUND | 14 from common import HTTP_OK, HTTP_FORBIDDEN, HTTP_NOT_FOUND |
15 from mercurial import graphmod, patch | 15 from mercurial import graphmod, patch |
16 from mercurial import help as helpmod | 16 from mercurial import help as helpmod |
17 from mercurial import scmutil | |
17 from mercurial.i18n import _ | 18 from mercurial.i18n import _ |
18 | 19 |
19 # __all__ is populated with the allowed commands. Be sure to add to it if | 20 # __all__ is populated with the allowed commands. Be sure to add to it if |
20 # you're adding a new command, or the new command won't work. | 21 # you're adding a new command, or the new command won't work. |
21 | 22 |
797 ] | 798 ] |
798 if encoding: | 799 if encoding: |
799 headers.append(('Content-Encoding', encoding)) | 800 headers.append(('Content-Encoding', encoding)) |
800 req.header(headers) | 801 req.header(headers) |
801 req.respond(HTTP_OK) | 802 req.respond(HTTP_OK) |
802 archival.archive(web.repo, req, cnode, artype, prefix=name) | 803 |
804 ctx = webutil.changectx(web.repo, req) | |
805 archival.archive(web.repo, req, cnode, artype, prefix=name, | |
806 matchfn=scmutil.match(ctx, []), | |
807 subrepos=web.configbool("web", "archivesubrepos")) | |
803 return [] | 808 return [] |
804 | 809 |
805 | 810 |
806 def static(web, req, tmpl): | 811 def static(web, req, tmpl): |
807 fname = req.form['file'][0] | 812 fname = req.form['file'][0] |