Patchwork [18,of,22,hgweb-help] webcommands: document "comparison" web command

login
register
mail settings
Submitter Gregory Szorc
Date Feb. 7, 2015, 7:15 a.m.
Message ID <9927627531e8e504fb63.1423293356@gps-mbp.local>
Download mbox | patch
Permalink /patch/7756/
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 1423289204 28800
#      Fri Feb 06 22:06:44 2015 -0800
# Node ID 9927627531e8e504fb630294561e3b8bb8b61ce7
# Parent  e87c340ae85db7a83cf50843162f19dae35276b7
webcommands: document "comparison" 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
@@ -853,8 +853,23 @@  def filediff(web, req, tmpl):
 diff = webcommand('diff')(filediff)
 
 @webcommand('comparison')
 def comparison(web, req, tmpl):
+    """
+    /comparison/{revision}/{path}
+    -----------------------------
+
+    Show a comparison between the old and new versions of a file from changes
+    made on a particular revision.
+
+    This is similar to the ``diff`` handler. However, this form features
+    a split or side-by-side diff rather than a unified diff.
+
+    The ``context`` query string argument can be used to control the lines of
+    context in the diff.
+
+    The ``filecomparison`` template is rendered.
+    """
     ctx = webutil.changectx(web.repo, req)
     if 'file' not in req.form:
         raise ErrorResponse(HTTP_NOT_FOUND, 'file not given')
     path = webutil.cleanpath(web.repo, req.form['file'][0])