##// END OF EJS Templates
wireprotov2: define and implement "manifestdata" command...
wireprotov2: define and implement "manifestdata" command The added command can be used for obtaining manifest data. Given a manifest path and set of manifest nodes, data about manifests can be retrieved. Unlike changeset data, we wish to emit deltas to describe manifest revisions. So the command uses the relatively new API for building delta requests and emitting them. The code calls into deltaparent(), which I'm not very keen of. There's still work to be done in delta generation land so implementation details of storage (e.g. exactly one delta is stored/available) don't creep into higher levels. But we can worry about this later (there is already a TODO on imanifestorage tracking this). On the subject of parent deltas, the server assumes parent revisions exist on the receiving end. This is obviously wrong for shallow clone. I've added TODOs to add a mechanism to the command to allow clients to specify desired behavior. This shouldn't be too difficult to implement. Another big change is that the client must explicitly request manifest nodes to retrieve. This is a major departure from "getbundle," where the server derives relevant manifests as it iterates changesets and sends them automatically. As implemented, the client must transmit each requested node to the server. At 20 bytes per node, we're looking at 2 MB per 100,000 nodes. Plus wire encoding overhead. This isn't ideal for clients with limited upload bandwidth. I plan to address this in the future by allowing alternate mechanisms for defining the revisions to retrieve. One idea is to define a range of changeset revisions whose manifest revisions to retrieve (similar to how "changesetdata" works). We almost certainly want an API to look up an individual manifest by node. And that's where I've chosen to start with the implementation. Again, a theme of this early exchangev2 work is I want to start by building primitives for accessing raw repository data first and see how far we can get with those before we need more complexity. Differential Revision: https://phab.mercurial-scm.org/D4488

File last commit:

r39525:f1186c29 default
r39673:c7a7c7e8 default
Show More
test-http.t
563 lines | 22.7 KiB | text/troff | Tads3Lexer
Gregory Szorc
tests: remove #require killdaemons...
r37864 #require serve
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
Jun Wu
tests: reorder hg serve commands...
r28549 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
Matt Mackall
tests: unify test-http
r12446
Test server address cannot be reused
Adrian Buehlmann
test-http and test-https: partially adapt for Windows
r17023 $ hg serve -p $HGPORT1 2>&1
Matt Harbison
tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages...
r35233 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
Adrian Buehlmann
test-http and test-https: partially adapt for Windows
r17023 [255]
Matt Harbison
tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages...
r35233
Matt Mackall
tests: unify test-http
r12446 $ cd ..
$ cat hg1.pid hg2.pid >> $DAEMON_PIDS
clone via stream
Gregory Szorc
tests: disable tests for advanced clone features with simple store...
r37367 #if no-reposimplestore
Gregory Szorc
commands: rename clone --uncompressed to --stream and document...
r34394 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
Matt Mackall
tests: unify test-http
r12446 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)
Durham Goode
clone: fix copying bookmarks in uncompressed clones (issue4430)...
r23116 searching for changes
no changes found
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
Meirambek Omyrzak
verify: make output less confusing (issue5924)...
r39525 checked 1 changesets with 4 changes to 4 files
Gregory Szorc
tests: disable tests for advanced clone features with simple store...
r37367 #endif
Matt Mackall
tests: unify test-http
r12446
try to clone via stream, should use pull instead
Gregory Szorc
commands: rename clone --uncompressed to --stream and document...
r34394 $ hg clone --stream http://localhost:$HGPORT1/ copy2
Siddharth Agarwal
clone: warn when streaming was requested but couldn't be performed...
r32259 warning: stream clone requested but server has them disabled
Matt Mackall
tests: unify test-http
r12446 requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 4 changes to 4 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 8b6053c928fe
Matt Mackall
tests: unify test-http
r12446 updating to branch default
4 files updated, 0 files merged, 0 files removed, 0 files unresolved
Siddharth Agarwal
clone: test streaming disabled because client is missing requirement...
r32258 try to clone via stream but missing requirements, so should use pull instead
$ cat > $TESTTMP/removesupportedformat.py << EOF
> from mercurial import localrepo
> def extsetup(ui):
Augie Fackler
tests: port inline extensions in test-http.t to Python 3...
r37751 > localrepo.localrepository.supportedformats.remove(b'generaldelta')
Siddharth Agarwal
clone: test streaming disabled because client is missing requirement...
r32258 > EOF
Gregory Szorc
commands: rename clone --uncompressed to --stream and document...
r34394 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
Siddharth Agarwal
clone: warn when streaming was requested but couldn't be performed...
r32259 warning: stream clone requested but client is missing requirements: generaldelta
(see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
Siddharth Agarwal
clone: test streaming disabled because client is missing requirement...
r32258 requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 4 changes to 4 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 8b6053c928fe
Siddharth Agarwal
clone: test streaming disabled because client is missing requirement...
r32258 updating to branch default
4 files updated, 0 files merged, 0 files removed, 0 files unresolved
Matt Mackall
tests: unify test-http
r12446 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
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 8b6053c928fe
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-pull
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
Meirambek Omyrzak
verify: make output less confusing (issue5924)...
r39525 checked 1 changesets with 4 changes to 4 files
Matt Mackall
tests: unify test-http
r12446 $ cd test
$ echo bar > bar
$ hg commit -A -d '1 0' -m 2
adding bar
$ cd ..
Augie Fackler
clone: don't fail with --update for non-local clones (issue3578)...
r17342 clone over http with --update
$ hg clone http://localhost:$HGPORT1/ updated --update 0
requesting all changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 5 changes to 5 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 8b6053c928fe:5fed3813f7f5
Augie Fackler
clone: don't fail with --update for non-local clones (issue3578)...
r17342 updating to branch default
4 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg log -r . -R updated
changeset: 0:8b6053c928fe
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 1
$ rm -rf updated
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
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 8b6053c928fe
Peter Arrenbrecht
bundlerepo: fix and improve getremotechanges...
r14161 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
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 $ cat >> .hg/hgrc <<EOF
> [hooks]
> changegroup = sh -c "printenv.py changegroup"
> EOF
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
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 5fed3813f7f5
Pierre-Yves David
hook: add hook name information to external hook...
r31747 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ 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]
Mads Kiilerich
test-http: test http authentication...
r15026 test http authentication
Benoit Allard
protocol: Add the stream-preferred capability...
r16361 + use the same server to test server side streaming preference
Mads Kiilerich
test-http: test http authentication...
r15026
$ cd test
$ cat << EOT > userpass.py
> import base64
> from mercurial.hgweb import common
> def perform_authentication(hgweb, req, op):
Augie Fackler
tests: port inline extensions in test-http.t to Python 3...
r37751 > auth = req.headers.get(b'Authorization')
Mads Kiilerich
test-http: test http authentication...
r15026 > if not auth:
Augie Fackler
tests: port inline extensions in test-http.t to Python 3...
r37751 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
> [(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
> if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']:
> raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
Mads Kiilerich
test-http: test http authentication...
r15026 > def extsetup():
> common.permhooks.insert(0, perform_authentication)
> EOT
Jun Wu
tests: reorder hg serve commands...
r28549 $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \
Mads Kiilerich
tests: improved test coverage for HTTP authentication and 401 responses...
r20385 > --config server.preferuncompressed=True \
> --config web.push_ssl=False --config web.allow_push=* -A ../access.log
Mads Kiilerich
test-http: test http authentication...
r15026 $ cat pid >> $DAEMON_PIDS
Lucas Moscovicz
url: added authuri when login information is requested (issue3209)...
r20291 $ cat << EOF > get_pass.py
> import getpass
> def newgetpass(arg):
> return "pass"
> getpass.getpass = newgetpass
> EOF
Augie Fackler
clone: don't fail with --update for non-local clones (issue3578)...
r17342 $ hg id http://localhost:$HGPORT2/
Lucas Moscovicz
url: added authuri when login information is requested (issue3209)...
r20291 abort: http authorization required for http://localhost:$HGPORT2/
Mads Kiilerich
test-http: test http authentication...
r15026 [255]
Lucas Moscovicz
url: added authuri when login information is requested (issue3209)...
r20291 $ hg id http://localhost:$HGPORT2/
abort: http authorization required for http://localhost:$HGPORT2/
Mads Kiilerich
test-http: test http authentication...
r15026 [255]
Lucas Moscovicz
url: added authuri when login information is requested (issue3209)...
r20291 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
http authorization required for http://localhost:$HGPORT2/
realm: mercurial
user: user
password: 5fed3813f7f5
Mads Kiilerich
test-http: test http authentication...
r15026 $ hg id http://user:pass@localhost:$HGPORT2/
5fed3813f7f5
Augie Fackler
clone: don't fail with --update for non-local clones (issue3578)...
r17342 $ echo '[auth]' >> .hg/hgrc
Mads Kiilerich
test-http: test http authentication...
r15026 $ echo 'l.schemes=http' >> .hg/hgrc
$ echo 'l.prefix=lo' >> .hg/hgrc
$ echo 'l.username=user' >> .hg/hgrc
$ echo 'l.password=pass' >> .hg/hgrc
Augie Fackler
clone: don't fail with --update for non-local clones (issue3578)...
r17342 $ hg id http://localhost:$HGPORT2/
Mads Kiilerich
test-http: test http authentication...
r15026 5fed3813f7f5
Augie Fackler
clone: don't fail with --update for non-local clones (issue3578)...
r17342 $ hg id http://localhost:$HGPORT2/
Mads Kiilerich
test-http: test http authentication...
r15026 5fed3813f7f5
Augie Fackler
clone: don't fail with --update for non-local clones (issue3578)...
r17342 $ hg id http://user@localhost:$HGPORT2/
Mads Kiilerich
test-http: test http authentication...
r15026 5fed3813f7f5
Gregory Szorc
tests: disable tests for advanced clone features with simple store...
r37367
#if no-reposimplestore
Benoit Allard
protocol: Add the stream-preferred capability...
r16361 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
streaming all changes
7 files to transfer, 916 bytes of data
transferred * bytes in * seconds (*/sec) (glob)
Durham Goode
clone: fix copying bookmarks in uncompressed clones (issue4430)...
r23116 searching for changes
no changes found
Benoit Allard
protocol: Add the stream-preferred capability...
r16361 updating to branch default
5 files updated, 0 files merged, 0 files removed, 0 files unresolved
Gregory Szorc
tests: disable tests for advanced clone features with simple store...
r37367 #endif
Siddharth Agarwal
localrepo.clone: add a way to override server preferuncompressed...
r23546 --pull should override server's preferuncompressed
$ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
requesting all changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 5 changes to 5 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 8b6053c928fe:5fed3813f7f5
Siddharth Agarwal
localrepo.clone: add a way to override server preferuncompressed...
r23546 updating to branch default
5 files updated, 0 files merged, 0 files removed, 0 files unresolved
Benoit Allard
protocol: Add the stream-preferred capability...
r16361
Augie Fackler
clone: don't fail with --update for non-local clones (issue3578)...
r17342 $ hg id http://user2@localhost:$HGPORT2/
Lucas Moscovicz
url: added authuri when login information is requested (issue3209)...
r20291 abort: http authorization required for http://localhost:$HGPORT2/
Mads Kiilerich
test-http: test http authentication...
r15026 [255]
$ hg id http://user:pass2@localhost:$HGPORT2/
abort: HTTP Error 403: no
[255]
Mads Kiilerich
tests: improved test coverage for HTTP authentication and 401 responses...
r20385
Gregory Szorc
tests: disable tests for advanced clone features with simple store...
r37367 $ hg -R dest-pull tag -r tip top
$ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
Mads Kiilerich
tests: improved test coverage for HTTP authentication and 401 responses...
r20385 pushing to http://user:***@localhost:$HGPORT2/
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
$ hg rollback -q
Gregory Szorc
tests: disable tests for advanced clone features with simple store...
r37367 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ --debug --config devel.debug.peer-request=yes
Boris Feld
http: add a debug version of the push test...
r35714 pushing to http://user:***@localhost:$HGPORT2/
using http://localhost:$HGPORT2/
http auth: user user, password ****
sending capabilities command
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities
Gregory Szorc
wireproto: declare operation type for most commands (BC) (SEC)...
r36772 http auth: user user, password ****
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: finished in *.???? seconds (200) (glob)
Boris Feld
http: add a debug version of the push test...
r35714 query 1; heads
Boris Feld
peer-request: include more details about batch commands...
r36963 devel-peer-request: batched-content
devel-peer-request: - heads (0 arguments)
devel-peer-request: - known (1 arguments)
Boris Feld
http: add a debug version of the push test...
r35714 sending batch command
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch
devel-peer-request: Vary X-HgArg-1,X-HgProto-1
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: 68 bytes of commands arguments in headers
devel-peer-request: finished in *.???? seconds (200) (glob)
Boris Feld
http: add a debug version of the push test...
r35714 searching for changes
all remote heads known locally
preparing listkeys for "phases"
sending listkeys command
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
devel-peer-request: Vary X-HgArg-1,X-HgProto-1
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: 16 bytes of commands arguments in headers
devel-peer-request: finished in *.???? seconds (200) (glob)
Boris Feld
http: add a debug version of the push test...
r35714 received listkey for "phases": 58 bytes
checking for updated bookmarks
preparing listkeys for "bookmarks"
sending listkeys command
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
devel-peer-request: Vary X-HgArg-1,X-HgProto-1
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: 19 bytes of commands arguments in headers
devel-peer-request: finished in *.???? seconds (200) (glob)
Boris Feld
http: add a debug version of the push test...
r35714 received listkey for "bookmarks": 0 bytes
sending branchmap command
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap
devel-peer-request: Vary X-HgProto-1
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: finished in *.???? seconds (200) (glob)
Boris Feld
http: add a debug version of the push test...
r35714 preparing listkeys for "bookmarks"
sending listkeys command
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
devel-peer-request: Vary X-HgArg-1,X-HgProto-1
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: 19 bytes of commands arguments in headers
devel-peer-request: finished in *.???? seconds (200) (glob)
Boris Feld
http: add a debug version of the push test...
r35714 received listkey for "bookmarks": 0 bytes
1 changesets found
list of changesets:
7f4e523d01f2cc3765ac8934da3d14db775ff872
bundle2-output-bundle: "HG20", 5 parts total
Boris Feld
revbranchcache: advertise and use 'rbc' exchange capability...
r36986 bundle2-output-part: "replycaps" 205 bytes payload
Boris Feld
http: add a debug version of the push test...
r35714 bundle2-output-part: "check:phases" 24 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
bundle2-output-part: "phase-heads" 24 bytes payload
sending unbundle command
Boris Feld
revbranchcache: advertise and use 'rbc' exchange capability...
r36986 sending 1013 bytes
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: POST http://localhost:$HGPORT2/?cmd=unbundle
Boris Feld
revbranchcache: advertise and use 'rbc' exchange capability...
r36986 devel-peer-request: Content-length 1013
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: Content-type application/mercurial-0.1
devel-peer-request: Vary X-HgArg-1,X-HgProto-1
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: 16 bytes of commands arguments in headers
Boris Feld
revbranchcache: advertise and use 'rbc' exchange capability...
r36986 devel-peer-request: 1013 bytes of data
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: finished in *.???? seconds (200) (glob)
Boris Feld
http: add a debug version of the push test...
r35714 bundle2-input-bundle: no-transaction
bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
bundle2-input-part: "output" (advisory) (params: 0 advisory) supported
bundle2-input-part: total payload size 100
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
bundle2-input-part: "output" (advisory) supported
bundle2-input-bundle: 2 parts total
preparing listkeys for "phases"
sending listkeys command
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
devel-peer-request: Vary X-HgArg-1,X-HgProto-1
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Boris Feld
httppeer: add support for tracing all http request made by the peer...
r35716 devel-peer-request: 16 bytes of commands arguments in headers
devel-peer-request: finished in *.???? seconds (200) (glob)
Boris Feld
http: add a debug version of the push test...
r35714 received listkey for "phases": 15 bytes
$ hg rollback -q
Mads Kiilerich
tests: improved test coverage for HTTP authentication and 401 responses...
r20385
Augie Fackler
test-http: use sed instead of fixed-with cut for reading access.log...
r29564 $ sed 's/.*] "/"/' < ../access.log
Gregory Szorc
httppeer: only advertise partial-pull if capabilities are known...
r37574 "GET /?cmd=capabilities HTTP/1.1" 401 -
"GET /?cmd=capabilities HTTP/1.1" 401 -
"GET /?cmd=capabilities HTTP/1.1" 401 -
"GET /?cmd=capabilities HTTP/1.1" 200 -
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Gregory Szorc
httppeer: only advertise partial-pull if capabilities are known...
r37574 "GET /?cmd=capabilities HTTP/1.1" 401 -
"GET /?cmd=capabilities HTTP/1.1" 200 -
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Gregory Szorc
httppeer: only advertise partial-pull if capabilities are known...
r37574 "GET /?cmd=capabilities HTTP/1.1" 401 -
"GET /?cmd=capabilities HTTP/1.1" 200 -
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Gregory Szorc
httppeer: only advertise partial-pull if capabilities are known...
r37574 "GET /?cmd=capabilities HTTP/1.1" 401 -
"GET /?cmd=capabilities HTTP/1.1" 200 -
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Gregory Szorc
httppeer: only advertise partial-pull if capabilities are known...
r37574 "GET /?cmd=capabilities HTTP/1.1" 401 -
"GET /?cmd=capabilities HTTP/1.1" 200 -
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Gregory Szorc
httppeer: only advertise partial-pull if capabilities are known...
r37574 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
"GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
"GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
"GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
"GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
Gregory Szorc
httppeer: only advertise partial-pull if capabilities are known...
r37574 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
"GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Gregory Szorc
httppeer: only advertise partial-pull if capabilities are known...
r37574 "GET /?cmd=capabilities HTTP/1.1" 401 -
"GET /?cmd=capabilities HTTP/1.1" 401 -
"GET /?cmd=capabilities HTTP/1.1" 403 -
"GET /?cmd=capabilities HTTP/1.1" 401 -
"GET /?cmd=capabilities HTTP/1.1" 200 -
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
timeless
tests: tolerate http2...
r28996 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob)
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Gregory Szorc
httppeer: only advertise partial-pull if capabilities are known...
r37574 "GET /?cmd=capabilities HTTP/1.1" 401 -
"GET /?cmd=capabilities HTTP/1.1" 200 -
Joerg Sonnenberger
wireproto: support for pullbundles...
r37516 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
Mads Kiilerich
tests: improved test coverage for HTTP authentication and 401 responses...
r20385
Mads Kiilerich
test-http: test http authentication...
r15026 $ cd ..
Mads Kiilerich
subrepo: fix cloning of repos from urls without slash after host (issue2970)...
r15055 clone of serve with repo in root and unserved subrepo (issue2970)
$ hg --cwd test init sub
Brad Hall
tag: don't allow tagging the null revision (issue1915)...
r17260 $ echo empty > test/sub/empty
$ hg --cwd test/sub add empty
$ hg --cwd test/sub commit -qm 'add empty'
$ hg --cwd test/sub tag -r 0 something
Mads Kiilerich
subrepo: fix cloning of repos from urls without slash after host (issue2970)...
r15055 $ echo sub = sub > test/.hgsub
$ hg --cwd test add .hgsub
$ hg --cwd test commit -qm 'add subrepo'
$ hg clone http://localhost:$HGPORT noslash-clone
requesting all changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 7 changes to 7 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 8b6053c928fe:56f9bc90cce6
Mads Kiilerich
subrepo: fix cloning of repos from urls without slash after host (issue2970)...
r15055 updating to branch default
abort: HTTP Error 404: Not Found
[255]
$ hg clone http://localhost:$HGPORT/ slash-clone
requesting all changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 7 changes to 7 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 8b6053c928fe:56f9bc90cce6
Mads Kiilerich
subrepo: fix cloning of repos from urls without slash after host (issue2970)...
r15055 updating to branch default
abort: HTTP Error 404: Not Found
[255]
Mads Kiilerich
hgweb: handle invalid requests with both form data and querystring...
r13445 check error log
$ cat error.log
Pierre-Yves David
wireproto: properly report server Abort during 'getbundle'...
r30914
check abort error reporting while pulling/cloning
$ $RUNTESTDIR/killdaemons.py
Saurabh Singh
serve: make tests compatible with chg...
r34484 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
Pierre-Yves David
wireproto: properly report server Abort during 'getbundle'...
r30914 $ cat hg3.pid >> $DAEMON_PIDS
$ hg clone http://localhost:$HGPORT/ abort-clone
requesting all changes
remote: abort: this is an exercise
abort: pull failed on remote
[255]
$ cat error.log
Gregory Szorc
url: support auth.cookiesfile for adding cookies to HTTP requests...
r31936
Siddharth Agarwal
clone: add a server-side option to disable full getbundles (pull-based clones)...
r32260 disable pull-based clones
Saurabh Singh
serve: make tests compatible with chg...
r34484 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
Siddharth Agarwal
clone: add a server-side option to disable full getbundles (pull-based clones)...
r32260 $ cat hg4.pid >> $DAEMON_PIDS
$ hg clone http://localhost:$HGPORT1/ disable-pull-clone
requesting all changes
remote: abort: server has pull-based clones disabled
abort: pull failed on remote
(remove --pull if specified or upgrade Mercurial)
[255]
Gregory Szorc
tests: conditionalize tests for various repo features...
r37434 #if no-reposimplestore
Siddharth Agarwal
clone: add a server-side option to disable full getbundles (pull-based clones)...
r32260 ... but keep stream clones working
Gregory Szorc
commands: rename clone --uncompressed to --stream and document...
r34394 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
Siddharth Agarwal
clone: add a server-side option to disable full getbundles (pull-based clones)...
r32260 streaming all changes
* files to transfer, * of data (glob)
transferred * in * seconds (*/sec) (glob)
searching for changes
no changes found
$ cat error.log
Gregory Szorc
tests: conditionalize tests for various repo features...
r37434 #endif
Siddharth Agarwal
clone: add a server-side option to disable full getbundles (pull-based clones)...
r32260
... and also keep partial clones and pulls working
Matt Harbison
tests: demonstrate an inconsistency when cloning to a missing directory tree...
r39220 $ hg clone http://localhost:$HGPORT1 --rev 0 test/partial/clone
Siddharth Agarwal
clone: add a server-side option to disable full getbundles (pull-based clones)...
r32260 adding changesets
adding manifests
adding file changes
added 1 changesets with 4 changes to 4 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 8b6053c928fe
Siddharth Agarwal
clone: add a server-side option to disable full getbundles (pull-based clones)...
r32260 updating to branch default
4 files updated, 0 files merged, 0 files removed, 0 files unresolved
Matt Harbison
tests: demonstrate an inconsistency when cloning to a missing directory tree...
r39220 $ hg pull -R test/partial/clone
Siddharth Agarwal
clone: add a server-side option to disable full getbundles (pull-based clones)...
r32260 pulling from http://localhost:$HGPORT1/
searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 3 changes to 3 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 5fed3813f7f5:56f9bc90cce6
Siddharth Agarwal
clone: add a server-side option to disable full getbundles (pull-based clones)...
r32260 (run 'hg update' to get a working copy)
Matt Harbison
clone: allow local cloning to create more than one level of directories...
r39221 $ hg clone -U -r 0 test/partial/clone test/another/clone
adding changesets
adding manifests
adding file changes
added 1 changesets with 4 changes to 4 files
new changesets 8b6053c928fe
Matt Harbison
tests: demonstrate an inconsistency when cloning to a missing directory tree...
r39220
Gregory Szorc
url: support auth.cookiesfile for adding cookies to HTTP requests...
r31936 corrupt cookies file should yield a warning
$ cat > $TESTTMP/cookies.txt << EOF
> bad format
> EOF
$ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/
Matt Harbison
test-http: add a (glob) for Windows...
r32008 (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob)
Gregory Szorc
url: support auth.cookiesfile for adding cookies to HTTP requests...
r31936 56f9bc90cce6
$ killdaemons.py
Create dummy authentication handler that looks for cookies. It doesn't do anything
useful. It just raises an HTTP 500 with details about the Cookie request header.
We raise HTTP 500 because its message is printed in the abort message.
$ cat > cookieauth.py << EOF
> from mercurial import util
> from mercurial.hgweb import common
> def perform_authentication(hgweb, req, op):
Augie Fackler
tests: port inline extensions in test-http.t to Python 3...
r37751 > cookie = req.headers.get(b'Cookie')
Gregory Szorc
url: support auth.cookiesfile for adding cookies to HTTP requests...
r31936 > if not cookie:
Augie Fackler
tests: port inline extensions in test-http.t to Python 3...
r37751 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie')
> raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % cookie)
Gregory Szorc
url: support auth.cookiesfile for adding cookies to HTTP requests...
r31936 > def extsetup():
> common.permhooks.insert(0, perform_authentication)
> EOF
$ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid
$ cat pid > $DAEMON_PIDS
Request without cookie sent should fail due to lack of cookie
$ hg id http://localhost:$HGPORT
abort: HTTP Error 500: no-cookie
[255]
Populate a cookies file
$ cat > cookies.txt << EOF
> # HTTP Cookie File
> # Expiration is 2030-01-01 at midnight
> .example.com TRUE / FALSE 1893456000 hgkey examplevalue
> EOF
Should not send a cookie for another domain
$ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
abort: HTTP Error 500: no-cookie
[255]
Add a cookie entry for our test server and verify it is sent
$ cat >> cookies.txt << EOF
> localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue
> EOF
$ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
abort: HTTP Error 500: Cookie: hgkey=localhostvalue
[255]