Patchwork [3,of,3] hgweb: don't point file links at tip hash where it doesn't make sense

login
register
mail settings
Submitter Anton Shestakov
Date June 12, 2015, 10:55 a.m.
Message ID <7a76ca751a7487aff572.1434106537@neuro>
Download mbox | patch
Permalink /patch/9611/
State Accepted
Headers show

Comments

Anton Shestakov - June 12, 2015, 10:55 a.m.
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1434105250 -28800
#      Fri Jun 12 18:34:10 2015 +0800
# Node ID 7a76ca751a7487aff572f0bc666a7f737e2dd668
# Parent  69b9d331cbf3a8fe41d13c7c1853edf0b86dffca
hgweb: don't point file links at tip hash where it doesn't make sense

Some pages, e.g. bookmarks, help and summary don't have a meaningful revision
context: they always either show information about tip or about the whole repo
(and not about any specific changeset). And error pages can just show hgweb
error messages, not related to any repo or changeset.

Having a hash in the links worked (even when '{node|short}' resolved to an
empty string on error pages), but seeing pages without revision context provide
links with hashes is a bit confusing (unless you keep current tip hash in your
head at all times) and not consistent with other template styles and other
links on the same page: they don't have a hash.

Let's just link to '/file', which is equal to '/file/tip'.
Pierre-Yves David - June 12, 2015, 9:04 p.m.
On 06/12/2015 03:55 AM, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6@dwimlabs.net>
> # Date 1434105250 -28800
> #      Fri Jun 12 18:34:10 2015 +0800
> # Node ID 7a76ca751a7487aff572f0bc666a7f737e2dd668
> # Parent  69b9d331cbf3a8fe41d13c7c1853edf0b86dffca
> hgweb: don't point file links at tip hash where it doesn't make sense

These 3 a pushed to the clowncopter, thanks.
Augie Fackler - June 12, 2015, 10 p.m.
On Fri, Jun 12, 2015 at 06:55:37PM +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6@dwimlabs.net>
> # Date 1434105250 -28800
> #      Fri Jun 12 18:34:10 2015 +0800
> # Node ID 7a76ca751a7487aff572f0bc666a7f737e2dd668
> # Parent  69b9d331cbf3a8fe41d13c7c1853edf0b86dffca
> hgweb: don't point file links at tip hash where it doesn't make sense

These are queued, thanks. I've meant to do something like this roughly forever.

> Some pages, e.g. bookmarks, help and summary don't have a meaningful revision
> context: they always either show information about tip or about the whole repo
> (and not about any specific changeset). And error pages can just show hgweb
> error messages, not related to any repo or changeset.
>
> Having a hash in the links worked (even when '{node|short}' resolved to an
> empty string on error pages), but seeing pages without revision context provide
> links with hashes is a bit confusing (unless you keep current tip hash in your
> head at all times) and not consistent with other template styles and other
> links on the same page: they don't have a hash.
>
> Let's just link to '/file', which is equal to '/file/tip'.
>
> diff --git a/mercurial/templates/gitweb/bookmarks.tmpl b/mercurial/templates/gitweb/bookmarks.tmpl
> --- a/mercurial/templates/gitweb/bookmarks.tmpl
> +++ b/mercurial/templates/gitweb/bookmarks.tmpl
> @@ -20,7 +20,7 @@
>  <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
>  bookmarks |
>  <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
> -<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
> +<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
>  <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
>  <br/>
>  </div>
> diff --git a/mercurial/templates/gitweb/branches.tmpl b/mercurial/templates/gitweb/branches.tmpl
> --- a/mercurial/templates/gitweb/branches.tmpl
> +++ b/mercurial/templates/gitweb/branches.tmpl
> @@ -20,7 +20,7 @@
>  <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
>  <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
>  branches |
> -<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
> +<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
>  <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
>  <br/>
>  </div>
> diff --git a/mercurial/templates/gitweb/error.tmpl b/mercurial/templates/gitweb/error.tmpl
> --- a/mercurial/templates/gitweb/error.tmpl
> +++ b/mercurial/templates/gitweb/error.tmpl
> @@ -19,7 +19,7 @@
>  <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
>  <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
>  <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
> -<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
> +<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
>  <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
>  <br/>
>  </div>
> diff --git a/mercurial/templates/gitweb/help.tmpl b/mercurial/templates/gitweb/help.tmpl
> --- a/mercurial/templates/gitweb/help.tmpl
> +++ b/mercurial/templates/gitweb/help.tmpl
> @@ -20,7 +20,7 @@
>  <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
>  <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
>  <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
> -<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
> +<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
>  help
>  <br/>
>  </div>
> diff --git a/mercurial/templates/gitweb/helptopics.tmpl b/mercurial/templates/gitweb/helptopics.tmpl
> --- a/mercurial/templates/gitweb/helptopics.tmpl
> +++ b/mercurial/templates/gitweb/helptopics.tmpl
> @@ -20,7 +20,7 @@
>  <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
>  <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
>  <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
> -<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
> +<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
>  help
>  <br/>
>  </div>
> diff --git a/mercurial/templates/gitweb/search.tmpl b/mercurial/templates/gitweb/search.tmpl
> --- a/mercurial/templates/gitweb/search.tmpl
> +++ b/mercurial/templates/gitweb/search.tmpl
> @@ -27,7 +27,7 @@
>  <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
>  <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
>  <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
> -<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry}
> +<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a>{archives%archiveentry}
>   |
>   <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
>  <br/>
> diff --git a/mercurial/templates/gitweb/summary.tmpl b/mercurial/templates/gitweb/summary.tmpl
> --- a/mercurial/templates/gitweb/summary.tmpl
> +++ b/mercurial/templates/gitweb/summary.tmpl
> @@ -26,7 +26,7 @@ summary |
>  <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
>  <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
>  <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
> -<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry} |
> +<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a>{archives%archiveentry} |
>  <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
>  <br/>
>  </div>
> diff --git a/mercurial/templates/gitweb/tags.tmpl b/mercurial/templates/gitweb/tags.tmpl
> --- a/mercurial/templates/gitweb/tags.tmpl
> +++ b/mercurial/templates/gitweb/tags.tmpl
> @@ -20,7 +20,7 @@
>  tags |
>  <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
>  <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
> -<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
> +<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
>  <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
>  <br/>
>  </div>
> diff --git a/mercurial/templates/monoblue/bookmarks.tmpl b/mercurial/templates/monoblue/bookmarks.tmpl
> --- a/mercurial/templates/monoblue/bookmarks.tmpl
> +++ b/mercurial/templates/monoblue/bookmarks.tmpl
> @@ -25,7 +25,7 @@
>              <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
>              <li class="current">bookmarks</li>
>              <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
> -            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
> +            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
>              <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
>          </ul>
>      </div>
> diff --git a/mercurial/templates/monoblue/branches.tmpl b/mercurial/templates/monoblue/branches.tmpl
> --- a/mercurial/templates/monoblue/branches.tmpl
> +++ b/mercurial/templates/monoblue/branches.tmpl
> @@ -25,7 +25,7 @@
>              <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
>              <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
>              <li class="current">branches</li>
> -            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
> +            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
>              <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
>          </ul>
>      </div>
> diff --git a/mercurial/templates/monoblue/error.tmpl b/mercurial/templates/monoblue/error.tmpl
> --- a/mercurial/templates/monoblue/error.tmpl
> +++ b/mercurial/templates/monoblue/error.tmpl
> @@ -25,7 +25,7 @@
>              <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>
> -            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
> +            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
>              <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
>          </ul>
>      </div>
> diff --git a/mercurial/templates/monoblue/help.tmpl b/mercurial/templates/monoblue/help.tmpl
> --- a/mercurial/templates/monoblue/help.tmpl
> +++ b/mercurial/templates/monoblue/help.tmpl
> @@ -25,7 +25,7 @@
>              <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>
> -            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
> +            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
>              <li class="current">help</li>
>          </ul>
>      </div>
> diff --git a/mercurial/templates/monoblue/helptopics.tmpl b/mercurial/templates/monoblue/helptopics.tmpl
> --- a/mercurial/templates/monoblue/helptopics.tmpl
> +++ b/mercurial/templates/monoblue/helptopics.tmpl
> @@ -25,7 +25,7 @@
>              <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}help{sessionvars%urlparameter}">branches</a></li>
> -            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
> +            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
>              <li class="current">help</li>
>          </ul>
>      </div>
> diff --git a/mercurial/templates/monoblue/notfound.tmpl b/mercurial/templates/monoblue/notfound.tmpl
> --- a/mercurial/templates/monoblue/notfound.tmpl
> +++ b/mercurial/templates/monoblue/notfound.tmpl
> @@ -25,7 +25,7 @@
>              <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>
> -            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
> +            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
>              {archives%archiveentry}
>              <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
>          </ul>
> diff --git a/mercurial/templates/monoblue/search.tmpl b/mercurial/templates/monoblue/search.tmpl
> --- a/mercurial/templates/monoblue/search.tmpl
> +++ b/mercurial/templates/monoblue/search.tmpl
> @@ -25,7 +25,7 @@
>              <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>
> -            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
> +            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
>              {archives%archiveentry}
>              <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
>          </ul>
> diff --git a/mercurial/templates/monoblue/summary.tmpl b/mercurial/templates/monoblue/summary.tmpl
> --- a/mercurial/templates/monoblue/summary.tmpl
> +++ b/mercurial/templates/monoblue/summary.tmpl
> @@ -25,7 +25,7 @@
>              <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>
> -            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
> +            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
>              <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
>          </ul>
>      </div>
> diff --git a/mercurial/templates/monoblue/tags.tmpl b/mercurial/templates/monoblue/tags.tmpl
> --- a/mercurial/templates/monoblue/tags.tmpl
> +++ b/mercurial/templates/monoblue/tags.tmpl
> @@ -25,7 +25,7 @@
>              <li class="current">tags</li>
>              <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
>              <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
> -            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
> +            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
>              <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
>          </ul>
>      </div>
> diff --git a/mercurial/templates/spartan/branches.tmpl b/mercurial/templates/spartan/branches.tmpl
> --- a/mercurial/templates/spartan/branches.tmpl
> +++ b/mercurial/templates/spartan/branches.tmpl
> @@ -12,7 +12,7 @@
>  <a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a>
>  <a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
>  <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
> -<a href="{url|urlescape}file/{node|short}/{sessionvars%urlparameter}">files</a>
> +<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a>
>  <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
>  <a type="application/rss+xml" href="{url|urlescape}rss-branches">rss</a>
>  <a type="application/atom+xml" href="{url|urlescape}atom-branches">atom</a>
> diff --git a/mercurial/templates/spartan/search.tmpl b/mercurial/templates/spartan/search.tmpl
> --- a/mercurial/templates/spartan/search.tmpl
> +++ b/mercurial/templates/spartan/search.tmpl
> @@ -9,7 +9,7 @@
>  <a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
>  <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
>  <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
> -<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
> +<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a>
>  {archives%archiveentry}
>  <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
>  </div>
> diff --git a/mercurial/templates/spartan/tags.tmpl b/mercurial/templates/spartan/tags.tmpl
> --- a/mercurial/templates/spartan/tags.tmpl
> +++ b/mercurial/templates/spartan/tags.tmpl
> @@ -12,7 +12,7 @@
>  <a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a>
>  <a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
>  <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
> -<a href="{url|urlescape}file/{node|short}/{sessionvars%urlparameter}">files</a>
> +<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a>
>  <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
>  <a type="application/rss+xml" href="{url|urlescape}rss-tags">rss</a>
>  <a type="application/atom+xml" href="{url|urlescape}atom-tags">atom</a>
> diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
> --- a/tests/test-hgweb-commands.t
> +++ b/tests/test-hgweb-commands.t
> @@ -1525,7 +1525,7 @@ Overviews
>    <a href="/tags?style=gitweb">tags</a> |
>    <a href="/bookmarks?style=gitweb">bookmarks</a> |
>    <a href="/branches?style=gitweb">branches</a> |
> -  <a href="/file/cad8025a2e87?style=gitweb">files</a> |
> +  <a href="/file?style=gitweb">files</a> |
>    <a href="/help?style=gitweb">help</a>
>    <br/>
>    </div>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/templates/gitweb/bookmarks.tmpl b/mercurial/templates/gitweb/bookmarks.tmpl
--- a/mercurial/templates/gitweb/bookmarks.tmpl
+++ b/mercurial/templates/gitweb/bookmarks.tmpl
@@ -20,7 +20,7 @@ 
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
 bookmarks |
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
diff --git a/mercurial/templates/gitweb/branches.tmpl b/mercurial/templates/gitweb/branches.tmpl
--- a/mercurial/templates/gitweb/branches.tmpl
+++ b/mercurial/templates/gitweb/branches.tmpl
@@ -20,7 +20,7 @@ 
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
 <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
 branches |
-<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
diff --git a/mercurial/templates/gitweb/error.tmpl b/mercurial/templates/gitweb/error.tmpl
--- a/mercurial/templates/gitweb/error.tmpl
+++ b/mercurial/templates/gitweb/error.tmpl
@@ -19,7 +19,7 @@ 
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
 <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
diff --git a/mercurial/templates/gitweb/help.tmpl b/mercurial/templates/gitweb/help.tmpl
--- a/mercurial/templates/gitweb/help.tmpl
+++ b/mercurial/templates/gitweb/help.tmpl
@@ -20,7 +20,7 @@ 
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
 <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
 help
 <br/>
 </div>
diff --git a/mercurial/templates/gitweb/helptopics.tmpl b/mercurial/templates/gitweb/helptopics.tmpl
--- a/mercurial/templates/gitweb/helptopics.tmpl
+++ b/mercurial/templates/gitweb/helptopics.tmpl
@@ -20,7 +20,7 @@ 
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
 <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
 help
 <br/>
 </div>
diff --git a/mercurial/templates/gitweb/search.tmpl b/mercurial/templates/gitweb/search.tmpl
--- a/mercurial/templates/gitweb/search.tmpl
+++ b/mercurial/templates/gitweb/search.tmpl
@@ -27,7 +27,7 @@ 
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
 <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry}
+<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a>{archives%archiveentry}
  |
  <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
diff --git a/mercurial/templates/gitweb/summary.tmpl b/mercurial/templates/gitweb/summary.tmpl
--- a/mercurial/templates/gitweb/summary.tmpl
+++ b/mercurial/templates/gitweb/summary.tmpl
@@ -26,7 +26,7 @@  summary |
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
 <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry} |
+<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a>{archives%archiveentry} |
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
diff --git a/mercurial/templates/gitweb/tags.tmpl b/mercurial/templates/gitweb/tags.tmpl
--- a/mercurial/templates/gitweb/tags.tmpl
+++ b/mercurial/templates/gitweb/tags.tmpl
@@ -20,7 +20,7 @@ 
 tags |
 <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
diff --git a/mercurial/templates/monoblue/bookmarks.tmpl b/mercurial/templates/monoblue/bookmarks.tmpl
--- a/mercurial/templates/monoblue/bookmarks.tmpl
+++ b/mercurial/templates/monoblue/bookmarks.tmpl
@@ -25,7 +25,7 @@ 
             <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
             <li class="current">bookmarks</li>
             <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
             <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
diff --git a/mercurial/templates/monoblue/branches.tmpl b/mercurial/templates/monoblue/branches.tmpl
--- a/mercurial/templates/monoblue/branches.tmpl
+++ b/mercurial/templates/monoblue/branches.tmpl
@@ -25,7 +25,7 @@ 
             <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
             <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
             <li class="current">branches</li>
-            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
             <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
diff --git a/mercurial/templates/monoblue/error.tmpl b/mercurial/templates/monoblue/error.tmpl
--- a/mercurial/templates/monoblue/error.tmpl
+++ b/mercurial/templates/monoblue/error.tmpl
@@ -25,7 +25,7 @@ 
             <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>
-            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
             <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
diff --git a/mercurial/templates/monoblue/help.tmpl b/mercurial/templates/monoblue/help.tmpl
--- a/mercurial/templates/monoblue/help.tmpl
+++ b/mercurial/templates/monoblue/help.tmpl
@@ -25,7 +25,7 @@ 
             <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>
-            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
             <li class="current">help</li>
         </ul>
     </div>
diff --git a/mercurial/templates/monoblue/helptopics.tmpl b/mercurial/templates/monoblue/helptopics.tmpl
--- a/mercurial/templates/monoblue/helptopics.tmpl
+++ b/mercurial/templates/monoblue/helptopics.tmpl
@@ -25,7 +25,7 @@ 
             <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}help{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
             <li class="current">help</li>
         </ul>
     </div>
diff --git a/mercurial/templates/monoblue/notfound.tmpl b/mercurial/templates/monoblue/notfound.tmpl
--- a/mercurial/templates/monoblue/notfound.tmpl
+++ b/mercurial/templates/monoblue/notfound.tmpl
@@ -25,7 +25,7 @@ 
             <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>
-            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
             {archives%archiveentry}
             <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
diff --git a/mercurial/templates/monoblue/search.tmpl b/mercurial/templates/monoblue/search.tmpl
--- a/mercurial/templates/monoblue/search.tmpl
+++ b/mercurial/templates/monoblue/search.tmpl
@@ -25,7 +25,7 @@ 
             <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>
-            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
             {archives%archiveentry}
             <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
diff --git a/mercurial/templates/monoblue/summary.tmpl b/mercurial/templates/monoblue/summary.tmpl
--- a/mercurial/templates/monoblue/summary.tmpl
+++ b/mercurial/templates/monoblue/summary.tmpl
@@ -25,7 +25,7 @@ 
             <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>
-            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
             <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
diff --git a/mercurial/templates/monoblue/tags.tmpl b/mercurial/templates/monoblue/tags.tmpl
--- a/mercurial/templates/monoblue/tags.tmpl
+++ b/mercurial/templates/monoblue/tags.tmpl
@@ -25,7 +25,7 @@ 
             <li class="current">tags</li>
             <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
             <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}file{sessionvars%urlparameter}">files</a></li>
             <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
diff --git a/mercurial/templates/spartan/branches.tmpl b/mercurial/templates/spartan/branches.tmpl
--- a/mercurial/templates/spartan/branches.tmpl
+++ b/mercurial/templates/spartan/branches.tmpl
@@ -12,7 +12,7 @@ 
 <a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a>
 <a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
-<a href="{url|urlescape}file/{node|short}/{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a>
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <a type="application/rss+xml" href="{url|urlescape}rss-branches">rss</a>
 <a type="application/atom+xml" href="{url|urlescape}atom-branches">atom</a>
diff --git a/mercurial/templates/spartan/search.tmpl b/mercurial/templates/spartan/search.tmpl
--- a/mercurial/templates/spartan/search.tmpl
+++ b/mercurial/templates/spartan/search.tmpl
@@ -9,7 +9,7 @@ 
 <a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a>
 {archives%archiveentry}
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
diff --git a/mercurial/templates/spartan/tags.tmpl b/mercurial/templates/spartan/tags.tmpl
--- a/mercurial/templates/spartan/tags.tmpl
+++ b/mercurial/templates/spartan/tags.tmpl
@@ -12,7 +12,7 @@ 
 <a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a>
 <a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url|urlescape}file/{node|short}/{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}file{sessionvars%urlparameter}">files</a>
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <a type="application/rss+xml" href="{url|urlescape}rss-tags">rss</a>
 <a type="application/atom+xml" href="{url|urlescape}atom-tags">atom</a>
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -1525,7 +1525,7 @@  Overviews
   <a href="/tags?style=gitweb">tags</a> |
   <a href="/bookmarks?style=gitweb">bookmarks</a> |
   <a href="/branches?style=gitweb">branches</a> |
-  <a href="/file/cad8025a2e87?style=gitweb">files</a> |
+  <a href="/file?style=gitweb">files</a> |
   <a href="/help?style=gitweb">help</a>
   <br/>
   </div>