Mercurial > hg
comparison tests/test-bundle2-exchange.t @ 27246:b288fb2724bf
wireproto: config options to disable bundle1
bundle2 is the new and preferred wire protocol format. For various
reasons, server operators may wish to force clients to use it.
One reason is performance. If a repository is stored in generaldelta,
the server must recompute deltas in order to produce the bundle1
changegroup. This can be extremely expensive. For mozilla-central,
bundle generation typically takes a few minutes. However, generating
a non-gd bundle from a generaldelta encoded mozilla-central requires
over 30 minutes of CPU! If a large repository like mozilla-central
were encoded in generaldelta and non-gd clients connected, they could
easily flood a server by cloning.
This patch gives server operators config knobs to control whether
bundle1 is allowed for push and pull operations. The default is to
support legacy bundle1 clients, making this patch backwards compatible.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 04 Dec 2015 15:12:11 -0800 |
parents | 58f1645f72c3 |
children | 37d7cf569cf3 |
comparison
equal
deleted
inserted
replaced
27244:709977a4fc9d | 27246:b288fb2724bf |
---|---|
949 searching for changes | 949 searching for changes |
950 remote: adding changesets | 950 remote: adding changesets |
951 remote: adding manifests | 951 remote: adding manifests |
952 remote: adding file changes | 952 remote: adding file changes |
953 remote: added 1 changesets with 1 changes to 1 files | 953 remote: added 1 changesets with 1 changes to 1 files |
954 | |
955 $ cd .. | |
956 | |
957 Servers can disable bundle1 for clone/pull operations | |
958 | |
959 $ killdaemons.py | |
960 $ hg init bundle2onlyserver | |
961 $ cd bundle2onlyserver | |
962 $ cat > .hg/hgrc << EOF | |
963 > [server] | |
964 > bundle1.pull = false | |
965 > EOF | |
966 | |
967 $ touch foo | |
968 $ hg -q commit -A -m initial | |
969 | |
970 $ hg serve -p $HGPORT -d --pid-file=hg.pid | |
971 $ cat hg.pid >> $DAEMON_PIDS | |
972 | |
973 $ hg --config experimental.bundle2-exp=false clone http://localhost:$HGPORT/ not-bundle2 | |
974 requesting all changes | |
975 abort: remote error: | |
976 incompatible Mercurial client; bundle2 required | |
977 (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |
978 [255] | |
979 $ killdaemons.py | |
980 | |
981 Verify the global server.bundle1 option works | |
982 | |
983 $ cat > .hg/hgrc << EOF | |
984 > [server] | |
985 > bundle1 = false | |
986 > EOF | |
987 $ hg serve -p $HGPORT -d --pid-file=hg.pid | |
988 $ cat hg.pid >> $DAEMON_PIDS | |
989 $ hg --config experimental.bundle2-exp=false clone http://localhost:$HGPORT not-bundle2 | |
990 requesting all changes | |
991 abort: remote error: | |
992 incompatible Mercurial client; bundle2 required | |
993 (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |
994 [255] | |
995 $ killdaemons.py | |
996 | |
997 Verify bundle1 pushes can be disabled | |
998 | |
999 $ cat > .hg/hgrc << EOF | |
1000 > [server] | |
1001 > bundle1.push = false | |
1002 > [web] | |
1003 > allow_push = * | |
1004 > push_ssl = false | |
1005 > EOF | |
1006 | |
1007 $ hg serve -p $HGPORT -d --pid-file=hg.pid -E error.log | |
1008 $ cat hg.pid >> $DAEMON_PIDS | |
1009 $ cd .. | |
1010 | |
1011 $ hg clone http://localhost:$HGPORT bundle2-only | |
1012 requesting all changes | |
1013 adding changesets | |
1014 adding manifests | |
1015 adding file changes | |
1016 added 1 changesets with 1 changes to 1 files | |
1017 updating to branch default | |
1018 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1019 $ cd bundle2-only | |
1020 $ echo commit > foo | |
1021 $ hg commit -m commit | |
1022 $ hg --config experimental.bundle2-exp=false push | |
1023 pushing to http://localhost:$HGPORT/ | |
1024 searching for changes | |
1025 abort: remote error: | |
1026 incompatible Mercurial client; bundle2 required | |
1027 (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |
1028 [255] | |
1029 | |
1030 $ hg push | |
1031 pushing to http://localhost:$HGPORT/ | |
1032 searching for changes | |
1033 remote: adding changesets | |
1034 remote: adding manifests | |
1035 remote: adding file changes | |
1036 remote: added 1 changesets with 1 changes to 1 files |