Show More
@@ -586,6 +586,8 diff = filediff | |||
|
586 | 586 | |
|
587 | 587 | def comparison(web, req, tmpl): |
|
588 | 588 | ctx = webutil.changectx(web.repo, req) |
|
589 | if 'file' not in req.form: | |
|
590 | raise ErrorResponse(HTTP_NOT_FOUND, 'file not given') | |
|
589 | 591 | path = webutil.cleanpath(web.repo, req.form['file'][0]) |
|
590 | 592 | rename = path in ctx and webutil.renamelink(ctx[path]) or [] |
|
591 | 593 |
@@ -10,6 +10,8 import os, mimetypes, copy | |||
|
10 | 10 | from mercurial import match, patch, scmutil, error, ui, util |
|
11 | 11 | from mercurial.i18n import _ |
|
12 | 12 | from mercurial.node import hex, nullid |
|
13 | from common import ErrorResponse | |
|
14 | from common import HTTP_NOT_FOUND | |
|
13 | 15 | import difflib |
|
14 | 16 | |
|
15 | 17 | def up(p): |
@@ -154,11 +156,15 def changectx(repo, req): | |||
|
154 | 156 | return ctx |
|
155 | 157 | |
|
156 | 158 | def filectx(repo, req): |
|
159 | if 'file' not in req.form: | |
|
160 | raise ErrorResponse(HTTP_NOT_FOUND, 'file not given') | |
|
157 | 161 | path = cleanpath(repo, req.form['file'][0]) |
|
158 | 162 | if 'node' in req.form: |
|
159 | 163 | changeid = req.form['node'][0] |
|
164 | elif 'filenode' in req.form: | |
|
165 | changeid = req.form['filenode'][0] | |
|
160 | 166 | else: |
|
161 | changeid = req.form['filenode'][0] | |
|
167 | raise ErrorResponse(HTTP_NOT_FOUND, 'node or filenode not given') | |
|
162 | 168 | try: |
|
163 | 169 | fctx = repo[changeid][path] |
|
164 | 170 | except error.RepoError: |
General Comments 0
You need to be logged in to leave comments.
Login now