# HG changeset patch # User Muli Ben-Yehuda # Date 1135889489 21600 # Node ID ba625c8083d8f17e61e7fac9f4a4025daeda0c06 # Parent 428e0a9c9968e3922f70f3fa50343779cbeb021e - duplicate the parent link logic to show child links - don't show trivial parent or children links diff -r 428e0a9c9968 -r ba625c8083d8 mercurial/hgweb.py --- a/mercurial/hgweb.py Wed Dec 28 07:22:26 2005 -0800 +++ b/mercurial/hgweb.py Thu Dec 29 14:51:29 2005 -0600 @@ -212,14 +212,14 @@ if len(files) > self.maxfiles: yield self.t("fileellipses") - def parents(self, node, parents=[], rev=None, hide=False, **args): + def siblings(self, siblings=[], rev=None, hiderev=None, **args): if not rev: rev = lambda x: "" - parents = [p for p in parents if p != nullid] - if hide and len(parents) == 1 and rev(parents[0]) == rev(node) - 1: + siblings = [s for s in siblings if s != nullid] + if len(siblings) == 1 and rev(siblings[0]) == hiderev: return - for p in parents: - yield dict(node=hex(p), rev=rev(p), **args) + for s in siblings: + yield dict(node=hex(s), rev=rev(s), **args) def showtag(self, t1, node=nullid, **args): for t in self.repo.nodetags(node): @@ -321,8 +321,10 @@ l.insert(0, {"parity": parity, "author": changes[1], - "parent": self.parents(n, cl.parents(n), cl.rev, - hide=True), + "parent": self.siblings(cl.parents(n), cl.rev, + cl.rev(n) - 1), + "child": self.siblings(cl.children(n), cl.rev, + cl.rev(n) + 1), "changelogtag": self.showtag("changelogtag",n), "manifest": hex(changes[0]), "desc": changes[4], @@ -382,7 +384,8 @@ yield self.t('searchentry', parity=count & 1, author=changes[1], - parent=self.parents(n, cl.parents(n), cl.rev), + parent=self.siblings(cl.parents(n), cl.rev), + child=self.siblings(cl.children(n), cl.rev), changelogtag=self.showtag("changelogtag",n), manifest=hex(changes[0]), desc=changes[4], @@ -422,7 +425,8 @@ diff=diff, rev=cl.rev(n), node=nodeid, - parent=self.parents(n, cl.parents(n), cl.rev), + parent=self.siblings(cl.parents(n), cl.rev), + child=self.siblings(cl.children(n), cl.rev), changesettag=self.showtag("changesettag",n), manifest=hex(changes[0]), author=changes[1], @@ -454,7 +458,9 @@ "node": hex(cn), "author": cs[1], "date": cs[2], - "parent": self.parents(n, fl.parents(n), + "parent": self.siblings(fl.parents(n), + fl.rev, file=f), + "child": self.siblings(fl.children(n), fl.rev, file=f), "desc": cs[4]}) parity = 1 - parity @@ -498,7 +504,8 @@ manifest=hex(mfn), author=cs[1], date=cs[2], - parent=self.parents(n, fl.parents(n), fl.rev, file=f), + parent=self.siblings(fl.parents(n), fl.rev, file=f), + child=self.siblings(fl.children(n), fl.rev, file=f), permissions=self.repo.manifest.readflags(mfn)[f]) def fileannotate(self, f, node): @@ -550,7 +557,8 @@ manifest=hex(mfn), author=cs[1], date=cs[2], - parent=self.parents(n, fl.parents(n), fl.rev, file=f), + parent=self.siblings(fl.parents(n), fl.rev, file=f), + child=self.siblings(fl.children(n), fl.rev, file=f), permissions=self.repo.manifest.readflags(mfn)[f]) def manifest(self, mnode, path): @@ -727,7 +735,8 @@ filenode=hex(mf.get(file, nullid)), node=changeset, rev=self.repo.changelog.rev(n), - parent=self.parents(n, cl.parents(n), cl.rev), + parent=self.siblings(cl.parents(n), cl.rev), + child=self.siblings(cl.children(n), cl.rev), diff=diff) def archive(self, req, cnode, type): diff -r 428e0a9c9968 -r ba625c8083d8 templates/changelogentry.tmpl --- a/templates/changelogentry.tmpl Wed Dec 28 07:22:26 2005 -0800 +++ b/templates/changelogentry.tmpl Thu Dec 29 14:51:29 2005 -0600 @@ -8,6 +8,7 @@ #node|short# #parent%changelogparent# + #child%changelogchild# #changelogtag# author: diff -r 428e0a9c9968 -r ba625c8083d8 templates/changeset-gitweb.tmpl --- a/templates/changeset-gitweb.tmpl Wed Dec 28 07:22:26 2005 -0800 +++ b/templates/changeset-gitweb.tmpl Thu Dec 29 14:51:29 2005 -0600 @@ -23,6 +23,7 @@ changeset#node|short# manifest#manifest|short# #parent%changesetparent# +#child%changesetchild# #changesettag# diff -r 428e0a9c9968 -r ba625c8083d8 templates/changeset.tmpl --- a/templates/changeset.tmpl Wed Dec 28 07:22:26 2005 -0800 +++ b/templates/changeset.tmpl Thu Dec 29 14:51:29 2005 -0600 @@ -19,6 +19,7 @@ #node|short# #parent%changesetparent# +#child%changesetchild# #changesettag# author: diff -r 428e0a9c9968 -r ba625c8083d8 templates/fileannotate-gitweb.tmpl --- a/templates/fileannotate-gitweb.tmpl Wed Dec 28 07:22:26 2005 -0800 +++ b/templates/fileannotate-gitweb.tmpl Thu Dec 29 14:51:29 2005 -0600 @@ -20,6 +20,7 @@ changeset #rev#: #node|short# #parent%fileannotateparent# +#child%fileannotatechild# manifest: #manifest|short# diff -r 428e0a9c9968 -r ba625c8083d8 templates/fileannotate.tmpl --- a/templates/fileannotate.tmpl Wed Dec 28 07:22:26 2005 -0800 +++ b/templates/fileannotate.tmpl Thu Dec 29 14:51:29 2005 -0600 @@ -19,6 +19,7 @@ changeset #rev#: #node|short# #parent%fileannotateparent# +#child%fileannotatechild# author: #author|obfuscate# diff -r 428e0a9c9968 -r ba625c8083d8 templates/filediff.tmpl --- a/templates/filediff.tmpl Wed Dec 28 07:22:26 2005 -0800 +++ b/templates/filediff.tmpl Thu Dec 29 14:51:29 2005 -0600 @@ -21,6 +21,7 @@ #node|short# #parent%filediffparent# +#child%filediffchild#
diff -r 428e0a9c9968 -r ba625c8083d8 templates/filerevision-gitweb.tmpl --- a/templates/filerevision-gitweb.tmpl Wed Dec 28 07:22:26 2005 -0800 +++ b/templates/filerevision-gitweb.tmpl Thu Dec 29 14:51:29 2005 -0600 @@ -20,6 +20,7 @@ changeset #rev#: #node|short# #parent%fileannotateparent# +#child%fileannotatechild# manifest: #manifest|short# diff -r 428e0a9c9968 -r ba625c8083d8 templates/filerevision.tmpl --- a/templates/filerevision.tmpl Wed Dec 28 07:22:26 2005 -0800 +++ b/templates/filerevision.tmpl Thu Dec 29 14:51:29 2005 -0600 @@ -20,6 +20,7 @@ changeset #rev#: #node|short# #parent%filerevparent# +#child%filerevchild# author: #author|obfuscate# diff -r 428e0a9c9968 -r ba625c8083d8 templates/map --- a/templates/map Wed Dec 28 07:22:26 2005 -0800 +++ b/templates/map Thu Dec 29 14:51:29 2005 -0600 @@ -28,6 +28,10 @@ changesetparent = "parent #rev#:#node|short#" filerevparent = "parent:#node|short#" fileannotateparent = "parent:#node|short#" +changesetchild = "child #rev#:#node|short#" +changelogchild = "child #rev#:#node|short#" +filerevchild = "child:#node|short#" +fileannotatechild = "child:#node|short#" tags = tags.tmpl tagentry = "
  • #node# #tag#
  • " diffblock = "
    #lines#
    " @@ -35,6 +39,8 @@ changesettag = "tag:#tag#" filediffparent = "parent #rev#:#node|short#" filelogparent = "parent #rev#: #node|short#" +filediffchild = "child #rev#:#node|short#" +filelogchild = "child #rev#: #node|short#" indexentry = "#name##shortdesc##contact|obfuscate##lastupdate|age# agoRSS" index = index.tmpl archiveentry = "#type# " diff -r 428e0a9c9968 -r ba625c8083d8 templates/map-gitweb --- a/templates/map-gitweb Wed Dec 28 07:22:26 2005 -0800 +++ b/templates/map-gitweb Thu Dec 29 14:51:29 2005 -0600 @@ -30,6 +30,10 @@ changesetparent = "parent#node|short#" filerevparent = "parent:#node|short#" fileannotateparent = "parent:#node|short#" +changelogchild = "child #rev#:#node|short#" +changesetchild = "child#node|short#" +filerevchild = "child:#node|short#" +fileannotatechild = "child:#node|short#" tags = tags-gitweb.tmpl tagentry = "#date|age# ago#tag#changeset | changelog | manifest" diffblock = "#lines#" @@ -37,6 +41,8 @@ changesettag = "tag#tag#" filediffparent = "parent #rev#:#node|short#" filelogparent = "parent #rev#: #node|short#" +filediffchild = "child #rev#:#node|short#" +filelogchild = "child #rev#: #node|short#" shortlog = shortlog-gitweb.tmpl shortlogentry = "#date|age# ago#desc|firstline|escape#changeset | manifest" filelogentry = "#date|age# ago#desc|firstline|escape# annotate" diff -r 428e0a9c9968 -r ba625c8083d8 templates/map-raw --- a/templates/map-raw Wed Dec 28 07:22:26 2005 -0800 +++ b/templates/map-raw Thu Dec 29 14:51:29 2005 -0600 @@ -7,6 +7,7 @@ difflineat = "#line#" diffline = "#line#" changesetparent = "# parent: #node#" +changesetchild = "# child: #node#" filenodelink = "#file#" filerevision = filerevision-raw.tmpl fileline = "#line#" diff -r 428e0a9c9968 -r ba625c8083d8 templates/template-vars.txt --- a/templates/template-vars.txt Wed Dec 28 07:22:26 2005 -0800 +++ b/templates/template-vars.txt Thu Dec 29 14:51:29 2005 -0600 @@ -18,6 +18,7 @@ shortdesc a short description (escaped) author a name or email addressv(obfuscated) parent a list of the parent +child a list of the children tags a list of tag header the global page header