Details
Details
- Reviewers
indygreg - Group Reviewers
hg-reviewers - Commits
- rHGa1110db1e455: hgweb: these strings should be sysstrs, not bytes
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
indygreg |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/hgweb/common.py (3 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 |
def __getattr__(self, attr): | def __getattr__(self, attr): | ||||
if attr in ('close', 'readline', 'readlines', '__iter__'): | if attr in ('close', 'readline', 'readlines', '__iter__'): | ||||
return getattr(self.f, attr) | return getattr(self.f, attr) | ||||
raise AttributeError | raise AttributeError | ||||
def _statusmessage(code): | def _statusmessage(code): | ||||
responses = httpserver.basehttprequesthandler.responses | responses = httpserver.basehttprequesthandler.responses | ||||
return responses.get(code, ('Error', 'Unknown error'))[0] | return pycompat.bytesurl( | ||||
responses.get(code, (r'Error', r'Unknown error'))[0]) | |||||
def statusmessage(code, message=None): | def statusmessage(code, message=None): | ||||
return '%d %s' % (code, message or _statusmessage(code)) | return '%d %s' % (code, message or _statusmessage(code)) | ||||
def get_stat(spath, fn): | def get_stat(spath, fn): | ||||
"""stat fn if it exists, spath otherwise""" | """stat fn if it exists, spath otherwise""" | ||||
cl_path = os.path.join(spath, fn) | cl_path = os.path.join(spath, fn) | ||||
if os.path.exists(cl_path): | if os.path.exists(cl_path): |