##// END OF EJS Templates
hgweb: add tags links and manifest links...
mpm@selenic.com -
r168:65cf1b0c default
parent child Browse files
Show More
@@ -240,7 +240,9 b' class hgweb:'
240
240
241 yield l
241 yield l
242
242
243 count = self.repo.changelog.count()
243 cl = self.repo.changelog
244 mf = cl.read(cl.tip())[0]
245 count = cl.count()
244 pos = pos or count - 1
246 pos = pos or count - 1
245 end = min(pos, count - 1)
247 end = min(pos, count - 1)
246 start = max(0, pos - self.maxchanges)
248 start = max(0, pos - self.maxchanges)
@@ -251,6 +253,7 b' class hgweb:'
251 footer = self.footer(),
253 footer = self.footer(),
252 repo = self.reponame,
254 repo = self.reponame,
253 changenav = changenav,
255 changenav = changenav,
256 manifest = hex(mf),
254 rev = pos, changesets = count, entries = changelist)
257 rev = pos, changesets = count, entries = changelist)
255
258
256 def changeset(self, nodeid):
259 def changeset(self, nodeid):
@@ -492,6 +495,30 b' class hgweb:'
492 up = up(path),
495 up = up(path),
493 entries = filelist)
496 entries = filelist)
494
497
498 def tags(self):
499 cl = self.repo.changelog
500 mf = cl.read(cl.tip())[0]
501
502 self.repo.lookup(0) # prime the cache
503 i = self.repo.tags.items()
504 i.sort()
505
506 def entries():
507 parity = 0
508 for k,n in i:
509 yield self.t("tagentry",
510 parity = parity,
511 tag = k,
512 node = hex(n))
513 parity = 1 - parity
514
515 yield self.t("tags",
516 header = self.header(),
517 footer = self.footer(),
518 repo = self.reponame,
519 manifest = hex(mf),
520 entries = entries)
521
495 def filediff(self, file, changeset):
522 def filediff(self, file, changeset):
496 n = bin(changeset)
523 n = bin(changeset)
497 cl = self.repo.changelog
524 cl = self.repo.changelog
@@ -538,6 +565,9 b' class hgweb:'
538 elif args['cmd'][0] == 'manifest':
565 elif args['cmd'][0] == 'manifest':
539 write(self.manifest(args['manifest'][0], args['path'][0]))
566 write(self.manifest(args['manifest'][0], args['path'][0]))
540
567
568 elif args['cmd'][0] == 'tags':
569 write(self.tags())
570
541 elif args['cmd'][0] == 'filediff':
571 elif args['cmd'][0] == 'filediff':
542 write(self.filediff(args['file'][0], args['node'][0]))
572 write(self.filediff(args['file'][0], args['node'][0]))
543
573
@@ -2,6 +2,12 b''
2 <title>#repo#: changelog</title>
2 <title>#repo#: changelog</title>
3 </head>
3 </head>
4 <body>
4 <body>
5
6 <div class="buttons">
7 <a href="?cmd=tags">tags</a>
8 <a href="?cmd=manifest;manifest=#manifest#;path=/">manifest</a>
9 </div>
10
5 <h2>changelog for #repo#</h2>
11 <h2>changelog for #repo#</h2>
6
12
7 <form>
13 <form>
@@ -5,6 +5,7 b''
5
5
6 <div class="buttons">
6 <div class="buttons">
7 <a href="?cmd=changelog;rev=#rev#">changelog</a>
7 <a href="?cmd=changelog;rev=#rev#">changelog</a>
8 <a href="?cmd=tags">tags</a>
8 <a href="?cmd=manifest;manifest=#manifest#;path=/">manifest</a>
9 <a href="?cmd=manifest;manifest=#manifest#;path=/">manifest</a>
9 </div>
10 </div>
10
11
@@ -5,6 +5,7 b''
5
5
6 <div class="buttons">
6 <div class="buttons">
7 <a href="?cmd=changelog;rev=#rev#">changelog</a>
7 <a href="?cmd=changelog;rev=#rev#">changelog</a>
8 <a href="?cmd=tags">tags</a>
8 <a href="?cmd=changeset;node=#node#">changeset</a>
9 <a href="?cmd=changeset;node=#node#">changeset</a>
9 <a href="?cmd=manifest;manifest=#manifest#;path=#path#">manifest</a>
10 <a href="?cmd=manifest;manifest=#manifest#;path=#path#">manifest</a>
10 <a href="?cmd=file;file=#file#;filenode=#filenode#">file</a>
11 <a href="?cmd=file;file=#file#;filenode=#filenode#">file</a>
@@ -5,6 +5,7 b''
5
5
6 <div class="buttons">
6 <div class="buttons">
7 <a href="?cmd=changelog;rev=#rev#">changelog</a>
7 <a href="?cmd=changelog;rev=#rev#">changelog</a>
8 <a href="?cmd=tags">tags</a>
8 <a href="?cmd=changeset;node=#node#">changeset</a>
9 <a href="?cmd=changeset;node=#node#">changeset</a>
9 <a href="?cmd=file;file=#file#;filenode=#filenode#">file</a>
10 <a href="?cmd=file;file=#file#;filenode=#filenode#">file</a>
10 <a href="?cmd=filelog;file=#file#;filenode=#filenode#">revisions</a>
11 <a href="?cmd=filelog;file=#file#;filenode=#filenode#">revisions</a>
@@ -5,6 +5,7 b''
5
5
6 <div class="buttons">
6 <div class="buttons">
7 <a href="?cmd=changelog">changelog</a>
7 <a href="?cmd=changelog">changelog</a>
8 <a href="?cmd=tags">tags</a>
8 <a href="?cmd=file;file=#file#;filenode=#filenode#">file</a>
9 <a href="?cmd=file;file=#file#;filenode=#filenode#">file</a>
9 <a href="?cmd=annotate;file=#file#;filenode=#filenode#">annotate</a>
10 <a href="?cmd=annotate;file=#file#;filenode=#filenode#">annotate</a>
10 </div>
11 </div>
@@ -5,6 +5,7 b''
5
5
6 <div class="buttons">
6 <div class="buttons">
7 <a href="?cmd=changelog;rev=#rev#">changelog</a>
7 <a href="?cmd=changelog;rev=#rev#">changelog</a>
8 <a href="?cmd=tags">tags</a>
8 <a href="?cmd=changeset;node=#node#">changeset</a>
9 <a href="?cmd=changeset;node=#node#">changeset</a>
9 <a href="?cmd=manifest;manifest=#manifest#;path=#path#">manifest</a>
10 <a href="?cmd=manifest;manifest=#manifest#;path=#path#">manifest</a>
10 <a href="?cmd=filelog;file=#file#;filenode=#filenode#">revisions</a>
11 <a href="?cmd=filelog;file=#file#;filenode=#filenode#">revisions</a>
@@ -6,7 +6,7 b' Content-type: text/html'
6 <style type="text/css">
6 <style type="text/css">
7 a { text-decoration:none; }
7 a { text-decoration:none; }
8 .parity0 { background-color: #eeeeee; }
8 .parity0 { background-color: #eeeeee; }
9 .parity1 { background-color: #ffffff; }
9 .parity1 { background-color: #f8f8f8; }
10 .lineno { width: 60px; color: #cccccc; font-size: smaller; }
10 .lineno { width: 60px; color: #cccccc; font-size: smaller; }
11 .plusline { color: green; }
11 .plusline { color: green; }
12 .minusline { color: red; }
12 .minusline { color: red; }
@@ -5,6 +5,7 b''
5
5
6 <div class="buttons">
6 <div class="buttons">
7 <a href="?cmd=changelog;rev=#rev#">changelog</a>
7 <a href="?cmd=changelog;rev=#rev#">changelog</a>
8 <a href="?cmd=tags">tags</a>
8 <a href="?cmd=changeset;node=#node#">changeset</a>
9 <a href="?cmd=changeset;node=#node#">changeset</a>
9 </div>
10 </div>
10
11
@@ -25,3 +25,5 b' changelogparent = "<tr><td align="right"'
25 changesetparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=changeset;node=#node#">#node#</a></td></tr>"
25 changesetparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=changeset;node=#node#">#node#</a></td></tr>"
26 filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=file;file=#file#;filenode=#node#">#node#</a></td></tr>"
26 filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=file;file=#file#;filenode=#node#">#node#</a></td></tr>"
27 fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=annotate;file=#file#;filenode=#node#">#node#</a></td></tr>"
27 fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=annotate;file=#file#;filenode=#node#">#node#</a></td></tr>"
28 tags = tags.tmpl
29 tagentry = "<div class="parity#parity#"><tt>#node#</tt> <a href="?cmd=changeset;node=#node#">#tag#</a><br /></div>"
General Comments 0
You need to be logged in to leave comments. Login now