Mercurial > hg
comparison mercurial/hgweb.py @ 1416:19d2776f1725
hgweb: hide trivial parent (like in show_changeset)
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Wed, 19 Oct 2005 20:54:46 -0700 |
parents | e2ba788545bf |
children | 68f81ba07b2a |
comparison
equal
deleted
inserted
replaced
1415:c6e6ca96a033 | 1416:19d2776f1725 |
---|---|
196 for f in files[:self.maxfiles]: | 196 for f in files[:self.maxfiles]: |
197 yield self.t("filedifflink", node=hex(changeset), file=f) | 197 yield self.t("filedifflink", node=hex(changeset), file=f) |
198 if len(files) > self.maxfiles: | 198 if len(files) > self.maxfiles: |
199 yield self.t("fileellipses") | 199 yield self.t("fileellipses") |
200 | 200 |
201 def parents(self, t1, nodes=[], rev=None,**args): | 201 def parents(self, node, parents=[], rev=None, hide=False, **args): |
202 if not rev: | 202 if not rev: |
203 rev = lambda x: "" | 203 rev = lambda x: "" |
204 for node in nodes: | 204 parents = [p for p in parents if p != nullid] |
205 if node != nullid: | 205 if hide and len(parents) == 1 and rev(parents[0]) == rev(node) - 1: |
206 yield self.t(t1, node=hex(node), rev=rev(node), **args) | 206 return |
207 for p in parents: | |
208 yield dict(node=hex(p), rev=rev(p), **args) | |
207 | 209 |
208 def showtag(self, t1, node=nullid, **args): | 210 def showtag(self, t1, node=nullid, **args): |
209 for t in self.repo.nodetags(node): | 211 for t in self.repo.nodetags(node): |
210 yield self.t(t1, tag=t, **args) | 212 yield self.t(t1, tag=t, **args) |
211 | 213 |
303 changes = cl.read(n) | 305 changes = cl.read(n) |
304 hn = hex(n) | 306 hn = hex(n) |
305 | 307 |
306 l.insert(0, {"parity": parity, | 308 l.insert(0, {"parity": parity, |
307 "author": changes[1], | 309 "author": changes[1], |
308 "parent": self.parents("changelogparent", | 310 "parent": self.parents(n, cl.parents(n), cl.rev, |
309 cl.parents(n), cl.rev), | 311 hide=True), |
310 "changelogtag": self.showtag("changelogtag",n), | 312 "changelogtag": self.showtag("changelogtag",n), |
311 "manifest": hex(changes[0]), | 313 "manifest": hex(changes[0]), |
312 "desc": changes[4], | 314 "desc": changes[4], |
313 "date": changes[2], | 315 "date": changes[2], |
314 "files": self.listfilediffs(changes[3], n), | 316 "files": self.listfilediffs(changes[3], n), |
364 hn = hex(n) | 366 hn = hex(n) |
365 | 367 |
366 yield self.t('searchentry', | 368 yield self.t('searchentry', |
367 parity=count & 1, | 369 parity=count & 1, |
368 author=changes[1], | 370 author=changes[1], |
369 parent=self.parents("changelogparent", | 371 parent=self.parents(n, cl.parents(n), cl.rev), |
370 cl.parents(n), cl.rev), | |
371 changelogtag=self.showtag("changelogtag",n), | 372 changelogtag=self.showtag("changelogtag",n), |
372 manifest=hex(changes[0]), | 373 manifest=hex(changes[0]), |
373 desc=changes[4], | 374 desc=changes[4], |
374 date=changes[2], | 375 date=changes[2], |
375 files=self.listfilediffs(changes[3], n), | 376 files=self.listfilediffs(changes[3], n), |
410 | 411 |
411 yield self.t('changeset', | 412 yield self.t('changeset', |
412 diff=diff, | 413 diff=diff, |
413 rev=cl.rev(n), | 414 rev=cl.rev(n), |
414 node=nodeid, | 415 node=nodeid, |
415 parent=self.parents("changesetparent", | 416 parent=self.parents(n, cl.parents(n), cl.rev), |
416 cl.parents(n), cl.rev), | |
417 changesettag=self.showtag("changesettag",n), | 417 changesettag=self.showtag("changesettag",n), |
418 manifest=hex(changes[0]), | 418 manifest=hex(changes[0]), |
419 author=changes[1], | 419 author=changes[1], |
420 desc=changes[4], | 420 desc=changes[4], |
421 date=changes[2], | 421 date=changes[2], |
443 "filerev": i, | 443 "filerev": i, |
444 "file": f, | 444 "file": f, |
445 "node": hex(cn), | 445 "node": hex(cn), |
446 "author": cs[1], | 446 "author": cs[1], |
447 "date": cs[2], | 447 "date": cs[2], |
448 "parent": self.parents("filelogparent", | 448 "parent": self.parents(n, fl.parents(n), |
449 fl.parents(n), | |
450 fl.rev, file=f), | 449 fl.rev, file=f), |
451 "desc": cs[4]}) | 450 "desc": cs[4]}) |
452 parity = 1 - parity | 451 parity = 1 - parity |
453 | 452 |
454 for e in l: | 453 for e in l: |
488 rev=changerev, | 487 rev=changerev, |
489 node=hex(cn), | 488 node=hex(cn), |
490 manifest=hex(mfn), | 489 manifest=hex(mfn), |
491 author=cs[1], | 490 author=cs[1], |
492 date=cs[2], | 491 date=cs[2], |
493 parent=self.parents("filerevparent", | 492 parent=self.parents(n, fl.parents(n), fl.rev, file=f), |
494 fl.parents(n), fl.rev, file=f), | |
495 permissions=self.repo.manifest.readflags(mfn)[f]) | 493 permissions=self.repo.manifest.readflags(mfn)[f]) |
496 | 494 |
497 def fileannotate(self, f, node): | 495 def fileannotate(self, f, node): |
498 bcache = {} | 496 bcache = {} |
499 ncache = {} | 497 ncache = {} |
541 rev=changerev, | 539 rev=changerev, |
542 node=hex(cn), | 540 node=hex(cn), |
543 manifest=hex(mfn), | 541 manifest=hex(mfn), |
544 author=cs[1], | 542 author=cs[1], |
545 date=cs[2], | 543 date=cs[2], |
546 parent=self.parents("fileannotateparent", | 544 parent=self.parents(n, fl.parents(n), fl.rev, file=f), |
547 fl.parents(n), fl.rev, file=f), | |
548 permissions=self.repo.manifest.readflags(mfn)[f]) | 545 permissions=self.repo.manifest.readflags(mfn)[f]) |
549 | 546 |
550 def manifest(self, mnode, path): | 547 def manifest(self, mnode, path): |
551 man = self.repo.manifest | 548 man = self.repo.manifest |
552 mn = man.lookup(mnode) | 549 mn = man.lookup(mnode) |
646 yield self.t("filediff", | 643 yield self.t("filediff", |
647 file=file, | 644 file=file, |
648 filenode=hex(mf.get(file, nullid)), | 645 filenode=hex(mf.get(file, nullid)), |
649 node=changeset, | 646 node=changeset, |
650 rev=self.repo.changelog.rev(n), | 647 rev=self.repo.changelog.rev(n), |
651 parent=self.parents("filediffparent", | 648 parent=self.parents(n, cl.parents(n), cl.rev), |
652 cl.parents(n), cl.rev), | |
653 diff=diff) | 649 diff=diff) |
654 | 650 |
655 def archive(self, req, cnode, type): | 651 def archive(self, req, cnode, type): |
656 cs = self.repo.changelog.read(cnode) | 652 cs = self.repo.changelog.read(cnode) |
657 mnode = cs[0] | 653 mnode = cs[0] |