comparison mercurial/hgweb/webcommands.py @ 24093:c8639f90a715

webcommands: document "comparison" web command
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 06 Feb 2015 22:06:44 -0800
parents 55dfea651b7f
children 9c810d46a093
comparison
equal deleted inserted replaced
24092:55dfea651b7f 24093:c8639f90a715
849 849
850 diff = webcommand('diff')(filediff) 850 diff = webcommand('diff')(filediff)
851 851
852 @webcommand('comparison') 852 @webcommand('comparison')
853 def comparison(web, req, tmpl): 853 def comparison(web, req, tmpl):
854 """
855 /comparison/{revision}/{path}
856 -----------------------------
857
858 Show a comparison between the old and new versions of a file from changes
859 made on a particular revision.
860
861 This is similar to the ``diff`` handler. However, this form features
862 a split or side-by-side diff rather than a unified diff.
863
864 The ``context`` query string argument can be used to control the lines of
865 context in the diff.
866
867 The ``filecomparison`` template is rendered.
868 """
854 ctx = webutil.changectx(web.repo, req) 869 ctx = webutil.changectx(web.repo, req)
855 if 'file' not in req.form: 870 if 'file' not in req.form:
856 raise ErrorResponse(HTTP_NOT_FOUND, 'file not given') 871 raise ErrorResponse(HTTP_NOT_FOUND, 'file not given')
857 path = webutil.cleanpath(web.repo, req.form['file'][0]) 872 path = webutil.cleanpath(web.repo, req.form['file'][0])
858 rename = path in ctx and webutil.renamelink(ctx[path]) or [] 873 rename = path in ctx and webutil.renamelink(ctx[path]) or []