Mercurial > hg
annotate tests/test-flagprocessor.t @ 33782:40739aef97f7
label: rename trouble.X into instability.X
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D258
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 03 Aug 2017 15:30:41 +0200 |
parents | 5ac845ca059a |
children | eb586ed5d8ce |
rev | line source |
---|---|
30745 | 1 # Create server |
2 $ hg init server | |
3 $ cd server | |
4 $ cat >> .hg/hgrc << EOF | |
5 > [extensions] | |
6 > extension=$TESTDIR/flagprocessorext.py | |
7 > EOF | |
8 $ cd ../ | |
9 | |
10 # Clone server and enable extensions | |
11 $ hg clone -q server client | |
12 $ cd client | |
13 $ cat >> .hg/hgrc << EOF | |
14 > [extensions] | |
15 > extension=$TESTDIR/flagprocessorext.py | |
16 > EOF | |
17 | |
18 # Commit file that will trigger the noop extension | |
19 $ echo '[NOOP]' > noop | |
20 $ hg commit -Aqm "noop" | |
21 | |
22 # Commit file that will trigger the base64 extension | |
23 $ echo '[BASE64]' > base64 | |
24 $ hg commit -Aqm 'base64' | |
25 | |
26 # Commit file that will trigger the gzip extension | |
27 $ echo '[GZIP]' > gzip | |
28 $ hg commit -Aqm 'gzip' | |
29 | |
30 # Commit file that will trigger noop and base64 | |
31 $ echo '[NOOP][BASE64]' > noop-base64 | |
32 $ hg commit -Aqm 'noop+base64' | |
33 | |
34 # Commit file that will trigger noop and gzip | |
35 $ echo '[NOOP][GZIP]' > noop-gzip | |
36 $ hg commit -Aqm 'noop+gzip' | |
37 | |
38 # Commit file that will trigger base64 and gzip | |
39 $ echo '[BASE64][GZIP]' > base64-gzip | |
40 $ hg commit -Aqm 'base64+gzip' | |
41 | |
42 # Commit file that will trigger base64, gzip and noop | |
43 $ echo '[BASE64][GZIP][NOOP]' > base64-gzip-noop | |
44 $ hg commit -Aqm 'base64+gzip+noop' | |
45 | |
46 # TEST: ensure the revision data is consistent | |
47 $ hg cat noop | |
48 [NOOP] | |
49 $ hg debugdata noop 0 | |
50 [NOOP] | |
51 | |
52 $ hg cat -r . base64 | |
53 [BASE64] | |
54 $ hg debugdata base64 0 | |
55 W0JBU0U2NF0K (no-eol) | |
56 | |
57 $ hg cat -r . gzip | |
58 [GZIP] | |
59 $ hg debugdata gzip 0 | |
60 x\x9c\x8bv\x8f\xf2\x0c\x88\xe5\x02\x00\x08\xc8\x01\xfd (no-eol) (esc) | |
61 | |
62 $ hg cat -r . noop-base64 | |
63 [NOOP][BASE64] | |
64 $ hg debugdata noop-base64 0 | |
65 W05PT1BdW0JBU0U2NF0K (no-eol) | |
66 | |
67 $ hg cat -r . noop-gzip | |
68 [NOOP][GZIP] | |
69 $ hg debugdata noop-gzip 0 | |
70 x\x9c\x8b\xf6\xf3\xf7\x0f\x88\x8dv\x8f\xf2\x0c\x88\xe5\x02\x00\x1dH\x03\xf1 (no-eol) (esc) | |
71 | |
72 $ hg cat -r . base64-gzip | |
73 [BASE64][GZIP] | |
74 $ hg debugdata base64-gzip 0 | |
75 eJyLdnIMdjUziY12j/IMiOUCACLBBDo= (no-eol) | |
76 | |
77 $ hg cat -r . base64-gzip-noop | |
78 [BASE64][GZIP][NOOP] | |
79 $ hg debugdata base64-gzip-noop 0 | |
80 eJyLdnIMdjUziY12j/IMiI328/cPiOUCAESjBi4= (no-eol) | |
81 | |
82 # Push to the server | |
83 $ hg push | |
84 pushing to $TESTTMP/server (glob) | |
85 searching for changes | |
86 adding changesets | |
87 adding manifests | |
88 adding file changes | |
89 added 7 changesets with 7 changes to 7 files | |
90 | |
91 # Initialize new client (not cloning) and setup extension | |
92 $ cd .. | |
93 $ hg init client2 | |
94 $ cd client2 | |
95 $ cat >> .hg/hgrc << EOF | |
96 > [paths] | |
97 > default = $TESTTMP/server | |
98 > [extensions] | |
99 > extension=$TESTDIR/flagprocessorext.py | |
100 > EOF | |
101 | |
102 # Pull from server and update to latest revision | |
103 $ hg pull default | |
104 pulling from $TESTTMP/server (glob) | |
105 requesting all changes | |
106 adding changesets | |
107 adding manifests | |
108 adding file changes | |
109 added 7 changesets with 7 changes to 7 files | |
110 (run 'hg update' to get a working copy) | |
111 $ hg update | |
112 7 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
113 | |
114 # TEST: ensure the revision data is consistent | |
115 $ hg cat noop | |
116 [NOOP] | |
117 $ hg debugdata noop 0 | |
118 [NOOP] | |
119 | |
120 $ hg cat -r . base64 | |
121 [BASE64] | |
122 $ hg debugdata base64 0 | |
123 W0JBU0U2NF0K (no-eol) | |
124 | |
125 $ hg cat -r . gzip | |
126 [GZIP] | |
127 $ hg debugdata gzip 0 | |
128 x\x9c\x8bv\x8f\xf2\x0c\x88\xe5\x02\x00\x08\xc8\x01\xfd (no-eol) (esc) | |
129 | |
130 $ hg cat -r . noop-base64 | |
131 [NOOP][BASE64] | |
132 $ hg debugdata noop-base64 0 | |
133 W05PT1BdW0JBU0U2NF0K (no-eol) | |
134 | |
135 $ hg cat -r . noop-gzip | |
136 [NOOP][GZIP] | |
137 $ hg debugdata noop-gzip 0 | |
138 x\x9c\x8b\xf6\xf3\xf7\x0f\x88\x8dv\x8f\xf2\x0c\x88\xe5\x02\x00\x1dH\x03\xf1 (no-eol) (esc) | |
139 | |
140 $ hg cat -r . base64-gzip | |
141 [BASE64][GZIP] | |
142 $ hg debugdata base64-gzip 0 | |
143 eJyLdnIMdjUziY12j/IMiOUCACLBBDo= (no-eol) | |
144 | |
145 $ hg cat -r . base64-gzip-noop | |
146 [BASE64][GZIP][NOOP] | |
147 $ hg debugdata base64-gzip-noop 0 | |
148 eJyLdnIMdjUziY12j/IMiI328/cPiOUCAESjBi4= (no-eol) | |
149 | |
150 # TEST: ensure a missing processor is handled | |
151 $ echo '[FAIL][BASE64][GZIP][NOOP]' > fail-base64-gzip-noop | |
152 $ hg commit -Aqm 'fail+base64+gzip+noop' | |
153 abort: missing processor for flag '0x1'! | |
154 [255] | |
33614
41081364addb
tests: clarify that duplicate flag processors is not an error
Martin von Zweigbergk <martinvonz@google.com>
parents:
32724
diff
changeset
|
155 $ rm fail-base64-gzip-noop |
30745 | 156 |
157 # TEST: ensure we cannot register several flag processors on the same flag | |
158 $ cat >> .hg/hgrc << EOF | |
159 > [extensions] | |
160 > extension=$TESTDIR/flagprocessorext.py | |
161 > duplicate=$TESTDIR/flagprocessorext.py | |
162 > EOF | |
33615
c6146dd10072
tests: fix test-flagprocessor.t flakiness
Martin von Zweigbergk <martinvonz@google.com>
parents:
33614
diff
changeset
|
163 $ hg debugrebuilddirstate |
32724
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
31856
diff
changeset
|
164 *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'. |
33615
c6146dd10072
tests: fix test-flagprocessor.t flakiness
Martin von Zweigbergk <martinvonz@google.com>
parents:
33614
diff
changeset
|
165 $ hg st 2>&1 | egrep 'cannot register multiple processors|flagprocessorext' |
c6146dd10072
tests: fix test-flagprocessor.t flakiness
Martin von Zweigbergk <martinvonz@google.com>
parents:
33614
diff
changeset
|
166 *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'. |
c6146dd10072
tests: fix test-flagprocessor.t flakiness
Martin von Zweigbergk <martinvonz@google.com>
parents:
33614
diff
changeset
|
167 File "*/tests/flagprocessorext.py", line *, in b64decode (glob) |
31833
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
168 |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
169 $ cd .. |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
170 |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
171 # TEST: bundle repo |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
172 $ hg init bundletest |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
173 $ cd bundletest |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
174 |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
175 $ cat >> .hg/hgrc << EOF |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
176 > [extensions] |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
177 > flagprocessor=$TESTDIR/flagprocessorext.py |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
178 > EOF |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
179 |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
180 $ for i in 0 single two three 4; do |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
181 > echo '[BASE64]a-bit-longer-'$i > base64 |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
182 > hg commit -m base64-$i -A base64 |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
183 > done |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
184 |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
185 $ hg update 2 -q |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
186 $ echo '[BASE64]a-bit-longer-branching' > base64 |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
187 $ hg commit -q -m branching |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
188 |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
189 $ hg bundle --base 1 bundle.hg |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
190 4 changesets found |
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
191 $ hg --config extensions.strip= strip -r 2 --no-backup --force -q |
31838
c39e7c4b535c
test-flagprocessor: remove unnecessary greps
Jun Wu <quark@fb.com>
parents:
31837
diff
changeset
|
192 $ hg -R bundle.hg log --stat -T '{rev} {desc}\n' base64 |
31836
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
193 5 branching |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
194 base64 | 2 +- |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
195 1 files changed, 1 insertions(+), 1 deletions(-) |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
196 |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
197 4 base64-4 |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
198 base64 | 2 +- |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
199 1 files changed, 1 insertions(+), 1 deletions(-) |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
200 |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
201 3 base64-three |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
202 base64 | 2 +- |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
203 1 files changed, 1 insertions(+), 1 deletions(-) |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
204 |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
205 2 base64-two |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
206 base64 | 2 +- |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
207 1 files changed, 1 insertions(+), 1 deletions(-) |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
208 |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
209 1 base64-single |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
210 base64 | 2 +- |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
211 1 files changed, 1 insertions(+), 1 deletions(-) |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
212 |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
213 0 base64-0 |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
214 base64 | 1 + |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
215 1 files changed, 1 insertions(+), 0 deletions(-) |
4598e8f43e20
bundlerepo: fix raw handling in revision()
Jun Wu <quark@fb.com>
parents:
31835
diff
changeset
|
216 |
31833
723c1ab2f77e
test-flagprocessor: add tests about bundlerepo
Jun Wu <quark@fb.com>
parents:
30745
diff
changeset
|
217 |
31838
c39e7c4b535c
test-flagprocessor: remove unnecessary greps
Jun Wu <quark@fb.com>
parents:
31837
diff
changeset
|
218 $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q |
c39e7c4b535c
test-flagprocessor: remove unnecessary greps
Jun Wu <quark@fb.com>
parents:
31837
diff
changeset
|
219 $ hg -R bundle-again.hg log --stat -T '{rev} {desc}\n' base64 |
31837
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
220 5 branching |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
221 base64 | 2 +- |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
222 1 files changed, 1 insertions(+), 1 deletions(-) |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
223 |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
224 4 base64-4 |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
225 base64 | 2 +- |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
226 1 files changed, 1 insertions(+), 1 deletions(-) |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
227 |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
228 3 base64-three |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
229 base64 | 2 +- |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
230 1 files changed, 1 insertions(+), 1 deletions(-) |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
231 |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
232 2 base64-two |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
233 base64 | 2 +- |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
234 1 files changed, 1 insertions(+), 1 deletions(-) |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
235 |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
236 1 base64-single |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
237 base64 | 2 +- |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
238 1 files changed, 1 insertions(+), 1 deletions(-) |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
239 |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
240 0 base64-0 |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
241 base64 | 1 + |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
242 1 files changed, 1 insertions(+), 0 deletions(-) |
37e793918c07
bundlerepo: use raw revision in revdiff()
Jun Wu <quark@fb.com>
parents:
31836
diff
changeset
|
243 |
31855
a418c5837bc0
test-flagprocessor: add a case about hg status
Jun Wu <quark@fb.com>
parents:
31838
diff
changeset
|
244 $ rm bundle.hg bundle-again.hg |
a418c5837bc0
test-flagprocessor: add a case about hg status
Jun Wu <quark@fb.com>
parents:
31838
diff
changeset
|
245 |
a418c5837bc0
test-flagprocessor: add a case about hg status
Jun Wu <quark@fb.com>
parents:
31838
diff
changeset
|
246 # TEST: hg status |
a418c5837bc0
test-flagprocessor: add a case about hg status
Jun Wu <quark@fb.com>
parents:
31838
diff
changeset
|
247 |
a418c5837bc0
test-flagprocessor: add a case about hg status
Jun Wu <quark@fb.com>
parents:
31838
diff
changeset
|
248 $ hg status |
a418c5837bc0
test-flagprocessor: add a case about hg status
Jun Wu <quark@fb.com>
parents:
31838
diff
changeset
|
249 $ hg diff |