tests/test-http-proxy
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
Thu, 04 Oct 2007 23:21:37 -0300
changeset 5378 8a2915f57dfc
parent 3012 fa4229c60dd7
child 5384 e3a0c092b4e2
permissions -rwxr-xr-x
convert: add a mode where mercurial_sink skips empty revisions. The getchanges function of some converter_source classes can return some false positives. I.e. they sometimes claim that a file "foo" was changed in some revision, even though its contents are still the same. convert_svn is particularly bad, but I think this can also happen with convert_cvs and, at least in theory, with mercurial_source. For regular conversions this is not really a problem - as long as getfile returns the right contents, we'll get a converted revision with the right contents. But when we use --filemap, this could lead to superfluous revisions being converted. Instead of fixing every converter_source, I decided to change mercurial_sink to work around this problem. When --filemap is used, we're interested only in revisions that touch some specific files. If a revision doesn't change any of these files, then we're not interested in it (at least for revisions with a single parent; merges are special). For mercurial_sink, we abuse this property and rollback a commit if the manifest text hasn't changed. This avoids duplicating the logic from localrepo.filecommit to detect unchanged files.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     2
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     3
hg init a
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     4
cd a
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     5
echo a > a
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     6
hg ci -Ama -d '1123456789 0'
2622
064aef9162cc rename stream hgrc option to compressed.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2621
diff changeset
     7
hg --config server.uncompressed=True serve -p 20059 -d --pid-file=hg.pid
2570
83cfd95eafb5 tests: add timeouts, make run-tests.py clean up dead daemon processes
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2542
diff changeset
     8
cat hg.pid >> $DAEMON_PIDS
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     9
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    10
cd ..
2570
83cfd95eafb5 tests: add timeouts, make run-tests.py clean up dead daemon processes
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2542
diff changeset
    11
("$TESTDIR/tinyproxy.py" 20060 localhost >proxy.log 2>&1 </dev/null &
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    12
echo $! > proxy.pid)
2570
83cfd95eafb5 tests: add timeouts, make run-tests.py clean up dead daemon processes
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2542
diff changeset
    13
cat proxy.pid >> $DAEMON_PIDS
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    14
sleep 2
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    15
2612
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2570
diff changeset
    16
echo %% url for proxy, stream
2621
5a5852a417b1 clone: disable stream support on server side by default.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2613
diff changeset
    17
http_proxy=http://localhost:20060/ hg --config http_proxy.always=True clone --uncompressed http://localhost:20059/ b | \
3012
fa4229c60dd7 Allow for MB/sec transfer rates in test-http-proxy and test-ssh.
Lee Cantey <lcantey@gmail.com>
parents: 2622
diff changeset
    18
  sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/'
2612
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2570
diff changeset
    19
cd b
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2570
diff changeset
    20
hg verify
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2570
diff changeset
    21
cd ..
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2570
diff changeset
    22
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2570
diff changeset
    23
echo %% url for proxy, pull
2613
479e26afa10f clone: do not make streaming default. add --stream option instead.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2612
diff changeset
    24
http_proxy=http://localhost:20060/ hg --config http_proxy.always=True clone http://localhost:20059/ b-pull
2612
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2570
diff changeset
    25
cd b-pull
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2570
diff changeset
    26
hg verify
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2570
diff changeset
    27
cd ..
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    28
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    29
echo %% host:port for proxy
2613
479e26afa10f clone: do not make streaming default. add --stream option instead.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2612
diff changeset
    30
http_proxy=localhost:20060 hg clone --config http_proxy.always=True http://localhost:20059/ c
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    31
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    32
echo %% proxy url with user name and password
2613
479e26afa10f clone: do not make streaming default. add --stream option instead.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2612
diff changeset
    33
http_proxy=http://user:passwd@localhost:20060 hg clone --config http_proxy.always=True http://localhost:20059/ d
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    34
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    35
echo %% url with user name and password
2613
479e26afa10f clone: do not make streaming default. add --stream option instead.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2612
diff changeset
    36
http_proxy=http://user:passwd@localhost:20060 hg clone --config http_proxy.always=True http://user:passwd@localhost:20059/ e
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    37
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    38
echo %% bad host:port for proxy
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    39
http_proxy=localhost:20061 hg clone --config http_proxy.always=True http://localhost:20059/ f
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    40
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    41
exit 0