Debian Codegraph @

tests/test-unbundlehash.t

raw
1 Test wire protocol unbundle with hashed heads (capability: unbundlehash)
2
3 $ cat << EOF >> $HGRCPATH
4 > [devel]
5 > # This tests is intended for bundle1 only.
6 > # bundle2 carries the head information inside the bundle itself and
7 > # always uses 'force' as the heads value.
8 > legacy.exchange = bundle1
9 > EOF
10
11 Create a remote repository.
12
13 $ hg init remote
14 $ hg serve -R remote --config web.push_ssl=False --config web.allow_push=* -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log
15 $ cat hg1.pid >> $DAEMON_PIDS
16
17 Clone the repository and push a change.
18
19 $ hg clone http://localhost:$HGPORT/ local
20 no changes found
21 updating to branch default
22 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 $ touch local/README
24 $ hg ci -R local -A -m hoge
25 adding README
26 $ hg push -R local
27 pushing to http://localhost:$HGPORT/
28 searching for changes
29 remote: adding changesets
30 remote: adding manifests
31 remote: adding file changes
32 remote: added 1 changesets with 1 changes to 1 files
33
34 Ensure hashed heads format is used.
35 The hash here is always the same since the remote repository only has the null head.
36
37 $ cat access.log | grep unbundle
38 * - - [*] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+6768033e216468247bd031a0a2d9876d79818f8f* (glob)
39
40 Explicitly kill daemons to let the test exit on Windows
41
42 $ killdaemons.py
43