Patchwork [21,of,22,hgweb-help] webcommands: document "archive" web command

login
register
mail settings
Submitter Gregory Szorc
Date Feb. 7, 2015, 7:15 a.m.
Message ID <8aa04da3b94ef23efe0a.1423293359@gps-mbp.local>
Download mbox | patch
Permalink /patch/7759/
State Accepted
Headers show

Comments

Gregory Szorc - Feb. 7, 2015, 7:15 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1423289999 28800
#      Fri Feb 06 22:19:59 2015 -0800
# Node ID 8aa04da3b94ef23efe0ac4fe708885de83869bd1
# Parent  930ebcac556188143428bbc0bb1811b5df640c31
webcommands: document "archive" web command

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1078,8 +1078,27 @@  def filelog(web, req, tmpl):
                 revcount=revcount, morevars=morevars, lessvars=lessvars)
 
 @webcommand('archive')
 def archive(web, req, tmpl):
+    """
+    /archive/{revision}.{format}[/{path}]
+    -------------------------------------
+
+    Obtain an archive of repository content.
+
+    The content and type of the archive is defined by a URL path parameter.
+    ``format`` is the file extension of the archive type to be generated. e.g.
+    ``zip`` or ``tar.bz2``. Not all archive types may be allowed by your
+    server configuration.
+
+    The optional ``path`` URL parameter controls content to include in the
+    archive. If omitted, every file in the specified revision is present in the
+    archive. If included, only the specified file or contents of the specified
+    directory will be included in the archive.
+
+    No template is used for this handler. Raw, binary content is generated.
+    """
+
     type_ = req.form.get('type', [None])[0]
     allowed = web.configlist("web", "allow_archive")
     key = req.form['node'][0]