Debian Codegraph @

tests/test-hgweb-diffs.t

raw
1 #require serve
2
3 setting up repo
4
5 $ hg init test
6 $ cd test
7 $ echo a > a
8 $ echo b > b
9 $ hg ci -Ama
10 adding a
11 adding b
12
13 change permissions for git diffs
14
15 $ hg import -q --bypass - <<EOF
16 > # HG changeset patch
17 > # User test
18 > # Date 0 0
19 > b
20 >
21 > diff --git a/a b/a
22 > old mode 100644
23 > new mode 100755
24 > diff --git a/b b/b
25 > deleted file mode 100644
26 > --- a/b
27 > +++ /dev/null
28 > @@ -1,1 +0,0 @@
29 > -b
30 > EOF
31
32 set up hgweb
33
34 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
35 $ cat hg.pid >> $DAEMON_PIDS
36
37 revision
38
39 $ get-with-headers.py localhost:$HGPORT 'rev/0'
40 200 Script output follows
41
42 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
43 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
44 <head>
45 <link rel="icon" href="/static/hgicon.png" type="image/png" />
46 <meta name="robots" content="index, nofollow" />
47 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
48 <script type="text/javascript" src="/static/mercurial.js"></script>
49
50 <title>test: 0cd96de13884</title>
51 </head>
52 <body>
53 <div class="container">
54 <div class="menu">
55 <div class="logo">
56 <a href="https://mercurial-scm.org/">
57 <img src="/static/hglogo.png" alt="mercurial" /></a>
58 </div>
59 <ul>
60 <li><a href="/shortlog/0">log</a></li>
61 <li><a href="/graph/0">graph</a></li>
62 <li><a href="/tags">tags</a></li>
63 <li><a href="/bookmarks">bookmarks</a></li>
64 <li><a href="/branches">branches</a></li>
65 </ul>
66 <ul>
67 <li class="active">changeset</li>
68 <li><a href="/raw-rev/0">raw</a></li>
69 <li><a href="/file/0">browse</a></li>
70 </ul>
71 <ul>
72
73 </ul>
74 <ul>
75 <li><a href="/help">help</a></li>
76 </ul>
77 </div>
78
79 <div class="main">
80
81 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
82 <h3>
83 changeset 0:<a href="/rev/0cd96de13884">0cd96de13884</a>
84 <span class="phase">draft</span>
85 </h3>
86
87
88 <form class="search" action="/log">
89
90 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
91 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
92 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
93 </form>
94
95 <div class="description">a</div>
96
97 <table id="changesetEntry">
98 <tr>
99 <th class="author">author</th>
100 <td class="author">&#116;&#101;&#115;&#116;</td>
101 </tr>
102 <tr>
103 <th class="date">date</th>
104 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
105 </tr>
106
107
108 <tr>
109 <th class="author">parents</th>
110 <td class="author"></td>
111 </tr>
112 <tr>
113 <th class="author">children</th>
114 <td class="author"> <a href="/rev/559edbd9ed20">559edbd9ed20</a></td>
115 </tr>
116 <tr>
117 <th class="files">files</th>
118 <td class="files"><a href="/file/0cd96de13884/a">a</a> <a href="/file/0cd96de13884/b">b</a> </td>
119 </tr>
120 <tr>
121 <th class="diffstat">diffstat</th>
122 <td class="diffstat">
123 2 files changed, 2 insertions(+), 0 deletions(-)
124
125 <a id="diffstatexpand" class="diffstattoggle" href="#">[<tt>+</tt>]</a>
126 <div id="diffstatdetails" style="display:none;">
127 <a class="diffstattoggle" href="#">[<tt>-</tt>]</a>
128 <table class="diffstat-table stripes2"> <tr>
129 <td class="diffstat-file"><a href="#l1.1">a</a></td>
130 <td class="diffstat-total" align="right">1</td>
131 <td class="diffstat-graph">
132 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
133 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
134 </td>
135 </tr>
136 <tr>
137 <td class="diffstat-file"><a href="#l2.1">b</a></td>
138 <td class="diffstat-total" align="right">1</td>
139 <td class="diffstat-graph">
140 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
141 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
142 </td>
143 </tr>
144 </table>
145 </div>
146 </td>
147 </tr>
148 </table>
149
150 <div class="overflow">
151 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="#">on</a></div>
152 <div class="sourcefirst"> line diff</div>
153 <div class="stripes2 diffblocks">
154 <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
155 <span id="l1.1" class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
156 <span id="l1.2" class="plusline">+++ b/a Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
157 <span id="l1.3" class="atline">@@ -0,0 +1,1 @@</span><a href="#l1.3"></a>
158 <span id="l1.4" class="plusline">+a</span><a href="#l1.4"></a></pre></div><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
159 <span id="l2.1" class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000</span><a href="#l2.1"></a>
160 <span id="l2.2" class="plusline">+++ b/b Thu Jan 01 00:00:00 1970 +0000</span><a href="#l2.2"></a>
161 <span id="l2.3" class="atline">@@ -0,0 +1,1 @@</span><a href="#l2.3"></a>
162 <span id="l2.4" class="plusline">+b</span><a href="#l2.4"></a></pre></div>
163 </div>
164 </div>
165
166 </div>
167 </div>
168
169
170 </body>
171 </html>
172
173
174 raw revision
175
176 $ get-with-headers.py localhost:$HGPORT 'raw-rev/0'
177 200 Script output follows
178
179
180 # HG changeset patch
181 # User test
182 # Date 0 0
183 # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
184
185 a
186
187 diff -r 000000000000 -r 0cd96de13884 a
188 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
189 +++ b/a Thu Jan 01 00:00:00 1970 +0000
190 @@ -0,0 +1,1 @@
191 +a
192 diff -r 000000000000 -r 0cd96de13884 b
193 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
194 +++ b/b Thu Jan 01 00:00:00 1970 +0000
195 @@ -0,0 +1,1 @@
196 +b
197
198
199 diff removed file
200
201 $ hg log --template "{file_mods}\n{file_dels}\n" -r tip
202 a
203 b
204 $ hg parents --template "{node|short}\n" -r tip
205 0cd96de13884
206 $ hg parents --template "{node|short}\n" -r tip b
207 0cd96de13884
208
209 $ get-with-headers.py localhost:$HGPORT 'diff/tip/b'
210 200 Script output follows
211
212 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
213 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
214 <head>
215 <link rel="icon" href="/static/hgicon.png" type="image/png" />
216 <meta name="robots" content="index, nofollow" />
217 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
218 <script type="text/javascript" src="/static/mercurial.js"></script>
219
220 <title>test: b diff</title>
221 </head>
222 <body>
223
224 <div class="container">
225 <div class="menu">
226 <div class="logo">
227 <a href="https://mercurial-scm.org/">
228 <img src="/static/hglogo.png" alt="mercurial" /></a>
229 </div>
230 <ul>
231 <li><a href="/shortlog/tip">log</a></li>
232 <li><a href="/graph/tip">graph</a></li>
233 <li><a href="/tags">tags</a></li>
234 <li><a href="/bookmarks">bookmarks</a></li>
235 <li><a href="/branches">branches</a></li>
236 </ul>
237 <ul>
238 <li><a href="/rev/tip">changeset</a></li>
239 <li><a href="/file/tip">browse</a></li>
240 </ul>
241 <ul>
242 <li><a href="/file/tip/b">file</a></li>
243 <li><a href="/file/tip/b">latest</a></li>
244 <li class="active">diff</li>
245 <li><a href="/comparison/tip/b">comparison</a></li>
246 <li><a href="/annotate/tip/b">annotate</a></li>
247 <li><a href="/log/tip/b">file log</a></li>
248 <li><a href="/raw-file/tip/b">raw</a></li>
249 </ul>
250 <ul>
251 <li><a href="/help">help</a></li>
252 </ul>
253 </div>
254
255 <div class="main">
256 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
257 <h3>
258 diff b @ 1:<a href="/rev/559edbd9ed20">559edbd9ed20</a>
259 <span class="phase">draft</span> <span class="branchhead">default</span> <span class="tag">tip</span>
260 </h3>
261
262
263 <form class="search" action="/log">
264
265 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
266 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
267 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
268 </form>
269
270 <div class="description">b</div>
271
272 <table id="changesetEntry">
273 <tr>
274 <th>author</th>
275 <td>&#116;&#101;&#115;&#116;</td>
276 </tr>
277 <tr>
278 <th>date</th>
279 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
280 </tr>
281 <tr>
282 <th>parents</th>
283 <td><a href="/file/0cd96de13884/b">0cd96de13884</a> </td>
284 </tr>
285 <tr>
286 <th>children</th>
287 <td></td>
288 </tr>
289 </table>
290
291 <div class="overflow">
292 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="#">on</a></div>
293 <div class="sourcefirst"> line diff</div>
294 <div class="stripes2 diffblocks">
295 <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
296 <span id="l1.1" class="minusline">--- a/b Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
297 <span id="l1.2" class="plusline">+++ /dev/null Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
298 <span id="l1.3" class="atline">@@ -1,1 +0,0 @@</span><a href="#l1.3"></a>
299 <span id="l1.4" class="minusline">-b</span><a href="#l1.4"></a></pre></div>
300 </div>
301 </div>
302 </div>
303 </div>
304
305
306
307 </body>
308 </html>
309
310
311 set up hgweb with git diffs + noprefix
312
313 $ killdaemons.py
314 $ hg serve --config 'diff.git=1' --config 'diff.noprefix=1' -p $HGPORT -d \
315 > --pid-file=hg.pid -A access.log -E errors.log
316 $ cat hg.pid >> $DAEMON_PIDS
317
318 patch header and diffstat
319
320 $ get-with-headers.py localhost:$HGPORT 'rev/0' \
321 > | grep -E 'files changed|---|\+\+\+'
322 2 files changed, 2 insertions(+), 0 deletions(-)
323 <span id="l1.2" class="minusline">--- /dev/null</span><a href="#l1.2"></a>
324 <span id="l1.3" class="plusline">+++ a</span><a href="#l1.3"></a>
325 <span id="l2.2" class="minusline">--- /dev/null</span><a href="#l2.2"></a>
326 <span id="l2.3" class="plusline">+++ b</span><a href="#l2.3"></a>
327
328 set up hgweb with git diffs
329
330 $ killdaemons.py
331 $ hg serve --config 'diff.git=1' -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
332 $ cat hg.pid >> $DAEMON_PIDS
333
334 revision
335
336 $ get-with-headers.py localhost:$HGPORT 'rev/0'
337 200 Script output follows
338
339 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
340 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
341 <head>
342 <link rel="icon" href="/static/hgicon.png" type="image/png" />
343 <meta name="robots" content="index, nofollow" />
344 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
345 <script type="text/javascript" src="/static/mercurial.js"></script>
346
347 <title>test: 0cd96de13884</title>
348 </head>
349 <body>
350 <div class="container">
351 <div class="menu">
352 <div class="logo">
353 <a href="https://mercurial-scm.org/">
354 <img src="/static/hglogo.png" alt="mercurial" /></a>
355 </div>
356 <ul>
357 <li><a href="/shortlog/0">log</a></li>
358 <li><a href="/graph/0">graph</a></li>
359 <li><a href="/tags">tags</a></li>
360 <li><a href="/bookmarks">bookmarks</a></li>
361 <li><a href="/branches">branches</a></li>
362 </ul>
363 <ul>
364 <li class="active">changeset</li>
365 <li><a href="/raw-rev/0">raw</a></li>
366 <li><a href="/file/0">browse</a></li>
367 </ul>
368 <ul>
369
370 </ul>
371 <ul>
372 <li><a href="/help">help</a></li>
373 </ul>
374 </div>
375
376 <div class="main">
377
378 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
379 <h3>
380 changeset 0:<a href="/rev/0cd96de13884">0cd96de13884</a>
381 <span class="phase">draft</span>
382 </h3>
383
384
385 <form class="search" action="/log">
386
387 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
388 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
389 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
390 </form>
391
392 <div class="description">a</div>
393
394 <table id="changesetEntry">
395 <tr>
396 <th class="author">author</th>
397 <td class="author">&#116;&#101;&#115;&#116;</td>
398 </tr>
399 <tr>
400 <th class="date">date</th>
401 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
402 </tr>
403
404
405 <tr>
406 <th class="author">parents</th>
407 <td class="author"></td>
408 </tr>
409 <tr>
410 <th class="author">children</th>
411 <td class="author"> <a href="/rev/559edbd9ed20">559edbd9ed20</a></td>
412 </tr>
413 <tr>
414 <th class="files">files</th>
415 <td class="files"><a href="/file/0cd96de13884/a">a</a> <a href="/file/0cd96de13884/b">b</a> </td>
416 </tr>
417 <tr>
418 <th class="diffstat">diffstat</th>
419 <td class="diffstat">
420 2 files changed, 2 insertions(+), 0 deletions(-)
421
422 <a id="diffstatexpand" class="diffstattoggle" href="#">[<tt>+</tt>]</a>
423 <div id="diffstatdetails" style="display:none;">
424 <a class="diffstattoggle" href="#">[<tt>-</tt>]</a>
425 <table class="diffstat-table stripes2"> <tr>
426 <td class="diffstat-file"><a href="#l1.1">a</a></td>
427 <td class="diffstat-total" align="right">1</td>
428 <td class="diffstat-graph">
429 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
430 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
431 </td>
432 </tr>
433 <tr>
434 <td class="diffstat-file"><a href="#l2.1">b</a></td>
435 <td class="diffstat-total" align="right">1</td>
436 <td class="diffstat-graph">
437 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
438 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
439 </td>
440 </tr>
441 </table>
442 </div>
443 </td>
444 </tr>
445 </table>
446
447 <div class="overflow">
448 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="#">on</a></div>
449 <div class="sourcefirst"> line diff</div>
450 <div class="stripes2 diffblocks">
451 <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
452 <span id="l1.1">new file mode 100644</span><a href="#l1.1"></a>
453 <span id="l1.2" class="minusline">--- /dev/null</span><a href="#l1.2"></a>
454 <span id="l1.3" class="plusline">+++ b/a</span><a href="#l1.3"></a>
455 <span id="l1.4" class="atline">@@ -0,0 +1,1 @@</span><a href="#l1.4"></a>
456 <span id="l1.5" class="plusline">+a</span><a href="#l1.5"></a></pre></div><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
457 <span id="l2.1">new file mode 100644</span><a href="#l2.1"></a>
458 <span id="l2.2" class="minusline">--- /dev/null</span><a href="#l2.2"></a>
459 <span id="l2.3" class="plusline">+++ b/b</span><a href="#l2.3"></a>
460 <span id="l2.4" class="atline">@@ -0,0 +1,1 @@</span><a href="#l2.4"></a>
461 <span id="l2.5" class="plusline">+b</span><a href="#l2.5"></a></pre></div>
462 </div>
463 </div>
464
465 </div>
466 </div>
467
468
469 </body>
470 </html>
471
472
473 revision
474
475 $ get-with-headers.py localhost:$HGPORT 'raw-rev/0'
476 200 Script output follows
477
478
479 # HG changeset patch
480 # User test
481 # Date 0 0
482 # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
483
484 a
485
486 diff --git a/a b/a
487 new file mode 100644
488 --- /dev/null
489 +++ b/a
490 @@ -0,0 +1,1 @@
491 +a
492 diff --git a/b b/b
493 new file mode 100644
494 --- /dev/null
495 +++ b/b
496 @@ -0,0 +1,1 @@
497 +b
498
499
500 diff modified file
501
502 $ hg log --template "{file_mods}\n{file_dels}\n" -r tip
503 a
504 b
505 $ hg parents --template "{node|short}\n" -r tip
506 0cd96de13884
507 $ hg parents --template "{node|short}\n" -r tip a
508 0cd96de13884
509
510 $ get-with-headers.py localhost:$HGPORT 'diff/tip/a'
511 200 Script output follows
512
513 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
514 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
515 <head>
516 <link rel="icon" href="/static/hgicon.png" type="image/png" />
517 <meta name="robots" content="index, nofollow" />
518 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
519 <script type="text/javascript" src="/static/mercurial.js"></script>
520
521 <title>test: a diff</title>
522 </head>
523 <body>
524
525 <div class="container">
526 <div class="menu">
527 <div class="logo">
528 <a href="https://mercurial-scm.org/">
529 <img src="/static/hglogo.png" alt="mercurial" /></a>
530 </div>
531 <ul>
532 <li><a href="/shortlog/tip">log</a></li>
533 <li><a href="/graph/tip">graph</a></li>
534 <li><a href="/tags">tags</a></li>
535 <li><a href="/bookmarks">bookmarks</a></li>
536 <li><a href="/branches">branches</a></li>
537 </ul>
538 <ul>
539 <li><a href="/rev/tip">changeset</a></li>
540 <li><a href="/file/tip">browse</a></li>
541 </ul>
542 <ul>
543 <li><a href="/file/tip/a">file</a></li>
544 <li><a href="/file/tip/a">latest</a></li>
545 <li class="active">diff</li>
546 <li><a href="/comparison/tip/a">comparison</a></li>
547 <li><a href="/annotate/tip/a">annotate</a></li>
548 <li><a href="/log/tip/a">file log</a></li>
549 <li><a href="/raw-file/tip/a">raw</a></li>
550 </ul>
551 <ul>
552 <li><a href="/help">help</a></li>
553 </ul>
554 </div>
555
556 <div class="main">
557 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
558 <h3>
559 diff a @ 1:<a href="/rev/559edbd9ed20">559edbd9ed20</a>
560 <span class="phase">draft</span> <span class="branchhead">default</span> <span class="tag">tip</span>
561 </h3>
562
563
564 <form class="search" action="/log">
565
566 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
567 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
568 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
569 </form>
570
571 <div class="description">b</div>
572
573 <table id="changesetEntry">
574 <tr>
575 <th>author</th>
576 <td>&#116;&#101;&#115;&#116;</td>
577 </tr>
578 <tr>
579 <th>date</th>
580 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
581 </tr>
582 <tr>
583 <th>parents</th>
584 <td><a href="/file/0cd96de13884/a">0cd96de13884</a> </td>
585 </tr>
586 <tr>
587 <th>children</th>
588 <td></td>
589 </tr>
590 </table>
591
592 <div class="overflow">
593 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="#">on</a></div>
594 <div class="sourcefirst"> line diff</div>
595 <div class="stripes2 diffblocks">
596 <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
597 <span id="l1.1">old mode 100644</span><a href="#l1.1"></a>
598 <span id="l1.2">new mode 100755</span><a href="#l1.2"></a></pre></div>
599 </div>
600 </div>
601 </div>
602 </div>
603
604
605
606 </body>
607 </html>
608
609
610 comparison new file
611
612 $ hg parents --template "{rev}:{node|short}\n" -r 0
613 $ hg log --template "{rev}:{node|short}\n" -r 0
614 0:0cd96de13884
615
616 $ get-with-headers.py localhost:$HGPORT 'comparison/0/a'
617 200 Script output follows
618
619 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
620 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
621 <head>
622 <link rel="icon" href="/static/hgicon.png" type="image/png" />
623 <meta name="robots" content="index, nofollow" />
624 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
625 <script type="text/javascript" src="/static/mercurial.js"></script>
626
627 <title>test: a comparison</title>
628 </head>
629 <body>
630
631 <div class="container">
632 <div class="menu">
633 <div class="logo">
634 <a href="https://mercurial-scm.org/">
635 <img src="/static/hglogo.png" alt="mercurial" /></a>
636 </div>
637 <ul>
638 <li><a href="/shortlog/0">log</a></li>
639 <li><a href="/graph/0">graph</a></li>
640 <li><a href="/tags">tags</a></li>
641 <li><a href="/bookmarks">bookmarks</a></li>
642 <li><a href="/branches">branches</a></li>
643 </ul>
644 <ul>
645 <li><a href="/rev/0">changeset</a></li>
646 <li><a href="/file/0">browse</a></li>
647 </ul>
648 <ul>
649 <li><a href="/file/0/a">file</a></li>
650 <li><a href="/file/tip/a">latest</a></li>
651 <li><a href="/diff/0/a">diff</a></li>
652 <li class="active">comparison</li>
653 <li><a href="/annotate/0/a">annotate</a></li>
654 <li><a href="/log/0/a">file log</a></li>
655 <li><a href="/raw-file/0/a">raw</a></li>
656 </ul>
657 <ul>
658 <li><a href="/help">help</a></li>
659 </ul>
660 </div>
661
662 <div class="main">
663 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
664 <h3>
665 comparison a @ 0:<a href="/rev/0cd96de13884">0cd96de13884</a>
666 <span class="phase">draft</span>
667 </h3>
668
669
670 <form class="search" action="/log">
671
672 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
673 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
674 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
675 </form>
676
677 <div class="description">a</div>
678
679 <table id="changesetEntry">
680 <tr>
681 <th>author</th>
682 <td>&#116;&#101;&#115;&#116;</td>
683 </tr>
684 <tr>
685 <th>date</th>
686 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
687 </tr>
688 <tr>
689 <th>parents</th>
690 <td></td>
691 </tr>
692 <tr>
693 <th>children</th>
694 <td></td>
695 </tr>
696 </table>
697
698 <div class="overflow">
699 <div class="sourcefirst"> comparison</div>
700 <div class="legend">
701 <span class="legendinfo equal">equal</span>
702 <span class="legendinfo delete">deleted</span>
703 <span class="legendinfo insert">inserted</span>
704 <span class="legendinfo replace">replaced</span>
705 </div>
706
707 <table class="bigtable">
708 <thead class="header">
709 <tr>
710 <th>-1:000000000000</th>
711 <th>0:0cd96de13884</th>
712 </tr>
713 </thead>
714
715 <tbody class="block">
716
717 <tr id="r1">
718 <td class="source insert"><a href="#r1"> </a> </td>
719 <td class="source insert"><a href="#r1"> 1</a> a</td>
720 </tr>
721 </tbody>
722 </table>
723
724 </div>
725 </div>
726 </div>
727
728
729
730 </body>
731 </html>
732
733
734 comparison existing file
735
736 $ hg up
737 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
738 $ echo a >> a
739 $ hg ci -mc
740
741 $ hg parents --template "{rev}:{node|short}\n" -r tip
742 1:559edbd9ed20
743 $ hg log --template "{rev}:{node|short}\n" -r tip
744 2:d73db4d812ff
745
746 $ get-with-headers.py localhost:$HGPORT 'comparison/tip/a'
747 200 Script output follows
748
749 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
750 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
751 <head>
752 <link rel="icon" href="/static/hgicon.png" type="image/png" />
753 <meta name="robots" content="index, nofollow" />
754 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
755 <script type="text/javascript" src="/static/mercurial.js"></script>
756
757 <title>test: a comparison</title>
758 </head>
759 <body>
760
761 <div class="container">
762 <div class="menu">
763 <div class="logo">
764 <a href="https://mercurial-scm.org/">
765 <img src="/static/hglogo.png" alt="mercurial" /></a>
766 </div>
767 <ul>
768 <li><a href="/shortlog/tip">log</a></li>
769 <li><a href="/graph/tip">graph</a></li>
770 <li><a href="/tags">tags</a></li>
771 <li><a href="/bookmarks">bookmarks</a></li>
772 <li><a href="/branches">branches</a></li>
773 </ul>
774 <ul>
775 <li><a href="/rev/tip">changeset</a></li>
776 <li><a href="/file/tip">browse</a></li>
777 </ul>
778 <ul>
779 <li><a href="/file/tip/a">file</a></li>
780 <li><a href="/file/tip/a">latest</a></li>
781 <li><a href="/diff/tip/a">diff</a></li>
782 <li class="active">comparison</li>
783 <li><a href="/annotate/tip/a">annotate</a></li>
784 <li><a href="/log/tip/a">file log</a></li>
785 <li><a href="/raw-file/tip/a">raw</a></li>
786 </ul>
787 <ul>
788 <li><a href="/help">help</a></li>
789 </ul>
790 </div>
791
792 <div class="main">
793 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
794 <h3>
795 comparison a @ 2:<a href="/rev/d73db4d812ff">d73db4d812ff</a>
796 <span class="phase">draft</span> <span class="branchhead">default</span> <span class="tag">tip</span>
797 </h3>
798
799
800 <form class="search" action="/log">
801
802 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
803 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
804 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
805 </form>
806
807 <div class="description">c</div>
808
809 <table id="changesetEntry">
810 <tr>
811 <th>author</th>
812 <td>&#116;&#101;&#115;&#116;</td>
813 </tr>
814 <tr>
815 <th>date</th>
816 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
817 </tr>
818 <tr>
819 <th>parents</th>
820 <td><a href="/file/0cd96de13884/a">0cd96de13884</a> </td>
821 </tr>
822 <tr>
823 <th>children</th>
824 <td></td>
825 </tr>
826 </table>
827
828 <div class="overflow">
829 <div class="sourcefirst"> comparison</div>
830 <div class="legend">
831 <span class="legendinfo equal">equal</span>
832 <span class="legendinfo delete">deleted</span>
833 <span class="legendinfo insert">inserted</span>
834 <span class="legendinfo replace">replaced</span>
835 </div>
836
837 <table class="bigtable">
838 <thead class="header">
839 <tr>
840 <th>1:559edbd9ed20</th>
841 <th>2:d73db4d812ff</th>
842 </tr>
843 </thead>
844
845 <tbody class="block">
846
847 <tr id="l1r1">
848 <td class="source equal"><a href="#l1r1"> 1</a> a</td>
849 <td class="source equal"><a href="#l1r1"> 1</a> a</td>
850 </tr>
851 <tr id="r2">
852 <td class="source insert"><a href="#r2"> </a> </td>
853 <td class="source insert"><a href="#r2"> 2</a> a</td>
854 </tr>
855 </tbody>
856 </table>
857
858 </div>
859 </div>
860 </div>
861
862
863
864 </body>
865 </html>
866
867
868 comparison removed file
869
870 $ hg rm a
871 $ hg ci -md
872
873 $ hg parents --template "{rev}:{node|short}\n" -r tip
874 2:d73db4d812ff
875 $ hg log --template "{rev}:{node|short}\n" -r tip
876 3:20e80271eb7a
877
878 $ get-with-headers.py localhost:$HGPORT 'comparison/tip/a'
879 200 Script output follows
880
881 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
882 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
883 <head>
884 <link rel="icon" href="/static/hgicon.png" type="image/png" />
885 <meta name="robots" content="index, nofollow" />
886 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
887 <script type="text/javascript" src="/static/mercurial.js"></script>
888
889 <title>test: a comparison</title>
890 </head>
891 <body>
892
893 <div class="container">
894 <div class="menu">
895 <div class="logo">
896 <a href="https://mercurial-scm.org/">
897 <img src="/static/hglogo.png" alt="mercurial" /></a>
898 </div>
899 <ul>
900 <li><a href="/shortlog/tip">log</a></li>
901 <li><a href="/graph/tip">graph</a></li>
902 <li><a href="/tags">tags</a></li>
903 <li><a href="/bookmarks">bookmarks</a></li>
904 <li><a href="/branches">branches</a></li>
905 </ul>
906 <ul>
907 <li><a href="/rev/tip">changeset</a></li>
908 <li><a href="/file/tip">browse</a></li>
909 </ul>
910 <ul>
911 <li><a href="/file/tip/a">file</a></li>
912 <li><a href="/file/tip/a">latest</a></li>
913 <li><a href="/diff/tip/a">diff</a></li>
914 <li class="active">comparison</li>
915 <li><a href="/annotate/tip/a">annotate</a></li>
916 <li><a href="/log/tip/a">file log</a></li>
917 <li><a href="/raw-file/tip/a">raw</a></li>
918 </ul>
919 <ul>
920 <li><a href="/help">help</a></li>
921 </ul>
922 </div>
923
924 <div class="main">
925 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
926 <h3>
927 comparison a @ 3:<a href="/rev/20e80271eb7a">20e80271eb7a</a>
928 <span class="phase">draft</span> <span class="branchhead">default</span> <span class="tag">tip</span>
929 </h3>
930
931
932 <form class="search" action="/log">
933
934 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
935 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
936 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
937 </form>
938
939 <div class="description">d</div>
940
941 <table id="changesetEntry">
942 <tr>
943 <th>author</th>
944 <td>&#116;&#101;&#115;&#116;</td>
945 </tr>
946 <tr>
947 <th>date</th>
948 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
949 </tr>
950 <tr>
951 <th>parents</th>
952 <td><a href="/file/d73db4d812ff/a">d73db4d812ff</a> </td>
953 </tr>
954 <tr>
955 <th>children</th>
956 <td></td>
957 </tr>
958 </table>
959
960 <div class="overflow">
961 <div class="sourcefirst"> comparison</div>
962 <div class="legend">
963 <span class="legendinfo equal">equal</span>
964 <span class="legendinfo delete">deleted</span>
965 <span class="legendinfo insert">inserted</span>
966 <span class="legendinfo replace">replaced</span>
967 </div>
968
969 <table class="bigtable">
970 <thead class="header">
971 <tr>
972 <th>2:d73db4d812ff</th>
973 <th>3:20e80271eb7a</th>
974 </tr>
975 </thead>
976
977 <tbody class="block">
978
979 <tr id="l1">
980 <td class="source delete"><a href="#l1"> 1</a> a</td>
981 <td class="source delete"><a href="#l1"> </a> </td>
982 </tr>
983 <tr id="l2">
984 <td class="source delete"><a href="#l2"> 2</a> a</td>
985 <td class="source delete"><a href="#l2"> </a> </td>
986 </tr>
987 </tbody>
988 </table>
989
990 </div>
991 </div>
992 </div>
993
994
995
996 </body>
997 </html>
998
999
1000 comparison not-modified file
1001
1002 $ echo e > e
1003 $ hg add e
1004 $ hg ci -m e
1005 $ echo f > f
1006 $ hg add f
1007 $ hg ci -m f
1008 $ hg tip --template "{rev}:{node|short}\n"
1009 5:41d9fc4a6ae1
1010 $ hg diff -c tip e
1011 $ hg parents --template "{rev}:{node|short}\n" -r tip
1012 4:402bea3b0976
1013 $ hg parents --template "{rev}:{node|short}\n" -r tip e
1014 4:402bea3b0976
1015
1016 $ get-with-headers.py localhost:$HGPORT 'comparison/tip/e'
1017 200 Script output follows
1018
1019 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1020 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1021 <head>
1022 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1023 <meta name="robots" content="index, nofollow" />
1024 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1025 <script type="text/javascript" src="/static/mercurial.js"></script>
1026
1027 <title>test: e comparison</title>
1028 </head>
1029 <body>
1030
1031 <div class="container">
1032 <div class="menu">
1033 <div class="logo">
1034 <a href="https://mercurial-scm.org/">
1035 <img src="/static/hglogo.png" alt="mercurial" /></a>
1036 </div>
1037 <ul>
1038 <li><a href="/shortlog/tip">log</a></li>
1039 <li><a href="/graph/tip">graph</a></li>
1040 <li><a href="/tags">tags</a></li>
1041 <li><a href="/bookmarks">bookmarks</a></li>
1042 <li><a href="/branches">branches</a></li>
1043 </ul>
1044 <ul>
1045 <li><a href="/rev/tip">changeset</a></li>
1046 <li><a href="/file/tip">browse</a></li>
1047 </ul>
1048 <ul>
1049 <li><a href="/file/tip/e">file</a></li>
1050 <li><a href="/file/tip/e">latest</a></li>
1051 <li><a href="/diff/tip/e">diff</a></li>
1052 <li class="active">comparison</li>
1053 <li><a href="/annotate/tip/e">annotate</a></li>
1054 <li><a href="/log/tip/e">file log</a></li>
1055 <li><a href="/raw-file/tip/e">raw</a></li>
1056 </ul>
1057 <ul>
1058 <li><a href="/help">help</a></li>
1059 </ul>
1060 </div>
1061
1062 <div class="main">
1063 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1064 <h3>
1065 comparison e @ 5:<a href="/rev/41d9fc4a6ae1">41d9fc4a6ae1</a>
1066 <span class="phase">draft</span> <span class="branchhead">default</span> <span class="tag">tip</span>
1067 </h3>
1068
1069
1070 <form class="search" action="/log">
1071
1072 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
1073 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1074 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1075 </form>
1076
1077 <div class="description">f</div>
1078
1079 <table id="changesetEntry">
1080 <tr>
1081 <th>author</th>
1082 <td>&#116;&#101;&#115;&#116;</td>
1083 </tr>
1084 <tr>
1085 <th>date</th>
1086 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1087 </tr>
1088 <tr>
1089 <th>parents</th>
1090 <td><a href="/file/402bea3b0976/e">402bea3b0976</a> </td>
1091 </tr>
1092 <tr>
1093 <th>children</th>
1094 <td></td>
1095 </tr>
1096 </table>
1097
1098 <div class="overflow">
1099 <div class="sourcefirst"> comparison</div>
1100 <div class="legend">
1101 <span class="legendinfo equal">equal</span>
1102 <span class="legendinfo delete">deleted</span>
1103 <span class="legendinfo insert">inserted</span>
1104 <span class="legendinfo replace">replaced</span>
1105 </div>
1106
1107 <table class="bigtable">
1108 <thead class="header">
1109 <tr>
1110 <th>4:402bea3b0976</th>
1111 <th>5:41d9fc4a6ae1</th>
1112 </tr>
1113 </thead>
1114
1115 </table>
1116
1117 </div>
1118 </div>
1119 </div>
1120
1121
1122
1123 </body>
1124 </html>
1125
1126 $ cd ..
1127
1128 test import rev as raw-rev
1129
1130 $ hg clone -r0 test test1
1131 adding changesets
1132 adding manifests
1133 adding file changes
1134 added 1 changesets with 2 changes to 2 files
1135 new changesets 0cd96de13884
1136 updating to branch default
1137 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1138 $ cd test1
1139 $ hg import -q --bypass --exact http://localhost:$HGPORT/rev/1
1140
1141 repeat test above, with largefiles enabled
1142
1143 $ cd ..
1144 $ rm -r test1
1145 $ hg clone -r0 test test1
1146 adding changesets
1147 adding manifests
1148 adding file changes
1149 added 1 changesets with 2 changes to 2 files
1150 new changesets 0cd96de13884
1151 updating to branch default
1152 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1153 $ cd test1
1154 $ hg import --config extensions.largefiles= -q --bypass --exact http://localhost:$HGPORT/rev/1
1155
1156 raw revision with diff block numbers
1157
1158 $ killdaemons.py
1159 $ cat <<EOF > .hg/hgrc
1160 > [web]
1161 > templates = rawdiff
1162 > EOF
1163 $ mkdir rawdiff
1164 $ cat <<EOF > rawdiff/map
1165 > mimetype = 'text/plain; charset={encoding}'
1166 > changeset = '{diff}'
1167 > difflineplus = '{line}'
1168 > difflineminus = '{line}'
1169 > difflineat = '{line}'
1170 > diffline = '{line}'
1171 > filenodelink = ''
1172 > filenolink = ''
1173 > fileline = '{line}'
1174 > diffblock = 'Block: {blockno}\n{lines}\n'
1175 > EOF
1176 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1177 $ cat hg.pid >> $DAEMON_PIDS
1178 $ get-with-headers.py localhost:$HGPORT 'raw-rev/0'
1179 200 Script output follows
1180
1181 Block: 1
1182 diff -r 000000000000 -r 0cd96de13884 a
1183 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1184 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1185 @@ -0,0 +1,1 @@
1186 +a
1187
1188 Block: 2
1189 diff -r 000000000000 -r 0cd96de13884 b
1190 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1191 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1192 @@ -0,0 +1,1 @@
1193 +b
1194
1195 $ killdaemons.py
1196 $ rm .hg/hgrc rawdiff/map
1197 $ rmdir rawdiff
1198 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1199 $ cat hg.pid >> $DAEMON_PIDS
1200
1201 errors
1202
1203 $ cat ../test/errors.log
1204
1205 $ cd ..