# HG changeset patch # User Anton Shestakov # Date 2015-06-16 03:52:10 # 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 --git a/mercurial/templates/spartan/changelog.tmpl b/mercurial/templates/spartan/changelog.tmpl --- a/mercurial/templates/spartan/changelog.tmpl +++ b/mercurial/templates/spartan/changelog.tmpl @@ -8,11 +8,11 @@
-shortlog +shortlog graph tags branches -files +files {archives%archiveentry} help rss diff --git a/mercurial/templates/spartan/changeset.tmpl b/mercurial/templates/spartan/changeset.tmpl --- a/mercurial/templates/spartan/changeset.tmpl +++ b/mercurial/templates/spartan/changeset.tmpl @@ -4,13 +4,13 @@ diff --git a/mercurial/templates/spartan/fileannotate.tmpl b/mercurial/templates/spartan/fileannotate.tmpl --- a/mercurial/templates/spartan/fileannotate.tmpl +++ b/mercurial/templates/spartan/fileannotate.tmpl @@ -4,16 +4,16 @@ diff --git a/mercurial/templates/spartan/filediff.tmpl b/mercurial/templates/spartan/filediff.tmpl --- a/mercurial/templates/spartan/filediff.tmpl +++ b/mercurial/templates/spartan/filediff.tmpl @@ -4,16 +4,16 @@ diff --git a/mercurial/templates/spartan/filelog.tmpl b/mercurial/templates/spartan/filelog.tmpl --- a/mercurial/templates/spartan/filelog.tmpl +++ b/mercurial/templates/spartan/filelog.tmpl @@ -13,8 +13,8 @@ graph tags branches -file -annotate +file +annotate help rss atom diff --git a/mercurial/templates/spartan/filerevision.tmpl b/mercurial/templates/spartan/filerevision.tmpl --- a/mercurial/templates/spartan/filerevision.tmpl +++ b/mercurial/templates/spartan/filerevision.tmpl @@ -4,16 +4,16 @@ diff --git a/mercurial/templates/spartan/graph.tmpl b/mercurial/templates/spartan/graph.tmpl --- a/mercurial/templates/spartan/graph.tmpl +++ b/mercurial/templates/spartan/graph.tmpl @@ -13,7 +13,7 @@ shortlog tags branches -files +files help
diff --git a/mercurial/templates/spartan/manifest.tmpl b/mercurial/templates/spartan/manifest.tmpl --- a/mercurial/templates/spartan/manifest.tmpl +++ b/mercurial/templates/spartan/manifest.tmpl @@ -4,12 +4,12 @@ @@ -21,7 +21,7 @@ drwxr-xr-x      - [up] + [up] {dentries%direntry} {fentries%fileentry} diff --git a/mercurial/templates/spartan/map b/mercurial/templates/spartan/map --- a/mercurial/templates/spartan/map +++ b/mercurial/templates/spartan/map @@ -31,8 +31,8 @@ direntry = '     - {basename|escape}/ - + {basename|escape}/ + {emptydirs|urlescape} ' @@ -41,7 +41,7 @@ fileentry = ' {permissions|permissions}  {date|isodate}  {size}  - {basename|escape}' + {basename|escape}' filerevision = filerevision.tmpl fileannotate = fileannotate.tmpl @@ -183,7 +183,7 @@ indexentry = ' ' index = index.tmpl -archiveentry = '{type|escape} ' +archiveentry = '{type|escape} ' notfound = notfound.tmpl error = error.tmpl urlparameter = '{separator}{name}={value|urlescape}' diff --git a/mercurial/templates/spartan/shortlog.tmpl b/mercurial/templates/spartan/shortlog.tmpl --- a/mercurial/templates/spartan/shortlog.tmpl +++ b/mercurial/templates/spartan/shortlog.tmpl @@ -8,11 +8,11 @@
-changelog +changelog graph tags branches -files +files {archives%archiveentry} help rss diff --git a/tests/test-hgweb-descend-empties.t b/tests/test-hgweb-descend-empties.t --- a/tests/test-hgweb-descend-empties.t +++ b/tests/test-hgweb-descend-empties.t @@ -500,12 +500,12 @@ manifest with descending (spartan) @@ -517,7 +517,7 @@ manifest with descending (spartan) drwxr-xr-x      - [up] + [up] @@ -525,8 +525,8 @@ manifest with descending (spartan)     - a1/ - + a1/ + a2/a3/a4 @@ -534,8 +534,8 @@ manifest with descending (spartan)     - b1/ - + b1/ + b2/b3 @@ -543,8 +543,8 @@ manifest with descending (spartan)     - d1/ - + d1/ + d2 diff --git a/tests/test-hgweb-filelog.t b/tests/test-hgweb-filelog.t --- a/tests/test-hgweb-filelog.t +++ b/tests/test-hgweb-filelog.t @@ -674,8 +674,8 @@ should show base link, use spartan becau graph tags branches - file - annotate + file + annotate help rss atom diff --git a/tests/test-hgweb-symrev.t b/tests/test-hgweb-symrev.t --- a/tests/test-hgweb-symrev.t +++ b/tests/test-hgweb-symrev.t @@ -806,8 +806,8 @@ Set up the repo (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 @@ Set up the repo 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 @@ Set up the repo 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 @@ Set up the repo 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 @@ Set up the repo 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 @@ Set up the repo 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 @@ Set up the repo $ "$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 @@ Set up the repo (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 @@ Set up the repo changelog - shortlog - changeset - file - revisions - annotate - raw + changelog + shortlog + changeset + file + revisions + annotate + raw a7c1559b7bba 43c799df6e75 9d8c40cba617