# HG changeset patch # User Anton Shestakov # Date 1434436673 -28800 # Node ID dd89304687a3975832b236fadf255ef7e002b9a9 # Parent 0cdcbc477cacdf24943a81e3e94b4ae3a0eb097b hgweb: don't dereference symbolic revision in gitweb style Let's make gitweb templates use symbolic revision in navigation links. The majority of links (log, filelog, annotate, etc) still use node hashes. Some pages don't have permanent links to current node hash (so it's not very easy to go from /rev/tip to /rev/), this will be addressed in future patches. diff -r 0cdcbc477cac -r dd89304687a3 mercurial/templates/gitweb/changelog.tmpl --- a/mercurial/templates/gitweb/changelog.tmpl Tue Jun 16 13:59:49 2015 +0800 +++ b/mercurial/templates/gitweb/changelog.tmpl Tue Jun 16 14:37:53 2015 +0800 @@ -21,13 +21,13 @@ diff -r 0cdcbc477cac -r dd89304687a3 mercurial/templates/gitweb/filecomparison.tmpl --- a/mercurial/templates/gitweb/filecomparison.tmpl Tue Jun 16 13:59:49 2015 +0800 +++ b/mercurial/templates/gitweb/filecomparison.tmpl Tue Jun 16 14:37:53 2015 +0800 @@ -20,15 +20,15 @@ tags | bookmarks | branches | -files | -changeset | -file | +files | +changeset | +file | latest | -revisions | -annotate | -diff | +revisions | +annotate | +diff | comparison | -raw | +raw | help
diff -r 0cdcbc477cac -r dd89304687a3 mercurial/templates/gitweb/filediff.tmpl --- a/mercurial/templates/gitweb/filediff.tmpl Tue Jun 16 13:59:49 2015 +0800 +++ b/mercurial/templates/gitweb/filediff.tmpl Tue Jun 16 14:37:53 2015 +0800 @@ -20,15 +20,15 @@ tags | bookmarks | branches | -files | -changeset | -file | +files | +changeset | +file | latest | -revisions | -annotate | +revisions | +annotate | diff | -comparison | -raw | +comparison | +raw | help
diff -r 0cdcbc477cac -r dd89304687a3 mercurial/templates/gitweb/filelog.tmpl --- a/mercurial/templates/gitweb/filelog.tmpl Tue Jun 16 13:59:49 2015 +0800 +++ b/mercurial/templates/gitweb/filelog.tmpl Tue Jun 16 14:37:53 2015 +0800 @@ -20,11 +20,11 @@ tags | bookmarks | branches | -file | +file | revisions | -annotate | -diff | -comparison | +annotate | +diff | +comparison | rss | help
diff -r 0cdcbc477cac -r dd89304687a3 mercurial/templates/gitweb/filerevision.tmpl --- a/mercurial/templates/gitweb/filerevision.tmpl Tue Jun 16 13:59:49 2015 +0800 +++ b/mercurial/templates/gitweb/filerevision.tmpl Tue Jun 16 14:37:53 2015 +0800 @@ -20,15 +20,15 @@ tags | bookmarks | branches | -files | -changeset | +files | +changeset | file | latest | -revisions | -annotate | -diff | -comparison | -raw | +revisions | +annotate | +diff | +comparison | +raw | help
diff -r 0cdcbc477cac -r dd89304687a3 mercurial/templates/gitweb/graph.tmpl --- a/mercurial/templates/gitweb/graph.tmpl Tue Jun 16 13:59:49 2015 +0800 +++ b/mercurial/templates/gitweb/graph.tmpl Tue Jun 16 14:37:53 2015 +0800 @@ -22,16 +22,16 @@ @@ -103,8 +103,8 @@ diff -r 0cdcbc477cac -r dd89304687a3 mercurial/templates/gitweb/manifest.tmpl --- a/mercurial/templates/gitweb/manifest.tmpl Tue Jun 16 13:59:49 2015 +0800 +++ b/mercurial/templates/gitweb/manifest.tmpl Tue Jun 16 14:37:53 2015 +0800 @@ -21,7 +21,7 @@ bookmarks | branches | files | -changeset {archives%archiveentry} | +changeset {archives%archiveentry} | help
@@ -32,7 +32,7 @@ drwxr-xr-x -[up] +[up]   {dentries%direntry} diff -r 0cdcbc477cac -r dd89304687a3 mercurial/templates/gitweb/map --- a/mercurial/templates/gitweb/map Tue Jun 16 13:59:49 2015 +0800 +++ b/mercurial/templates/gitweb/map Tue Jun 16 14:37:53 2015 +0800 @@ -66,11 +66,11 @@ - {basename|escape} - {emptydirs|escape} + {basename|escape} + {emptydirs|escape} - files + files ' fileentry = ' @@ -79,12 +79,12 @@ {date|isodate} {size} - {basename|escape} + {basename|escape} - file | - revisions | - annotate + file | + revisions | + annotate ' filerevision = filerevision.tmpl @@ -303,7 +303,7 @@ {rename%filelogrename} ' -archiveentry = ' | {type|escape} ' +archiveentry = ' | {type|escape} ' indexentry = ' diff -r 0cdcbc477cac -r dd89304687a3 mercurial/templates/gitweb/shortlog.tmpl --- a/mercurial/templates/gitweb/shortlog.tmpl Tue Jun 16 13:59:49 2015 +0800 +++ b/mercurial/templates/gitweb/shortlog.tmpl Tue Jun 16 14:37:53 2015 +0800 @@ -21,12 +21,12 @@ diff -r 0cdcbc477cac -r dd89304687a3 tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Tue Jun 16 13:59:49 2015 +0800 +++ b/tests/test-hgweb-commands.t Tue Jun 16 14:37:53 2015 +0800 @@ -1723,16 +1723,16 @@ @@ -1804,8 +1804,8 @@ diff -r 0cdcbc477cac -r dd89304687a3 tests/test-hgweb-descend-empties.t --- a/tests/test-hgweb-descend-empties.t Tue Jun 16 13:59:49 2015 +0800 +++ b/tests/test-hgweb-descend-empties.t Tue Jun 16 14:37:53 2015 +0800 @@ -414,7 +414,7 @@ bookmarks | branches | files | - changeset | + changeset | help
@@ -425,7 +425,7 @@ drwxr-xr-x - [up] + [up]   @@ -434,11 +434,11 @@ - a1 - a2/a3/a4 + a1 + a2/a3/a4 - files + files @@ -446,11 +446,11 @@ - b1 - b2/b3 + b1 + b2/b3 - files + files @@ -458,11 +458,11 @@ - d1 - d2 + d1 + d2 - files + files diff -r 0cdcbc477cac -r dd89304687a3 tests/test-hgweb-symrev.t --- a/tests/test-hgweb-symrev.t Tue Jun 16 13:59:49 2015 +0800 +++ b/tests/test-hgweb-symrev.t Tue Jun 16 14:37:53 2015 +0800 @@ -394,8 +394,8 @@ files $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=gitweb' | egrep $REVLINKS - changelog | - files | zip | + changelog | + files | zip |
(0) tip
changeset | @@ -409,8 +409,8 @@ (0) tip $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?style=gitweb' | egrep $REVLINKS - shortlog | - files | zip | + shortlog | + files | zip | (0) tip
Thu, 01 Jan 1970 00:00:00 +0000third default tip changeset
@@ -421,13 +421,13 @@ (0) tip
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph?style=gitweb' | egrep $REVLINKS - changelog | - files | - less - more + changelog | + files | + less + more | (0) tip
- less - more + less + more | (0) tip $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'tags?style=gitweb' | egrep $REVLINKS @@ -449,15 +449,15 @@ files $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file?style=gitweb' | egrep $REVLINKS - changeset | zip | - [up] - dir - - files - foo - file | - revisions | - annotate + changeset | zip | + [up] + dir + + files + foo + file | + revisions | + annotate $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=gitweb&rev=all()' | egrep $REVLINKS files | zip @@ -469,10 +469,10 @@ changeset
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'rev/xyzzy?style=gitweb' | egrep $REVLINKS - shortlog | - changelog | - files | - raw | zip | + shortlog | + changelog | + files | + raw | zip | second xyzzy 43c799df6e75 9d8c40cba617 @@ -484,8 +484,8 @@ revisions $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog/xyzzy?style=gitweb' | egrep $REVLINKS - changelog | - files | zip | + changelog | + files | zip |
(0) tip
changeset | @@ -496,8 +496,8 @@ (0) tip $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy?style=gitweb' | egrep $REVLINKS - shortlog | - files | zip | + shortlog | + files | zip | (0) tip
Thu, 01 Jan 1970 00:00:00 +0000second xyzzy changeset
@@ -506,44 +506,44 @@ (0) tip
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph/xyzzy?style=gitweb' | egrep $REVLINKS - changelog | - files | - less - more + changelog | + files | + less + more | (0) tip
- less - more + less + more | (0) tip $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy?style=gitweb' | egrep $REVLINKS - changeset | zip | - [up] - dir - - files - foo - file | - revisions | - annotate + changeset | zip | + [up] + dir + + files + foo + file | + revisions | + annotate $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy/foo?style=gitweb' | egrep $REVLINKS - files | - changeset | + files | + changeset | latest | - revisions | - annotate | - diff | - comparison | - raw | + revisions | + annotate | + diff | + comparison | + raw | a7c1559b7bba 9d8c40cba617 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy/foo?style=gitweb' | egrep $REVLINKS - file | - annotate | - diff | - comparison | + file | + annotate | + diff | + comparison | rss | (0) tip @@ -557,14 +557,14 @@ (0) tip $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'annotate/xyzzy/foo?style=gitweb' | egrep $REVLINKS - files | - changeset | - file | + files | + changeset | + file | latest | - revisions | - diff | - comparison | - raw | + revisions | + diff | + comparison | + raw | a7c1559b7bba 9d8c40cba617 @@ -572,27 +572,27 @@ files | - changeset | - file | + files | + changeset | + file | latest | - revisions | - annotate | - comparison | - raw | + revisions | + annotate | + comparison | + raw | a7c1559b7bba 9d8c40cba617 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'comparison/xyzzy/foo?style=gitweb' | egrep $REVLINKS - files | - changeset | - file | + files | + changeset | + file | latest | - revisions | - annotate | - diff | - raw | + revisions | + annotate | + diff | + raw | a7c1559b7bba 9d8c40cba617