Mercurial > public > mercurial-scm > hg-stable
diff 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 |
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py Tue Nov 13 19:32:53 2012 -0600 +++ b/mercurial/hgweb/webcommands.py Mon Oct 29 10:53:46 2012 -0400 @@ -14,6 +14,7 @@ from common import HTTP_OK, HTTP_FORBIDDEN, HTTP_NOT_FOUND from mercurial import graphmod, patch from mercurial import help as helpmod +from mercurial import scmutil from mercurial.i18n import _ # __all__ is populated with the allowed commands. Be sure to add to it if @@ -799,7 +800,11 @@ headers.append(('Content-Encoding', encoding)) req.header(headers) req.respond(HTTP_OK) - archival.archive(web.repo, req, cnode, artype, prefix=name) + + ctx = webutil.changectx(web.repo, req) + archival.archive(web.repo, req, cnode, artype, prefix=name, + matchfn=scmutil.match(ctx, []), + subrepos=web.configbool("web", "archivesubrepos")) return []