--- a/mercurial/hgweb.py Wed Oct 19 00:10:52 2005 -0700
+++ b/mercurial/hgweb.py Wed Oct 19 20:54:46 2005 -0700
@@ -198,12 +198,14 @@
if len(files) > self.maxfiles:
yield self.t("fileellipses")
- def parents(self, t1, nodes=[], rev=None,**args):
+ def parents(self, node, parents=[], rev=None, hide=False, **args):
if not rev:
rev = lambda x: ""
- for node in nodes:
- if node != nullid:
- yield self.t(t1, node=hex(node), rev=rev(node), **args)
+ parents = [p for p in parents if p != nullid]
+ if hide and len(parents) == 1 and rev(parents[0]) == rev(node) - 1:
+ return
+ for p in parents:
+ yield dict(node=hex(p), rev=rev(p), **args)
def showtag(self, t1, node=nullid, **args):
for t in self.repo.nodetags(node):
@@ -305,8 +307,8 @@
l.insert(0, {"parity": parity,
"author": changes[1],
- "parent": self.parents("changelogparent",
- cl.parents(n), cl.rev),
+ "parent": self.parents(n, cl.parents(n), cl.rev,
+ hide=True),
"changelogtag": self.showtag("changelogtag",n),
"manifest": hex(changes[0]),
"desc": changes[4],
@@ -366,8 +368,7 @@
yield self.t('searchentry',
parity=count & 1,
author=changes[1],
- parent=self.parents("changelogparent",
- cl.parents(n), cl.rev),
+ parent=self.parents(n, cl.parents(n), cl.rev),
changelogtag=self.showtag("changelogtag",n),
manifest=hex(changes[0]),
desc=changes[4],
@@ -412,8 +413,7 @@
diff=diff,
rev=cl.rev(n),
node=nodeid,
- parent=self.parents("changesetparent",
- cl.parents(n), cl.rev),
+ parent=self.parents(n, cl.parents(n), cl.rev),
changesettag=self.showtag("changesettag",n),
manifest=hex(changes[0]),
author=changes[1],
@@ -445,8 +445,7 @@
"node": hex(cn),
"author": cs[1],
"date": cs[2],
- "parent": self.parents("filelogparent",
- fl.parents(n),
+ "parent": self.parents(n, fl.parents(n),
fl.rev, file=f),
"desc": cs[4]})
parity = 1 - parity
@@ -490,8 +489,7 @@
manifest=hex(mfn),
author=cs[1],
date=cs[2],
- parent=self.parents("filerevparent",
- fl.parents(n), fl.rev, file=f),
+ parent=self.parents(n, fl.parents(n), fl.rev, file=f),
permissions=self.repo.manifest.readflags(mfn)[f])
def fileannotate(self, f, node):
@@ -543,8 +541,7 @@
manifest=hex(mfn),
author=cs[1],
date=cs[2],
- parent=self.parents("fileannotateparent",
- fl.parents(n), fl.rev, file=f),
+ parent=self.parents(n, fl.parents(n), fl.rev, file=f),
permissions=self.repo.manifest.readflags(mfn)[f])
def manifest(self, mnode, path):
@@ -648,8 +645,7 @@
filenode=hex(mf.get(file, nullid)),
node=changeset,
rev=self.repo.changelog.rev(n),
- parent=self.parents("filediffparent",
- cl.parents(n), cl.rev),
+ parent=self.parents(n, cl.parents(n), cl.rev),
diff=diff)
def archive(self, req, cnode, type):