Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
durin42 |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/hgweb/webutil.py (7 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
} | } | ||||
return entries | return entries | ||||
def cleanpath(repo, path): | def cleanpath(repo, path): | ||||
path = path.lstrip('/') | path = path.lstrip('/') | ||||
return pathutil.canonpath(repo.root, '', path) | return pathutil.canonpath(repo.root, '', path) | ||||
def changeidctx(repo, changeid): | |||||
return repo[changeid] | |||||
def changectx(repo, req): | def changectx(repo, req): | ||||
changeid = "tip" | changeid = "tip" | ||||
if 'node' in req.qsparams: | if 'node' in req.qsparams: | ||||
changeid = req.qsparams['node'] | changeid = req.qsparams['node'] | ||||
ipos = changeid.find(':') | ipos = changeid.find(':') | ||||
if ipos != -1: | if ipos != -1: | ||||
changeid = changeid[(ipos + 1):] | changeid = changeid[(ipos + 1):] | ||||
return changeidctx(repo, changeid) | return repo[changeid] | ||||
def basechangectx(repo, req): | def basechangectx(repo, req): | ||||
if 'node' in req.qsparams: | if 'node' in req.qsparams: | ||||
changeid = req.qsparams['node'] | changeid = req.qsparams['node'] | ||||
ipos = changeid.find(':') | ipos = changeid.find(':') | ||||
if ipos != -1: | if ipos != -1: | ||||
changeid = changeid[:ipos] | changeid = changeid[:ipos] | ||||
return changeidctx(repo, changeid) | return repo[changeid] | ||||
return None | return None | ||||
def filectx(repo, req): | def filectx(repo, req): | ||||
if 'file' not in req.qsparams: | if 'file' not in req.qsparams: | ||||
raise ErrorResponse(HTTP_NOT_FOUND, 'file not given') | raise ErrorResponse(HTTP_NOT_FOUND, 'file not given') | ||||
path = cleanpath(repo, req.qsparams['file']) | path = cleanpath(repo, req.qsparams['file']) | ||||
if 'node' in req.qsparams: | if 'node' in req.qsparams: |