##// END OF EJS Templates
- duplicate the parent link logic to show child links...
Muli Ben-Yehuda -
r1606:ba625c80 default
parent child Browse files
Show More
@@ -212,14 +212,14 b' class hgweb(object):'
212 if len(files) > self.maxfiles:
212 if len(files) > self.maxfiles:
213 yield self.t("fileellipses")
213 yield self.t("fileellipses")
214
214
215 def parents(self, node, parents=[], rev=None, hide=False, **args):
215 def siblings(self, siblings=[], rev=None, hiderev=None, **args):
216 if not rev:
216 if not rev:
217 rev = lambda x: ""
217 rev = lambda x: ""
218 parents = [p for p in parents if p != nullid]
218 siblings = [s for s in siblings if s != nullid]
219 if hide and len(parents) == 1 and rev(parents[0]) == rev(node) - 1:
219 if len(siblings) == 1 and rev(siblings[0]) == hiderev:
220 return
220 return
221 for p in parents:
221 for s in siblings:
222 yield dict(node=hex(p), rev=rev(p), **args)
222 yield dict(node=hex(s), rev=rev(s), **args)
223
223
224 def showtag(self, t1, node=nullid, **args):
224 def showtag(self, t1, node=nullid, **args):
225 for t in self.repo.nodetags(node):
225 for t in self.repo.nodetags(node):
@@ -321,8 +321,10 b' class hgweb(object):'
321
321
322 l.insert(0, {"parity": parity,
322 l.insert(0, {"parity": parity,
323 "author": changes[1],
323 "author": changes[1],
324 "parent": self.parents(n, cl.parents(n), cl.rev,
324 "parent": self.siblings(cl.parents(n), cl.rev,
325 hide=True),
325 cl.rev(n) - 1),
326 "child": self.siblings(cl.children(n), cl.rev,
327 cl.rev(n) + 1),
326 "changelogtag": self.showtag("changelogtag",n),
328 "changelogtag": self.showtag("changelogtag",n),
327 "manifest": hex(changes[0]),
329 "manifest": hex(changes[0]),
328 "desc": changes[4],
330 "desc": changes[4],
@@ -382,7 +384,8 b' class hgweb(object):'
382 yield self.t('searchentry',
384 yield self.t('searchentry',
383 parity=count & 1,
385 parity=count & 1,
384 author=changes[1],
386 author=changes[1],
385 parent=self.parents(n, cl.parents(n), cl.rev),
387 parent=self.siblings(cl.parents(n), cl.rev),
388 child=self.siblings(cl.children(n), cl.rev),
386 changelogtag=self.showtag("changelogtag",n),
389 changelogtag=self.showtag("changelogtag",n),
387 manifest=hex(changes[0]),
390 manifest=hex(changes[0]),
388 desc=changes[4],
391 desc=changes[4],
@@ -422,7 +425,8 b' class hgweb(object):'
422 diff=diff,
425 diff=diff,
423 rev=cl.rev(n),
426 rev=cl.rev(n),
424 node=nodeid,
427 node=nodeid,
425 parent=self.parents(n, cl.parents(n), cl.rev),
428 parent=self.siblings(cl.parents(n), cl.rev),
429 child=self.siblings(cl.children(n), cl.rev),
426 changesettag=self.showtag("changesettag",n),
430 changesettag=self.showtag("changesettag",n),
427 manifest=hex(changes[0]),
431 manifest=hex(changes[0]),
428 author=changes[1],
432 author=changes[1],
@@ -454,7 +458,9 b' class hgweb(object):'
454 "node": hex(cn),
458 "node": hex(cn),
455 "author": cs[1],
459 "author": cs[1],
456 "date": cs[2],
460 "date": cs[2],
457 "parent": self.parents(n, fl.parents(n),
461 "parent": self.siblings(fl.parents(n),
462 fl.rev, file=f),
463 "child": self.siblings(fl.children(n),
458 fl.rev, file=f),
464 fl.rev, file=f),
459 "desc": cs[4]})
465 "desc": cs[4]})
460 parity = 1 - parity
466 parity = 1 - parity
@@ -498,7 +504,8 b' class hgweb(object):'
498 manifest=hex(mfn),
504 manifest=hex(mfn),
499 author=cs[1],
505 author=cs[1],
500 date=cs[2],
506 date=cs[2],
501 parent=self.parents(n, fl.parents(n), fl.rev, file=f),
507 parent=self.siblings(fl.parents(n), fl.rev, file=f),
508 child=self.siblings(fl.children(n), fl.rev, file=f),
502 permissions=self.repo.manifest.readflags(mfn)[f])
509 permissions=self.repo.manifest.readflags(mfn)[f])
503
510
504 def fileannotate(self, f, node):
511 def fileannotate(self, f, node):
@@ -550,7 +557,8 b' class hgweb(object):'
550 manifest=hex(mfn),
557 manifest=hex(mfn),
551 author=cs[1],
558 author=cs[1],
552 date=cs[2],
559 date=cs[2],
553 parent=self.parents(n, fl.parents(n), fl.rev, file=f),
560 parent=self.siblings(fl.parents(n), fl.rev, file=f),
561 child=self.siblings(fl.children(n), fl.rev, file=f),
554 permissions=self.repo.manifest.readflags(mfn)[f])
562 permissions=self.repo.manifest.readflags(mfn)[f])
555
563
556 def manifest(self, mnode, path):
564 def manifest(self, mnode, path):
@@ -727,7 +735,8 b' class hgweb(object):'
727 filenode=hex(mf.get(file, nullid)),
735 filenode=hex(mf.get(file, nullid)),
728 node=changeset,
736 node=changeset,
729 rev=self.repo.changelog.rev(n),
737 rev=self.repo.changelog.rev(n),
730 parent=self.parents(n, cl.parents(n), cl.rev),
738 parent=self.siblings(cl.parents(n), cl.rev),
739 child=self.siblings(cl.children(n), cl.rev),
731 diff=diff)
740 diff=diff)
732
741
733 def archive(self, req, cnode, type):
742 def archive(self, req, cnode, type):
@@ -8,6 +8,7 b''
8 <td class="changesetNode"><a href="?cs=#node|short#">#node|short#</a></td>
8 <td class="changesetNode"><a href="?cs=#node|short#">#node|short#</a></td>
9 </tr>
9 </tr>
10 #parent%changelogparent#
10 #parent%changelogparent#
11 #child%changelogchild#
11 #changelogtag#
12 #changelogtag#
12 <tr>
13 <tr>
13 <th class="author">author:</th>
14 <th class="author">author:</th>
@@ -23,6 +23,7 b''
23 <tr><td>changeset</td><td style="font-family:monospace">#node|short#</td></tr>
23 <tr><td>changeset</td><td style="font-family:monospace">#node|short#</td></tr>
24 <tr><td>manifest</td><td style="font-family:monospace"><a class="list" href="?cmd=manifest;manifest=#manifest|short#;path=/;style=gitweb">#manifest|short#</a></td></tr>
24 <tr><td>manifest</td><td style="font-family:monospace"><a class="list" href="?cmd=manifest;manifest=#manifest|short#;path=/;style=gitweb">#manifest|short#</a></td></tr>
25 #parent%changesetparent#
25 #parent%changesetparent#
26 #child%changesetchild#
26 #changesettag#
27 #changesettag#
27 </table></div>
28 </table></div>
28
29
@@ -19,6 +19,7 b''
19 <td class="changeset"><a href="?cs=#node|short#">#node|short#</a></td>
19 <td class="changeset"><a href="?cs=#node|short#">#node|short#</a></td>
20 </tr>
20 </tr>
21 #parent%changesetparent#
21 #parent%changesetparent#
22 #child%changesetchild#
22 #changesettag#
23 #changesettag#
23 <tr>
24 <tr>
24 <th class="author">author:</th>
25 <th class="author">author:</th>
@@ -20,6 +20,7 b''
20 <td class="metatag">changeset #rev#:</td>
20 <td class="metatag">changeset #rev#:</td>
21 <td><a href="?cs=#node|short#;style=gitweb">#node|short#</a></td></tr>
21 <td><a href="?cs=#node|short#;style=gitweb">#node|short#</a></td></tr>
22 #parent%fileannotateparent#
22 #parent%fileannotateparent#
23 #child%fileannotatechild#
23 <tr>
24 <tr>
24 <td class="metatag">manifest:</td>
25 <td class="metatag">manifest:</td>
25 <td><a href="?mf=#manifest|short#;path=/;style=gitweb">#manifest|short#</a></td></tr>
26 <td><a href="?mf=#manifest|short#;path=/;style=gitweb">#manifest|short#</a></td></tr>
@@ -19,6 +19,7 b''
19 <td class="metatag">changeset #rev#:</td>
19 <td class="metatag">changeset #rev#:</td>
20 <td><a href="?cs=#node|short#">#node|short#</a></td></tr>
20 <td><a href="?cs=#node|short#">#node|short#</a></td></tr>
21 #parent%fileannotateparent#
21 #parent%fileannotateparent#
22 #child%fileannotatechild#
22 <tr>
23 <tr>
23 <td class="metatag">author:</td>
24 <td class="metatag">author:</td>
24 <td>#author|obfuscate#</td></tr>
25 <td>#author|obfuscate#</td></tr>
@@ -21,6 +21,7 b''
21 <td class="revision"><a href="?cs=#node|short#">#node|short#</a></td>
21 <td class="revision"><a href="?cs=#node|short#">#node|short#</a></td>
22 </tr>
22 </tr>
23 #parent%filediffparent#
23 #parent%filediffparent#
24 #child%filediffchild#
24 </table>
25 </table>
25
26
26 <div id="fileDiff">
27 <div id="fileDiff">
@@ -20,6 +20,7 b''
20 <td class="metatag">changeset #rev#:</td>
20 <td class="metatag">changeset #rev#:</td>
21 <td><a href="?cs=#node|short#;style=gitweb">#node|short#</a></td></tr>
21 <td><a href="?cs=#node|short#;style=gitweb">#node|short#</a></td></tr>
22 #parent%fileannotateparent#
22 #parent%fileannotateparent#
23 #child%fileannotatechild#
23 <tr>
24 <tr>
24 <td class="metatag">manifest:</td>
25 <td class="metatag">manifest:</td>
25 <td><a href="?mf=#manifest|short#;path=/;style=gitweb">#manifest|short#</a></td></tr>
26 <td><a href="?mf=#manifest|short#;path=/;style=gitweb">#manifest|short#</a></td></tr>
@@ -20,6 +20,7 b''
20 <td class="metatag">changeset #rev#:</td>
20 <td class="metatag">changeset #rev#:</td>
21 <td><a href="?cs=#node|short#">#node|short#</a></td></tr>
21 <td><a href="?cs=#node|short#">#node|short#</a></td></tr>
22 #parent%filerevparent#
22 #parent%filerevparent#
23 #child%filerevchild#
23 <tr>
24 <tr>
24 <td class="metatag">author:</td>
25 <td class="metatag">author:</td>
25 <td>#author|obfuscate#</td></tr>
26 <td>#author|obfuscate#</td></tr>
@@ -28,6 +28,10 b' changelogparent = "<tr><th class="parent'
28 changesetparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
28 changesetparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
29 filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?f=#node|short#;file=#file#">#node|short#</a></td></tr>"
29 filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?f=#node|short#;file=#file#">#node|short#</a></td></tr>"
30 fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?fa=#filenode|short#;file=#file#">#node|short#</a></td></tr>"
30 fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?fa=#filenode|short#;file=#file#">#node|short#</a></td></tr>"
31 changesetchild = "<tr><th class="child">child #rev#:</th><td class="child"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
32 changelogchild = "<tr><th class="child">child #rev#:</th><td class="child"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
33 filerevchild = "<tr><td class="metatag">child:</td><td><a href="?f=#node|short#;file=#file#">#node|short#</a></td></tr>"
34 fileannotatechild = "<tr><td class="metatag">child:</td><td><a href="?fa=#filenode|short#;file=#file#">#node|short#</a></td></tr>"
31 tags = tags.tmpl
35 tags = tags.tmpl
32 tagentry = "<li class="tagEntry parity#parity#"><span class="node">#node#</span> <a href="?cs=#node|short#">#tag#</a></li>"
36 tagentry = "<li class="tagEntry parity#parity#"><span class="node">#node#</span> <a href="?cs=#node|short#">#tag#</a></li>"
33 diffblock = "<pre class="parity#parity#">#lines#</pre>"
37 diffblock = "<pre class="parity#parity#">#lines#</pre>"
@@ -35,6 +39,8 b' changelogtag = "<tr><th class="tag">tag:'
35 changesettag = "<tr><th class="tag">tag:</th><td class="tag">#tag#</td></tr>"
39 changesettag = "<tr><th class="tag">tag:</th><td class="tag">#tag#</td></tr>"
36 filediffparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
40 filediffparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
37 filelogparent = "<tr><td align="right">parent #rev#:&nbsp;</td><td><a href="?f=#node|short#;file=#file#">#node|short#</a></td></tr>"
41 filelogparent = "<tr><td align="right">parent #rev#:&nbsp;</td><td><a href="?f=#node|short#;file=#file#">#node|short#</a></td></tr>"
42 filediffchild = "<tr><th class="child">child #rev#:</th><td class="child"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
43 filelogchild = "<tr><td align="right">child #rev#:&nbsp;</td><td><a href="?f=#node|short#;file=#file#">#node|short#</a></td></tr>"
38 indexentry = "<tr class="parity#parity#"><td><a href="#url#">#name#</a></td><td>#shortdesc#</td><td>#contact|obfuscate#</td><td>#lastupdate|age# ago</td><td><a href="#url#?cl=tip;style=rss">RSS</a></td></tr>"
44 indexentry = "<tr class="parity#parity#"><td><a href="#url#">#name#</a></td><td>#shortdesc#</td><td>#contact|obfuscate#</td><td>#lastupdate|age# ago</td><td><a href="#url#?cl=tip;style=rss">RSS</a></td></tr>"
39 index = index.tmpl
45 index = index.tmpl
40 archiveentry = "<a href="?ca=#node|short#;type=#type#">#type#</a> "
46 archiveentry = "<a href="?ca=#node|short#;type=#type#">#type#</a> "
@@ -30,6 +30,10 b' changelogparent = "<tr><th class="parent'
30 changesetparent = "<tr><td>parent</td><td style="font-family:monospace"><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb">#node|short#</a></td></tr>"
30 changesetparent = "<tr><td>parent</td><td style="font-family:monospace"><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb">#node|short#</a></td></tr>"
31 filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=file;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
31 filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=file;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
32 fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=annotate;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
32 fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=annotate;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
33 changelogchild = "<tr><th class="child">child #rev#:</th><td class="child"><a href="?cmd=changeset;node=#node#;style=gitweb">#node|short#</a></td></tr>"
34 changesetchild = "<tr><td>child</td><td style="font-family:monospace"><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb">#node|short#</a></td></tr>"
35 filerevchild = "<tr><td class="metatag">child:</td><td><a href="?cmd=file;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
36 fileannotatechild = "<tr><td class="metatag">child:</td><td><a href="?cmd=annotate;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
33 tags = tags-gitweb.tmpl
37 tags = tags-gitweb.tmpl
34 tagentry = "<tr class="parity#parity#"><td><i>#date|age# ago</i></td><td><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb"><b>#tag#</b></a></td><td class="link"><a href="?cmd=changeset;node=#node|short#;style=gitweb">changeset</a> | <a href="?cmd=changelog;rev=#node|short#;style=gitweb">changelog</a> | <a href="?mf=#tagmanifest|short#;path=/;style=gitweb">manifest</a></td></tr>"
38 tagentry = "<tr class="parity#parity#"><td><i>#date|age# ago</i></td><td><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb"><b>#tag#</b></a></td><td class="link"><a href="?cmd=changeset;node=#node|short#;style=gitweb">changeset</a> | <a href="?cmd=changelog;rev=#node|short#;style=gitweb">changelog</a> | <a href="?mf=#tagmanifest|short#;path=/;style=gitweb">manifest</a></td></tr>"
35 diffblock = "#lines#"
39 diffblock = "#lines#"
@@ -37,6 +41,8 b' changelogtag = "<tr><th class="tag">tag:'
37 changesettag = "<tr><td>tag</td><td>#tag#</td></tr>"
41 changesettag = "<tr><td>tag</td><td>#tag#</td></tr>"
38 filediffparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cmd=changeset;node=#node#;style=gitweb">#node|short#</a></td></tr>"
42 filediffparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cmd=changeset;node=#node#;style=gitweb">#node|short#</a></td></tr>"
39 filelogparent = "<tr><td align="right">parent #rev#:&nbsp;</td><td><a href="?cmd=file;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
43 filelogparent = "<tr><td align="right">parent #rev#:&nbsp;</td><td><a href="?cmd=file;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
44 filediffchild = "<tr><th class="child">child #rev#:</th><td class="child"><a href="?cmd=changeset;node=#node#;style=gitweb">#node|short#</a></td></tr>"
45 filelogchild = "<tr><td align="right">child #rev#:&nbsp;</td><td><a href="?cmd=file;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
40 shortlog = shortlog-gitweb.tmpl
46 shortlog = shortlog-gitweb.tmpl
41 shortlogentry = "<tr class="parity#parity#"><td><i>#date|age# ago</i></td><td><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb"><b>#desc|firstline|escape#</b></a></td><td class="link"><a href="?cmd=changeset;node=#node|short#;style=gitweb">changeset</a> | <a href="?cmd=manifest;manifest=#manifest|short#;path=/;style=gitweb">manifest</a></td></tr>"
47 shortlogentry = "<tr class="parity#parity#"><td><i>#date|age# ago</i></td><td><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb"><b>#desc|firstline|escape#</b></a></td><td class="link"><a href="?cmd=changeset;node=#node|short#;style=gitweb">changeset</a> | <a href="?cmd=manifest;manifest=#manifest|short#;path=/;style=gitweb">manifest</a></td></tr>"
42 filelogentry = "<tr class="parity#parity#"><td><i>#date|age# ago</i></td><td><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb"><b>#desc|firstline|escape#</b></a></td><td class="link"><!-- FIXME: <a href="?fd=#node|short#;file=#file#;style=gitweb">diff</a> | --> <a href="?fa=#filenode|short#;file=#file#;style=gitweb">annotate</a></td></tr>"
48 filelogentry = "<tr class="parity#parity#"><td><i>#date|age# ago</i></td><td><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb"><b>#desc|firstline|escape#</b></a></td><td class="link"><!-- FIXME: <a href="?fd=#node|short#;file=#file#;style=gitweb">diff</a> | --> <a href="?fa=#filenode|short#;file=#file#;style=gitweb">annotate</a></td></tr>"
@@ -7,6 +7,7 b' difflineminus = "#line#"'
7 difflineat = "#line#"
7 difflineat = "#line#"
8 diffline = "#line#"
8 diffline = "#line#"
9 changesetparent = "# parent: #node#"
9 changesetparent = "# parent: #node#"
10 changesetchild = "# child: #node#"
10 filenodelink = "#file#"
11 filenodelink = "#file#"
11 filerevision = filerevision-raw.tmpl
12 filerevision = filerevision-raw.tmpl
12 fileline = "#line#"
13 fileline = "#line#"
@@ -18,6 +18,7 b' desc a description (escaped, wi'
18 shortdesc a short description (escaped)
18 shortdesc a short description (escaped)
19 author a name or email addressv(obfuscated)
19 author a name or email addressv(obfuscated)
20 parent a list of the parent
20 parent a list of the parent
21 child a list of the children
21 tags a list of tag
22 tags a list of tag
22
23
23 header the global page header
24 header the global page header
General Comments 0
You need to be logged in to leave comments. Login now