Patchwork [13,of,22,hgweb-help] webcommands: document "file" web command

login
register
mail settings
Submitter Gregory Szorc
Date Feb. 7, 2015, 7:15 a.m.
Message ID <51d1123555eb61cde317.1423293351@gps-mbp.local>
Download mbox | patch
Permalink /patch/7751/
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 1423286813 28800
#      Fri Feb 06 21:26:53 2015 -0800
# Node ID 51d1123555eb61cde3176a228365c7d9aaba87c8
# Parent  024264fd401ebcc927eb12a32377e438b8335a8d
webcommands: document "file" 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
@@ -133,8 +133,26 @@  def _filerevision(web, tmpl, fctx):
                 permissions=fctx.manifest().flags(f))
 
 @webcommand('file')
 def file(web, req, tmpl):
+    """
+    /file/{revision}[/{path}]
+    -------------------------
+
+    Show information about a directory or file in the repository.
+
+    Info about The ``path`` given as a URL parameter will be rendered.
+
+    If ``path`` is a directory, information about the entries in that
+    directory will be rendered. This form is equivalent to the ``manifest``
+    handler.
+
+    If ``path`` is a file, information about that file will be shown via
+    the ``filerevision`` template.
+
+    If ``path`` is not defined, information about the root directory will
+    be rendered.
+    """
     path = webutil.cleanpath(web.repo, req.form.get('file', [''])[0])
     if not path:
         return manifest(web, req, tmpl)
     try: