##// END OF EJS Templates
http: pass user to readauthforuri() (fix 4a43e23b8c55)...
http: pass user to readauthforuri() (fix 4a43e23b8c55) urllib2 never handles URIs with credentials, we have to extract them and store them in the password manager before handing the stripped URI. Half of the changes deducing the username from the URI in 4a43e23b8c55 were incorrect. Instead, we retrieve the username from the password manager before passing to readauthforuri(). test-hgweb-auth.py was passing because the test itself was flawed: it was passing URIs with credentials to find_password(), which never happens.

File last commit:

r14161:8a0fca92 default
r15025:0593e8f8 stable
Show More
test-http.t
115 lines | 3.1 KiB | text/troff | Tads3Lexer
Matt Mackall
tests: unify test-http
r12446
$ hg init test
$ cd test
$ echo foo>foo
$ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
$ echo foo>foo.d/foo
$ echo bar>foo.d/bAr.hg.d/BaR
$ echo bar>foo.d/baR.d.hg/bAR
$ hg commit -A -m 1
adding foo
adding foo.d/bAr.hg.d/BaR
adding foo.d/baR.d.hg/bAR
adding foo.d/foo
Mads Kiilerich
hgweb: handle invalid requests with both form data and querystring...
r13445 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
Matt Mackall
tests: unify test-http
r12446 $ hg --config server.uncompressed=False serve -p $HGPORT1 -d --pid-file=../hg2.pid
Test server address cannot be reused
$ hg serve -p $HGPORT1 2>&1
Mads Kiilerich
tests: reintroduce ":$HGPORT" in test output...
r12643 abort: cannot start server at ':$HGPORT1': Address already in use
Matt Mackall
tests: unify test-http
r12446 [255]
$ cd ..
$ cat hg1.pid hg2.pid >> $DAEMON_PIDS
clone via stream
$ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1
streaming all changes
6 files to transfer, 606 bytes of data
Thomas Arendsen Hein
tests: check for (*/sec) instead of (*B/sec) to match (X bytes/sec)...
r14023 transferred * bytes in * seconds (*/sec) (glob)
Matt Mackall
tests: unify test-http
r12446 updating to branch default
4 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg verify -R copy
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
4 files, 1 changesets, 4 total revisions
try to clone via stream, should use pull instead
$ hg clone --uncompressed http://localhost:$HGPORT1/ copy2
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 4 changes to 4 files
updating to branch default
4 files updated, 0 files merged, 0 files removed, 0 files unresolved
clone via pull
$ hg clone http://localhost:$HGPORT1/ copy-pull
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 4 changes to 4 files
updating to branch default
4 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg verify -R copy-pull
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
4 files, 1 changesets, 4 total revisions
$ cd test
$ echo bar > bar
$ hg commit -A -d '1 0' -m 2
adding bar
$ cd ..
Peter Arrenbrecht
bundlerepo: fix and improve getremotechanges...
r14161 incoming via HTTP
$ hg clone http://localhost:$HGPORT1/ --rev 0 partial
adding changesets
adding manifests
adding file changes
added 1 changesets with 4 changes to 4 files
updating to branch default
4 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd partial
$ touch LOCAL
$ hg ci -qAm LOCAL
$ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
comparing with http://localhost:$HGPORT1/
searching for changes
2
$ cd ..
Matt Mackall
tests: unify test-http
r12446 pull
$ cd copy-pull
$ echo '[hooks]' >> .hg/hgrc
Mads Kiilerich
tests: use printenv.py where it is - don't copy it around
r13405 $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup' >> .hg/hgrc
Matt Mackall
tests: unify test-http
r12446 $ hg pull
Mads Kiilerich
tests: reintroduce ":$HGPORT" in test output...
r12643 pulling from http://localhost:$HGPORT1/
Matt Mackall
tests: unify test-http
r12446 searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
Mads Kiilerich
util: flush stdout before calling external processes...
r13439 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT1/
Matt Mackall
tests: unify test-http
r12446 (run 'hg update' to get a working copy)
$ cd ..
Mads Kiilerich
hgweb: handle invalid requests with both form data and querystring...
r13445
clone from invalid URL
$ hg clone http://localhost:$HGPORT/bad
abort: HTTP Error 404: Not Found
[255]
check error log
$ cat error.log