# HG changeset patch # User Anton Shestakov # Date 1434426730 -28800 # Node ID 1cac419ab8313199c87868c9c32295228be19342 # Parent 85fb416f2fa7b1db5c63370441f1a49c43c57928 hgweb: don't dereference symbolic revision in spartan style Let's make spartan templates use symbolic revision in navigation links. The majority of links (log, filelog, annotate, etc) still use node hashes, and many pages also have permanent link to current node hash (i.e. you can go from /rev/tip to /rev/ without manual url editing), so it's safe to update navigation. diff -r 85fb416f2fa7 -r 1cac419ab831 mercurial/templates/spartan/changelog.tmpl --- a/mercurial/templates/spartan/changelog.tmpl Tue Jun 16 02:07:25 2015 +0800 +++ b/mercurial/templates/spartan/changelog.tmpl Tue Jun 16 11:52:10 2015 +0800 @@ -8,11 +8,11 @@
-shortlog +shortlog graph tags branches -files +files {archives%archiveentry} help rss diff -r 85fb416f2fa7 -r 1cac419ab831 mercurial/templates/spartan/changeset.tmpl --- a/mercurial/templates/spartan/changeset.tmpl Tue Jun 16 02:07:25 2015 +0800 +++ b/mercurial/templates/spartan/changeset.tmpl Tue Jun 16 11:52:10 2015 +0800 @@ -4,13 +4,13 @@ diff -r 85fb416f2fa7 -r 1cac419ab831 mercurial/templates/spartan/fileannotate.tmpl --- a/mercurial/templates/spartan/fileannotate.tmpl Tue Jun 16 02:07:25 2015 +0800 +++ b/mercurial/templates/spartan/fileannotate.tmpl Tue Jun 16 11:52:10 2015 +0800 @@ -4,16 +4,16 @@ diff -r 85fb416f2fa7 -r 1cac419ab831 mercurial/templates/spartan/filediff.tmpl --- a/mercurial/templates/spartan/filediff.tmpl Tue Jun 16 02:07:25 2015 +0800 +++ b/mercurial/templates/spartan/filediff.tmpl Tue Jun 16 11:52:10 2015 +0800 @@ -4,16 +4,16 @@ diff -r 85fb416f2fa7 -r 1cac419ab831 mercurial/templates/spartan/filelog.tmpl --- a/mercurial/templates/spartan/filelog.tmpl Tue Jun 16 02:07:25 2015 +0800 +++ b/mercurial/templates/spartan/filelog.tmpl Tue Jun 16 11:52:10 2015 +0800 @@ -13,8 +13,8 @@ graph tags branches -file -annotate +file +annotate help rss atom diff -r 85fb416f2fa7 -r 1cac419ab831 mercurial/templates/spartan/filerevision.tmpl --- a/mercurial/templates/spartan/filerevision.tmpl Tue Jun 16 02:07:25 2015 +0800 +++ b/mercurial/templates/spartan/filerevision.tmpl Tue Jun 16 11:52:10 2015 +0800 @@ -4,16 +4,16 @@ diff -r 85fb416f2fa7 -r 1cac419ab831 mercurial/templates/spartan/graph.tmpl --- a/mercurial/templates/spartan/graph.tmpl Tue Jun 16 02:07:25 2015 +0800 +++ b/mercurial/templates/spartan/graph.tmpl Tue Jun 16 11:52:10 2015 +0800 @@ -13,7 +13,7 @@ shortlog tags branches -files +files help
diff -r 85fb416f2fa7 -r 1cac419ab831 mercurial/templates/spartan/manifest.tmpl --- a/mercurial/templates/spartan/manifest.tmpl Tue Jun 16 02:07:25 2015 +0800 +++ b/mercurial/templates/spartan/manifest.tmpl Tue Jun 16 11:52:10 2015 +0800 @@ -4,12 +4,12 @@ @@ -21,7 +21,7 @@ drwxr-xr-x      - [up] + [up] {dentries%direntry} {fentries%fileentry} diff -r 85fb416f2fa7 -r 1cac419ab831 mercurial/templates/spartan/map --- a/mercurial/templates/spartan/map Tue Jun 16 02:07:25 2015 +0800 +++ b/mercurial/templates/spartan/map Tue Jun 16 11:52:10 2015 +0800 @@ -31,8 +31,8 @@     - {basename|escape}/ - + {basename|escape}/ + {emptydirs|urlescape} ' @@ -41,7 +41,7 @@ {permissions|permissions}  {date|isodate}  {size}  - {basename|escape}' + {basename|escape}' filerevision = filerevision.tmpl fileannotate = fileannotate.tmpl @@ -183,7 +183,7 @@ ' index = index.tmpl -archiveentry = '{type|escape} ' +archiveentry = '{type|escape} ' notfound = notfound.tmpl error = error.tmpl urlparameter = '{separator}{name}={value|urlescape}' diff -r 85fb416f2fa7 -r 1cac419ab831 mercurial/templates/spartan/shortlog.tmpl --- a/mercurial/templates/spartan/shortlog.tmpl Tue Jun 16 02:07:25 2015 +0800 +++ b/mercurial/templates/spartan/shortlog.tmpl Tue Jun 16 11:52:10 2015 +0800 @@ -8,11 +8,11 @@
-changelog +changelog graph tags branches -files +files {archives%archiveentry} help rss diff -r 85fb416f2fa7 -r 1cac419ab831 tests/test-hgweb-descend-empties.t --- a/tests/test-hgweb-descend-empties.t Tue Jun 16 02:07:25 2015 +0800 +++ b/tests/test-hgweb-descend-empties.t Tue Jun 16 11:52:10 2015 +0800 @@ -500,12 +500,12 @@ @@ -517,7 +517,7 @@ drwxr-xr-x      - [up] + [up] @@ -525,8 +525,8 @@     - a1/ - + a1/ + a2/a3/a4 @@ -534,8 +534,8 @@     - b1/ - + b1/ + b2/b3 @@ -543,8 +543,8 @@     - d1/ - + d1/ + d2 diff -r 85fb416f2fa7 -r 1cac419ab831 tests/test-hgweb-filelog.t --- a/tests/test-hgweb-filelog.t Tue Jun 16 02:07:25 2015 +0800 +++ b/tests/test-hgweb-filelog.t Tue Jun 16 11:52:10 2015 +0800 @@ -674,8 +674,8 @@ graph tags branches - file - annotate + file + annotate help rss atom diff -r 85fb416f2fa7 -r 1cac419ab831 tests/test-hgweb-symrev.t --- a/tests/test-hgweb-symrev.t Tue Jun 16 02:07:25 2015 +0800 +++ b/tests/test-hgweb-symrev.t Tue Jun 16 11:52:10 2015 +0800 @@ -806,8 +806,8 @@ (De)referencing symbolic revisions (spartan) $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=spartan' | egrep $REVLINKS - changelog - files + changelog + files zip navigate: (0) tip third @@ -816,8 +816,8 @@ navigate: (0) tip $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?style=spartan' | egrep $REVLINKS - shortlog - files + shortlog + files zip navigate: (0) tip 9d8c40cba617 @@ -832,7 +832,7 @@ navigate: (0) tip $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph?style=spartan' | egrep $REVLINKS - files + files navigate: (0) tip navigate: (0) tip @@ -843,15 +843,15 @@ default $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file?style=spartan' | egrep $REVLINKS - changelog - shortlog - changeset - zip + changelog + shortlog + changeset + zip

Mercurial / files for changeset 9d8c40cba617: /

- [up] - dir/ - - foo + [up] + dir/ + + foo $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=spartan&rev=all()' | egrep $REVLINKS zip @@ -870,29 +870,29 @@ dir/bar foo $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'rev/xyzzy?style=spartan' | egrep $REVLINKS - changelog - shortlog - files - raw - zip + changelog + shortlog + files + raw + zip a7c1559b7bba 43c799df6e75 9d8c40cba617 foo $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog/xyzzy?style=spartan' | egrep $REVLINKS - changelog - files - zip + changelog + files + zip navigate: (0) tip second first navigate: (0) tip $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy?style=spartan' | egrep $REVLINKS - shortlog - files - zip + shortlog + files + zip navigate: (0) tip a7c1559b7bba files: @@ -903,29 +903,29 @@ navigate: (0) tip $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph/xyzzy?style=spartan' | egrep $REVLINKS - files + files navigate: (0) tip navigate: (0) tip $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy?style=spartan' | egrep $REVLINKS - changelog - shortlog - changeset - zip + changelog + shortlog + changeset + zip

Mercurial / files for changeset a7c1559b7bba: /

- [up] - dir/ - - foo + [up] + dir/ + + foo $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy/foo?style=spartan' | egrep $REVLINKS - changelog - shortlog - changeset - files - revisions - annotate - raw + changelog + shortlog + changeset + files + revisions + annotate + raw a7c1559b7bba 9d8c40cba617 @@ -933,8 +933,8 @@ $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy/foo?style=spartan' | egrep $REVLINKS href="/atom-log/tip/foo" title="Atom feed for test:foo"> href="/rss-log/tip/foo" title="RSS feed for test:foo"> - file - annotate + file + annotate rss atom

navigate: (0) tip

@@ -948,13 +948,13 @@ (annotate) $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'annotate/xyzzy/foo?style=spartan' | egrep $REVLINKS - changelog - shortlog - changeset - files - file - revisions - raw + changelog + shortlog + changeset + files + file + revisions + raw a7c1559b7bba 9d8c40cba617 @@ -962,13 +962,13 @@ changelog - shortlog - changeset - file - revisions - annotate - raw + changelog + shortlog + changeset + file + revisions + annotate + raw a7c1559b7bba 43c799df6e75 9d8c40cba617