##// END OF EJS Templates
revlog: make compressed size comparisons consistent...
revlog: make compressed size comparisons consistent revlog.compress() compares the compressed size to the input size and throws away the compressed data if it is larger than the input. This is the correct thing to do, as storing compressed data that is larger than the input takes up more storage space and makes reading slower. However, the comparison was implemented inconsistently. For the streaming compression mode, we threw away the result if it was greater than or equal to the input size. But for the one-shot compression, we threw away the compression only if it was greater than the input size! This patch changes the comparison for the simple case so it is consistent with the streaming case. As a few tests demonstrate, this adds 1 byte to some revlog entries. This is because of an added 'u' header on the chunk. It seems somewhat wrong to increase the revlog size here. However, IMO the cost of 1 byte in storage is insignificant compared to the performance gains of avoiding decompression. This patch should invite questions around the heuristic for throwing away compressed data. For example, I'd argue we should be more liberal about rejecting compressed data, additionally doing so where the number of bytes saved fails to reach a threshold. But we can have this discussion another time.

File last commit:

r26598:264e8890 default
r30792:4215dc1b default
Show More
filediff.tmpl
58 lines | 2.7 KiB | application/x-cheetah | CheetahLexer
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 {header}
<title>{repo|escape}: diff {file|escape}</title>
Thomas Arendsen Hein
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names...
r18526 <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
<link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 </head>
<body>
<div id="container">
<div class="page-header">
Angel Ezquerra <angel.ezquerra at gmail.com>
hgweb: add a "URL breadcrumb" to the index and repository pages...
r18258 <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file diff</h1>
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999
Thomas Arendsen Hein
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names...
r18526 <form action="{url|urlescape}log">
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 {sessionvars%hiddenformentry}
<dl class="search">
<dt><label>Search: </label></dt>
<dd><input type="text" name="rev" /></dd>
</dl>
</form>
<ul class="page-nav">
Thomas Arendsen Hein
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names...
r18526 <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
<li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
<li><a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a></li>
av6
hgweb: don't dereference symbolic revision in monoblue style...
r25604 <li><a href="{url|urlescape}graph/{symrev}{sessionvars%urlparameter}">graph</a></li>
Thomas Arendsen Hein
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names...
r18526 <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
av6
hgweb: don't dereference symbolic revision in monoblue style...
r25604 <li><a href="{url|urlescape}file/{symrev}{path|urlescape}{sessionvars%urlparameter}">files</a></li>
Thomas Arendsen Hein
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names...
r18526 <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 </ul>
</div>
<ul class="submenu">
av6
hgweb: don't dereference symbolic revision in monoblue style...
r25604 <li><a href="{url|urlescape}file/{symrev}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
av6
monoblue: add a link to the latest file revision...
r26598 <li><a href="{url|urlescape}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
av6
hgweb: don't dereference symbolic revision in monoblue style...
r25604 <li><a href="{url|urlescape}log/{symrev}/{file|urlescape}{sessionvars%urlparameter}">revisions</a></li>
<li><a href="{url|urlescape}annotate/{symrev}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 <li class="current">diff</li>
av6
hgweb: don't dereference symbolic revision in monoblue style...
r25604 <li><a href="{url|urlescape}comparison/{symrev}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
<li><a href="{url|urlescape}raw-diff/{symrev}/{file|urlescape}">raw</a></li>
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 </ul>
<h2 class="no-link no-border">diff: {file|escape}</h2>
<h3 class="changeset">{file|escape}</h3>
<dl class="overview">
{branch%filerevbranch}
<dt>changeset {rev}</dt>
Thomas Arendsen Hein
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names...
r18526 <dd><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 {parent%filediffparent}
{child%filediffchild}
</dl>
av6
monoblue: port code selection without line numbers from gitweb...
r26314 <div class="diff diffblocks">
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 {diff}
</div>
{footer}