|
1 Some tests for hgweb in an empty repository |
|
2 |
|
3 $ hg init test |
|
4 $ cd test |
|
5 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
6 $ cat hg.pid >> $DAEMON_PIDS |
|
7 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/shortlog') |
|
8 200 Script output follows |
|
9 |
|
10 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
11 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
12 <head> |
|
13 <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
14 <meta name="robots" content="index, nofollow" /> |
|
15 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
16 |
|
17 <title>test: log</title> |
|
18 <link rel="alternate" type="application/atom+xml" |
|
19 href="/atom-log" title="Atom feed for test" /> |
|
20 <link rel="alternate" type="application/rss+xml" |
|
21 href="/rss-log" title="RSS feed for test" /> |
|
22 </head> |
|
23 <body> |
|
24 |
|
25 <div class="container"> |
|
26 <div class="menu"> |
|
27 <div class="logo"> |
|
28 <a href="http://mercurial.selenic.com/"> |
|
29 <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
30 </div> |
|
31 <ul> |
|
32 <li class="active">log</li> |
|
33 <li><a href="/graph/000000000000">graph</a></li> |
|
34 <li><a href="/tags">tags</a></li> |
|
35 <li><a href="/branches">branches</a></li> |
|
36 </ul> |
|
37 <ul> |
|
38 <li><a href="/rev/000000000000">changeset</a></li> |
|
39 <li><a href="/file/000000000000">browse</a></li> |
|
40 </ul> |
|
41 <ul> |
|
42 |
|
43 </ul> |
|
44 </div> |
|
45 |
|
46 <div class="main"> |
|
47 <h2><a href="/">test</a></h2> |
|
48 <h3>log</h3> |
|
49 |
|
50 <form class="search" action="/log"> |
|
51 |
|
52 <p><input name="rev" id="search1" type="text" size="30" /></p> |
|
53 <div id="hint">find changesets by author, revision, |
|
54 files, or words in the commit message</div> |
|
55 </form> |
|
56 |
|
57 <div class="navigate"> |
|
58 <a href="/shortlog/-1?revcount=30">less</a> |
|
59 <a href="/shortlog/-1?revcount=120">more</a> |
|
60 | rev -1: <a href="/shortlog/000000000000">(0)</a> <a href="/shortlog/tip">tip</a> |
|
61 </div> |
|
62 |
|
63 <table class="bigtable"> |
|
64 <tr> |
|
65 <th class="age">age</th> |
|
66 <th class="author">author</th> |
|
67 <th class="description">description</th> |
|
68 </tr> |
|
69 |
|
70 </table> |
|
71 |
|
72 <div class="navigate"> |
|
73 <a href="/shortlog/-1?revcount=30">less</a> |
|
74 <a href="/shortlog/-1?revcount=120">more</a> |
|
75 | rev -1: <a href="/shortlog/000000000000">(0)</a> <a href="/shortlog/tip">tip</a> |
|
76 </div> |
|
77 |
|
78 </div> |
|
79 </div> |
|
80 |
|
81 |
|
82 |
|
83 </body> |
|
84 </html> |
|
85 |
|
86 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log') |
|
87 200 Script output follows |
|
88 |
|
89 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
90 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
91 <head> |
|
92 <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
93 <meta name="robots" content="index, nofollow" /> |
|
94 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
95 |
|
96 <title>test: log</title> |
|
97 <link rel="alternate" type="application/atom+xml" |
|
98 href="/atom-log" title="Atom feed for test" /> |
|
99 <link rel="alternate" type="application/rss+xml" |
|
100 href="/rss-log" title="RSS feed for test" /> |
|
101 </head> |
|
102 <body> |
|
103 |
|
104 <div class="container"> |
|
105 <div class="menu"> |
|
106 <div class="logo"> |
|
107 <a href="http://mercurial.selenic.com/"> |
|
108 <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
109 </div> |
|
110 <ul> |
|
111 <li class="active">log</li> |
|
112 <li><a href="/graph/000000000000">graph</a></li> |
|
113 <li><a href="/tags">tags</a></li> |
|
114 <li><a href="/branches">branches</a></li> |
|
115 </ul> |
|
116 <ul> |
|
117 <li><a href="/rev/000000000000">changeset</a></li> |
|
118 <li><a href="/file/000000000000">browse</a></li> |
|
119 </ul> |
|
120 <ul> |
|
121 |
|
122 </ul> |
|
123 </div> |
|
124 |
|
125 <div class="main"> |
|
126 <h2><a href="/">test</a></h2> |
|
127 <h3>log</h3> |
|
128 |
|
129 <form class="search" action="/log"> |
|
130 |
|
131 <p><input name="rev" id="search1" type="text" size="30" /></p> |
|
132 <div id="hint">find changesets by author, revision, |
|
133 files, or words in the commit message</div> |
|
134 </form> |
|
135 |
|
136 <div class="navigate"> |
|
137 <a href="/shortlog/-1?revcount=5">less</a> |
|
138 <a href="/shortlog/-1?revcount=20">more</a> |
|
139 | rev -1: <a href="/shortlog/000000000000">(0)</a> <a href="/shortlog/tip">tip</a> |
|
140 </div> |
|
141 |
|
142 <table class="bigtable"> |
|
143 <tr> |
|
144 <th class="age">age</th> |
|
145 <th class="author">author</th> |
|
146 <th class="description">description</th> |
|
147 </tr> |
|
148 |
|
149 </table> |
|
150 |
|
151 <div class="navigate"> |
|
152 <a href="/shortlog/-1?revcount=5">less</a> |
|
153 <a href="/shortlog/-1?revcount=20">more</a> |
|
154 | rev -1: <a href="/shortlog/000000000000">(0)</a> <a href="/shortlog/tip">tip</a> |
|
155 </div> |
|
156 |
|
157 </div> |
|
158 </div> |
|
159 |
|
160 |
|
161 |
|
162 </body> |
|
163 </html> |
|
164 |
|
165 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/graph') |
|
166 200 Script output follows |
|
167 |
|
168 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
169 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
170 <head> |
|
171 <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
172 <meta name="robots" content="index, nofollow" /> |
|
173 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
174 |
|
175 <title>test: revision graph</title> |
|
176 <link rel="alternate" type="application/atom+xml" |
|
177 href="/atom-log" title="Atom feed for test: log" /> |
|
178 <link rel="alternate" type="application/rss+xml" |
|
179 href="/rss-log" title="RSS feed for test: log" /> |
|
180 <!--[if IE]><script type="text/javascript" src="/static/excanvas.js"></script><![endif]--> |
|
181 </head> |
|
182 <body> |
|
183 |
|
184 <div class="container"> |
|
185 <div class="menu"> |
|
186 <div class="logo"> |
|
187 <a href="http://mercurial.selenic.com/"> |
|
188 <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
189 </div> |
|
190 <ul> |
|
191 <li><a href="/shortlog/000000000000">log</a></li> |
|
192 <li class="active">graph</li> |
|
193 <li><a href="/tags">tags</a></li> |
|
194 <li><a href="/branches">branches</a></li> |
|
195 </ul> |
|
196 <ul> |
|
197 <li><a href="/rev/000000000000">changeset</a></li> |
|
198 <li><a href="/file/000000000000">browse</a></li> |
|
199 </ul> |
|
200 </div> |
|
201 |
|
202 <div class="main"> |
|
203 <h2><a href="/">test</a></h2> |
|
204 <h3>graph</h3> |
|
205 |
|
206 <form class="search" action="/log"> |
|
207 |
|
208 <p><input name="rev" id="search1" type="text" size="30" /></p> |
|
209 <div id="hint">find changesets by author, revision, |
|
210 files, or words in the commit message</div> |
|
211 </form> |
|
212 |
|
213 <div class="navigate"> |
|
214 <a href="/graph/-1?revcount=30">less</a> |
|
215 <a href="/graph/-1?revcount=120">more</a> |
|
216 | rev -1: <a href="/graph/000000000000">(0)</a> <a href="/graph/tip">tip</a> |
|
217 </div> |
|
218 |
|
219 <noscript><p>The revision graph only works with JavaScript-enabled browsers.</p></noscript> |
|
220 |
|
221 <div id="wrapper"> |
|
222 <ul id="nodebgs"></ul> |
|
223 <canvas id="graph" width="224" height="12"></canvas> |
|
224 <ul id="graphnodes"></ul> |
|
225 </div> |
|
226 |
|
227 <script type="text/javascript" src="/static/graph.js"></script> |
|
228 <script type="text/javascript"> |
|
229 <!-- hide script content |
|
230 |
|
231 var data = []; |
|
232 var graph = new Graph(); |
|
233 graph.scale(39); |
|
234 |
|
235 graph.edge = function(x0, y0, x1, y1, color) { |
|
236 |
|
237 this.setColor(color, 0.0, 0.65); |
|
238 this.ctx.beginPath(); |
|
239 this.ctx.moveTo(x0, y0); |
|
240 this.ctx.lineTo(x1, y1); |
|
241 this.ctx.stroke(); |
|
242 |
|
243 } |
|
244 |
|
245 var revlink = '<li style="_STYLE"><span class="desc">'; |
|
246 revlink += '<a href="/rev/_NODEID" title="_NODEID">_DESC</a>'; |
|
247 revlink += '</span>_TAGS<span class="info">_DATE, by _USER</span></li>'; |
|
248 |
|
249 graph.vertex = function(x, y, color, parity, cur) { |
|
250 |
|
251 this.ctx.beginPath(); |
|
252 color = this.setColor(color, 0.25, 0.75); |
|
253 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true); |
|
254 this.ctx.fill(); |
|
255 |
|
256 var bg = '<li class="bg parity' + parity + '"></li>'; |
|
257 var left = (this.columns + 1) * this.bg_height; |
|
258 var nstyle = 'padding-left: ' + left + 'px;'; |
|
259 var item = revlink.replace(/_STYLE/, nstyle); |
|
260 item = item.replace(/_PARITY/, 'parity' + parity); |
|
261 item = item.replace(/_NODEID/, cur[0]); |
|
262 item = item.replace(/_NODEID/, cur[0]); |
|
263 item = item.replace(/_DESC/, cur[3]); |
|
264 item = item.replace(/_USER/, cur[4]); |
|
265 item = item.replace(/_DATE/, cur[5]); |
|
266 |
|
267 var tagspan = ''; |
|
268 if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) { |
|
269 tagspan = '<span class="logtags">'; |
|
270 if (cur[6][1]) { |
|
271 tagspan += '<span class="branchhead" title="' + cur[6][0] + '">'; |
|
272 tagspan += cur[6][0] + '</span> '; |
|
273 } else if (!cur[6][1] && cur[6][0] != 'default') { |
|
274 tagspan += '<span class="branchname" title="' + cur[6][0] + '">'; |
|
275 tagspan += cur[6][0] + '</span> '; |
|
276 } |
|
277 if (cur[7].length) { |
|
278 for (var t in cur[7]) { |
|
279 var tag = cur[7][t]; |
|
280 tagspan += '<span class="tag">' + tag + '</span> '; |
|
281 } |
|
282 } |
|
283 tagspan += '</span>'; |
|
284 } |
|
285 |
|
286 item = item.replace(/_TAGS/, tagspan); |
|
287 return [bg, item]; |
|
288 |
|
289 } |
|
290 |
|
291 graph.render(data); |
|
292 |
|
293 // stop hiding script --> |
|
294 </script> |
|
295 |
|
296 <div class="navigate"> |
|
297 <a href="/graph/-1?revcount=30">less</a> |
|
298 <a href="/graph/-1?revcount=120">more</a> |
|
299 | rev -1: <a href="/graph/000000000000">(0)</a> <a href="/graph/tip">tip</a> |
|
300 </div> |
|
301 |
|
302 </div> |
|
303 </div> |
|
304 |
|
305 |
|
306 |
|
307 </body> |
|
308 </html> |
|
309 |
|
310 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file') |
|
311 200 Script output follows |
|
312 |
|
313 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
314 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
315 <head> |
|
316 <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
317 <meta name="robots" content="index, nofollow" /> |
|
318 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
319 |
|
320 <title>test: 000000000000 /</title> |
|
321 </head> |
|
322 <body> |
|
323 |
|
324 <div class="container"> |
|
325 <div class="menu"> |
|
326 <div class="logo"> |
|
327 <a href="http://mercurial.selenic.com/"> |
|
328 <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
329 </div> |
|
330 <ul> |
|
331 <li><a href="/shortlog/000000000000">log</a></li> |
|
332 <li><a href="/graph/000000000000">graph</a></li> |
|
333 <li><a href="/tags">tags</a></li> |
|
334 <li><a href="/branches">branches</a></li> |
|
335 </ul> |
|
336 <ul> |
|
337 <li><a href="/rev/000000000000">changeset</a></li> |
|
338 <li class="active">browse</li> |
|
339 </ul> |
|
340 <ul> |
|
341 |
|
342 </ul> |
|
343 </div> |
|
344 |
|
345 <div class="main"> |
|
346 <h2><a href="/">test</a></h2> |
|
347 <h3>directory / @ -1:000000000000 <span class="tag">tip</span> </h3> |
|
348 |
|
349 <form class="search" action="/log"> |
|
350 |
|
351 <p><input name="rev" id="search1" type="text" size="30" /></p> |
|
352 <div id="hint">find changesets by author, revision, |
|
353 files, or words in the commit message</div> |
|
354 </form> |
|
355 |
|
356 <table class="bigtable"> |
|
357 <tr> |
|
358 <th class="name">name</th> |
|
359 <th class="size">size</th> |
|
360 <th class="permissions">permissions</th> |
|
361 </tr> |
|
362 <tr class="fileline parity0"> |
|
363 <td class="name"><a href="/file/000000000000/">[up]</a></td> |
|
364 <td class="size"></td> |
|
365 <td class="permissions">drwxr-xr-x</td> |
|
366 </tr> |
|
367 |
|
368 |
|
369 </table> |
|
370 </div> |
|
371 </div> |
|
372 |
|
373 |
|
374 </body> |
|
375 </html> |
|
376 |