Show More
@@ -61,7 +61,7 b' try to clone via stream but missing requ' | |||||
61 | $ cat > $TESTTMP/removesupportedformat.py << EOF |
|
61 | $ cat > $TESTTMP/removesupportedformat.py << EOF | |
62 | > from mercurial import localrepo |
|
62 | > from mercurial import localrepo | |
63 | > def extsetup(ui): |
|
63 | > def extsetup(ui): | |
64 | > localrepo.localrepository.supportedformats.remove('generaldelta') |
|
64 | > localrepo.localrepository.supportedformats.remove(b'generaldelta') | |
65 | > EOF |
|
65 | > EOF | |
66 |
|
66 | |||
67 | $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3 |
|
67 | $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3 | |
@@ -170,12 +170,12 b' test http authentication' | |||||
170 | > import base64 |
|
170 | > import base64 | |
171 | > from mercurial.hgweb import common |
|
171 | > from mercurial.hgweb import common | |
172 | > def perform_authentication(hgweb, req, op): |
|
172 | > def perform_authentication(hgweb, req, op): | |
173 | > auth = req.headers.get('Authorization') |
|
173 | > auth = req.headers.get(b'Authorization') | |
174 | > if not auth: |
|
174 | > if not auth: | |
175 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
|
175 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who', | |
176 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
|
176 | > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')]) | |
177 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: |
|
177 | > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']: | |
178 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
|
178 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no') | |
179 | > def extsetup(): |
|
179 | > def extsetup(): | |
180 | > common.permhooks.insert(0, perform_authentication) |
|
180 | > common.permhooks.insert(0, perform_authentication) | |
181 | > EOT |
|
181 | > EOT | |
@@ -514,10 +514,10 b' We raise HTTP 500 because its message is' | |||||
514 | > from mercurial import util |
|
514 | > from mercurial import util | |
515 | > from mercurial.hgweb import common |
|
515 | > from mercurial.hgweb import common | |
516 | > def perform_authentication(hgweb, req, op): |
|
516 | > def perform_authentication(hgweb, req, op): | |
517 | > cookie = req.headers.get('Cookie') |
|
517 | > cookie = req.headers.get(b'Cookie') | |
518 | > if not cookie: |
|
518 | > if not cookie: | |
519 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'no-cookie') |
|
519 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie') | |
520 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'Cookie: %s' % cookie) |
|
520 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % cookie) | |
521 | > def extsetup(): |
|
521 | > def extsetup(): | |
522 | > common.permhooks.insert(0, perform_authentication) |
|
522 | > common.permhooks.insert(0, perform_authentication) | |
523 | > EOF |
|
523 | > EOF |
General Comments 0
You need to be logged in to leave comments.
Login now