comparison tests/test-known.t @ 13723:e615765fdcc7

wireproto: add known([id]) function known([Node]) -> [1/0] Returns 1/0 for each node, indicating whether it's known by the server. Needed for new discovery protocols introduced in later patches.
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Tue, 22 Mar 2011 09:22:21 +0100
parents
children c5c9ca3719f9
comparison
equal deleted inserted replaced
13722:f4a85acef50c 13723:e615765fdcc7
1
2 = Test the known() protocol function =
3
4 Create a test repository:
5
6 $ hg init repo
7 $ cd repo
8 $ touch a ; hg add a ; hg ci -ma
9 $ touch b ; hg add b ; hg ci -mb
10 $ touch c ; hg add c ; hg ci -mc
11 $ hg log --template '{node}\n'
12 991a3460af53952d10ec8a295d3d2cc2e5fa9690
13 0e067c57feba1a5694ca4844f05588bb1bf82342
14 3903775176ed42b1458a6281db4a0ccf4d9f287a
15 $ cd ..
16
17 Test locally:
18
19 $ hg debugknown repo 991a3460af53952d10ec8a295d3d2cc2e5fa9690 0e067c57feba1a5694ca4844f05588bb1bf82342 3903775176ed42b1458a6281db4a0ccf4d9f287a
20 111
21 $ hg debugknown repo 000a3460af53952d10ec8a295d3d2cc2e5fa9690 0e067c57feba1a5694ca4844f05588bb1bf82342 0003775176ed42b1458a6281db4a0ccf4d9f287a
22 010
23 $ hg debugknown repo
24
25
26 Test via HTTP:
27
28 $ hg serve -R repo -p $HGPORT -d --pid-file=hg.pid -E error.log -A access.log
29 $ cat hg.pid >> $DAEMON_PIDS
30 $ hg debugknown http://localhost:$HGPORT/ 991a3460af53952d10ec8a295d3d2cc2e5fa9690 0e067c57feba1a5694ca4844f05588bb1bf82342 3903775176ed42b1458a6281db4a0ccf4d9f287a
31 111
32 $ hg debugknown http://localhost:$HGPORT/ 000a3460af53952d10ec8a295d3d2cc2e5fa9690 0e067c57feba1a5694ca4844f05588bb1bf82342 0003775176ed42b1458a6281db4a0ccf4d9f287a
33 010
34 $ hg debugknown http://localhost:$HGPORT/
35
36 $ cat error.log
37