# HG changeset patch # User mpm@selenic.com # Date 1117139041 28800 # Node ID 65cf1b0cfe867709c99d84503d79d1d7124b9f4a # Parent fad9ad1ec7c734b952d795efa68386aba3e17d2c hgweb: add tags links and manifest links This adds a simple new tags page to browse by tag, adds the tag link everywhere, and adds manifest links to the tags and changelog pages. diff -r fad9ad1ec7c7 -r 65cf1b0cfe86 mercurial/hgweb.py --- a/mercurial/hgweb.py Thu May 26 11:15:05 2005 -0800 +++ b/mercurial/hgweb.py Thu May 26 12:24:01 2005 -0800 @@ -240,7 +240,9 @@ yield l - count = self.repo.changelog.count() + cl = self.repo.changelog + mf = cl.read(cl.tip())[0] + count = cl.count() pos = pos or count - 1 end = min(pos, count - 1) start = max(0, pos - self.maxchanges) @@ -251,6 +253,7 @@ footer = self.footer(), repo = self.reponame, changenav = changenav, + manifest = hex(mf), rev = pos, changesets = count, entries = changelist) def changeset(self, nodeid): @@ -492,6 +495,30 @@ up = up(path), entries = filelist) + def tags(self): + cl = self.repo.changelog + mf = cl.read(cl.tip())[0] + + self.repo.lookup(0) # prime the cache + i = self.repo.tags.items() + i.sort() + + def entries(): + parity = 0 + for k,n in i: + yield self.t("tagentry", + parity = parity, + tag = k, + node = hex(n)) + parity = 1 - parity + + yield self.t("tags", + header = self.header(), + footer = self.footer(), + repo = self.reponame, + manifest = hex(mf), + entries = entries) + def filediff(self, file, changeset): n = bin(changeset) cl = self.repo.changelog @@ -538,6 +565,9 @@ elif args['cmd'][0] == 'manifest': write(self.manifest(args['manifest'][0], args['path'][0])) + elif args['cmd'][0] == 'tags': + write(self.tags()) + elif args['cmd'][0] == 'filediff': write(self.filediff(args['file'][0], args['node'][0])) diff -r fad9ad1ec7c7 -r 65cf1b0cfe86 templates/changelog.tmpl --- a/templates/changelog.tmpl Thu May 26 11:15:05 2005 -0800 +++ b/templates/changelog.tmpl Thu May 26 12:24:01 2005 -0800 @@ -2,6 +2,12 @@ #repo#: changelog + +
+tags +manifest +
+

changelog for #repo#

diff -r fad9ad1ec7c7 -r 65cf1b0cfe86 templates/changeset.tmpl --- a/templates/changeset.tmpl Thu May 26 11:15:05 2005 -0800 +++ b/templates/changeset.tmpl Thu May 26 12:24:01 2005 -0800 @@ -5,6 +5,7 @@
changelog +tags manifest
diff -r fad9ad1ec7c7 -r 65cf1b0cfe86 templates/fileannotate.tmpl --- a/templates/fileannotate.tmpl Thu May 26 11:15:05 2005 -0800 +++ b/templates/fileannotate.tmpl Thu May 26 12:24:01 2005 -0800 @@ -5,6 +5,7 @@
changelog +tags changeset manifest file diff -r fad9ad1ec7c7 -r 65cf1b0cfe86 templates/filediff.tmpl --- a/templates/filediff.tmpl Thu May 26 11:15:05 2005 -0800 +++ b/templates/filediff.tmpl Thu May 26 12:24:01 2005 -0800 @@ -5,6 +5,7 @@
changelog +tags changeset file revisions diff -r fad9ad1ec7c7 -r 65cf1b0cfe86 templates/filelog.tmpl --- a/templates/filelog.tmpl Thu May 26 11:15:05 2005 -0800 +++ b/templates/filelog.tmpl Thu May 26 12:24:01 2005 -0800 @@ -5,6 +5,7 @@ diff -r fad9ad1ec7c7 -r 65cf1b0cfe86 templates/filerevision.tmpl --- a/templates/filerevision.tmpl Thu May 26 11:15:05 2005 -0800 +++ b/templates/filerevision.tmpl Thu May 26 12:24:01 2005 -0800 @@ -5,6 +5,7 @@
changelog +tags changeset manifest revisions diff -r fad9ad1ec7c7 -r 65cf1b0cfe86 templates/header.tmpl --- a/templates/header.tmpl Thu May 26 11:15:05 2005 -0800 +++ b/templates/header.tmpl Thu May 26 12:24:01 2005 -0800 @@ -6,7 +6,7 @@