|
1 |
|
2 $ . ${TESTDIR}/testlib/pythonpath.sh |
|
3 |
|
4 $ cat >> $HGRCPATH <<EOF |
|
5 > [defaults] |
|
6 > amend=-d "0 0" |
|
7 > [web] |
|
8 > push_ssl = false |
|
9 > allow_push = * |
|
10 > [phases] |
|
11 > publish = False |
|
12 > [experimental] |
|
13 > bundle2-exp=False |
|
14 > [devel] |
|
15 > legacy.exchange=bundle1 |
|
16 > [extensions] |
|
17 > EOF |
|
18 |
|
19 $ mkcommit() { |
|
20 > echo "$1" > "$1" |
|
21 > hg add "$1" |
|
22 > hg ci -m "add $1" |
|
23 > } |
|
24 |
|
25 |
|
26 $ hg init server |
|
27 |
|
28 Try the multiple ways to setup the extension |
|
29 |
|
30 $ hg -R server log --config 'extensions.evolve.serveronly=' |
|
31 $ hg -R server log --config "extensions.evolve.serveronly=${SRCDIR}/hgext3rd/evolve/serveronly.py" |
|
32 $ PYTHONPATH=$HGTEST_ORIG_PYTHONPATH hg -R server log --config "extensions.evolve.serveronly=${SRCDIR}/hgext3rd/evolve/serveronly.py" |
|
33 |
|
34 setup repo |
|
35 |
|
36 $ echo "[extensions]" >> ./server/.hg/hgrc |
|
37 $ echo "evolve.serveronly=" >> ./server/.hg/hgrc |
|
38 $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log --traceback |
|
39 $ cat hg.pid >> $DAEMON_PIDS |
|
40 |
|
41 $ hg clone http://localhost:$HGPORT/ client |
|
42 no changes found |
|
43 updating to branch default |
|
44 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
45 $ cat ./errors.log |
|
46 $ echo "[extensions]" >> ./client/.hg/hgrc |
|
47 $ echo "evolve=" >> ./client/.hg/hgrc |
|
48 $ cp -r client other |
|
49 |
|
50 Smoke testing |
|
51 =============== |
|
52 |
|
53 $ cd client |
|
54 $ mkcommit 0 |
|
55 $ mkcommit a |
|
56 $ hg push |
|
57 pushing to http://localhost:$HGPORT/ |
|
58 searching for changes |
|
59 remote: adding changesets |
|
60 remote: adding manifests |
|
61 remote: adding file changes |
|
62 remote: added 2 changesets with 2 changes to 2 files |
|
63 $ hg pull |
|
64 pulling from http://localhost:$HGPORT/ |
|
65 searching for changes |
|
66 no changes found |
|
67 $ cat ../errors.log |
|
68 $ hg pull -R ../other |
|
69 pulling from http://localhost:$HGPORT/ |
|
70 requesting all changes |
|
71 adding changesets |
|
72 adding manifests |
|
73 adding file changes |
|
74 added 2 changesets with 2 changes to 2 files |
|
75 pull obsolescence markers |
|
76 the remote repository use years old versions of Mercurial and evolve |
|
77 pulling obsmarker using legacy method |
|
78 (please upgrade your server) |
|
79 (run 'hg update' to get a working copy) |
|
80 $ cat ../errors.log |
|
81 $ hg push -R ../other |
|
82 pushing to http://localhost:$HGPORT/ |
|
83 searching for changes |
|
84 no changes found |
|
85 [1] |
|
86 $ cat ../errors.log |
|
87 |
|
88 Capacity testing |
|
89 =================== |
|
90 |
|
91 $ curl -s http://localhost:$HGPORT/?cmd=hello |
|
92 capabilities: _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (glob) |
|
93 $ curl -s http://localhost:$HGPORT/?cmd=capabilities |
|
94 _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (no-eol) (glob) |
|
95 |
|
96 $ curl -s "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces" | sort |
|
97 bookmarks |
|
98 namespaces |
|
99 obsolete |
|
100 phases |
|
101 |
|
102 Push |
|
103 ============= |
|
104 |
|
105 $ echo 'A' > a |
|
106 $ hg amend |
|
107 $ hg push |
|
108 pushing to http://localhost:$HGPORT/ |
|
109 searching for changes |
|
110 remote: adding changesets |
|
111 remote: adding manifests |
|
112 remote: adding file changes |
|
113 remote: added 1 changesets with 1 changes to 1 files (+1 heads) |
|
114 the remote repository use years old versions of Mercurial and evolve |
|
115 pushing obsmarker using legacy method |
|
116 (please upgrade your server) |
|
117 pushing 2 obsolescence markers (* bytes) (glob) |
|
118 remote: 2 obsolescence markers added |
|
119 $ cat ../errors.log |
|
120 $ hg push |
|
121 pushing to http://localhost:$HGPORT/ |
|
122 searching for changes |
|
123 no changes found |
|
124 [1] |
|
125 $ cat ../errors.log |
|
126 |
|
127 Pull |
|
128 ============= |
|
129 |
|
130 $ hg -R ../other pull |
|
131 pulling from http://localhost:$HGPORT/ |
|
132 searching for changes |
|
133 adding changesets |
|
134 adding manifests |
|
135 adding file changes |
|
136 added 1 changesets with 1 changes to [12] files \(\+1 heads\) (re) |
|
137 pull obsolescence markers |
|
138 the remote repository use years old versions of Mercurial and evolve |
|
139 pulling obsmarker using legacy method |
|
140 (please upgrade your server) |
|
141 2 obsolescence markers added |
|
142 (run 'hg heads' to see heads) |
|
143 $ cat ../errors.log |
|
144 $ hg -R ../other pull |
|
145 pulling from http://localhost:$HGPORT/ |
|
146 searching for changes |
|
147 no changes found |
|
148 $ cat ../errors.log |
|
149 |
|
150 $ cd .. |
|
151 |
|
152 Test disabling obsolete advertisement |
|
153 =========================================== |
|
154 (used by bitbucket to select which repo use evolve) |
|
155 |
|
156 $ curl -s "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces" | sort |
|
157 bookmarks |
|
158 namespaces |
|
159 obsolete |
|
160 phases |
|
161 $ curl -s http://localhost:$HGPORT/?cmd=hello |
|
162 capabilities: _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (glob) |
|
163 $ curl -s http://localhost:$HGPORT/?cmd=capabilities |
|
164 _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (no-eol) (glob) |
|
165 |
|
166 $ echo '[experimental]' >> server/.hg/hgrc |
|
167 $ echo 'evolution=!' >> server/.hg/hgrc |
|
168 $ $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
|
169 $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
170 $ cat hg.pid >> $DAEMON_PIDS |
|
171 |
|
172 $ curl -s "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces" | sort |
|
173 bookmarks |
|
174 namespaces |
|
175 phases |
|
176 $ curl -s http://localhost:$HGPORT/?cmd=hello | grep _evoext_pushobsmarkers_0 |
|
177 [1] |
|
178 $ curl -s http://localhost:$HGPORT/?cmd=capabilities | grep _evoext_pushobsmarkers_0 |
|
179 [1] |
|
180 |
|
181 $ echo 'evolution=' >> server/.hg/hgrc |
|
182 $ $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
|
183 $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
184 $ cat hg.pid >> $DAEMON_PIDS |
|
185 |
|
186 $ curl -s "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces" | sort |
|
187 bookmarks |
|
188 namespaces |
|
189 obsolete |
|
190 phases |
|
191 $ curl -s http://localhost:$HGPORT/?cmd=hello |
|
192 capabilities: _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (glob) |
|
193 $ curl -s http://localhost:$HGPORT/?cmd=capabilities |
|
194 _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (no-eol) (glob) |