Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/hgweb.py @ 1653:e8a3df8b62b3
hgweb: show copy/rename links in file history
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 29 Jan 2006 17:10:38 +1300 |
parents | f2ebd5251e88 |
children | 41d884f741ca adbc392dfd9e |
comparison
equal
deleted
inserted
replaced
1652:f910437af806 | 1653:e8a3df8b62b3 |
---|---|
219 siblings = [s for s in siblings if s != nullid] | 219 siblings = [s for s in siblings if s != nullid] |
220 if len(siblings) == 1 and rev(siblings[0]) == hiderev: | 220 if len(siblings) == 1 and rev(siblings[0]) == hiderev: |
221 return | 221 return |
222 for s in siblings: | 222 for s in siblings: |
223 yield dict(node=hex(s), rev=rev(s), **args) | 223 yield dict(node=hex(s), rev=rev(s), **args) |
224 | |
225 def renamelink(self, fl, node): | |
226 r = fl.renamed(node) | |
227 if r: | |
228 return [dict(file=r[0], node=hex(r[1]))] | |
229 return [] | |
224 | 230 |
225 def showtag(self, t1, node=nullid, **args): | 231 def showtag(self, t1, node=nullid, **args): |
226 for t in self.repo.nodetags(node): | 232 for t in self.repo.nodetags(node): |
227 yield self.t(t1, tag=t, **args) | 233 yield self.t(t1, tag=t, **args) |
228 | 234 |
464 "filerev": i, | 470 "filerev": i, |
465 "file": f, | 471 "file": f, |
466 "node": hex(cn), | 472 "node": hex(cn), |
467 "author": cs[1], | 473 "author": cs[1], |
468 "date": cs[2], | 474 "date": cs[2], |
475 "rename": self.renamelink(fl, n), | |
469 "parent": self.siblings(fl.parents(n), | 476 "parent": self.siblings(fl.parents(n), |
470 fl.rev, file=f), | 477 fl.rev, file=f), |
471 "child": self.siblings(fl.children(n), | 478 "child": self.siblings(fl.children(n), |
472 fl.rev, file=f), | 479 fl.rev, file=f), |
473 "desc": cs[4]}) | 480 "desc": cs[4]}) |
512 manifest=hex(mfn), | 519 manifest=hex(mfn), |
513 author=cs[1], | 520 author=cs[1], |
514 date=cs[2], | 521 date=cs[2], |
515 parent=self.siblings(fl.parents(n), fl.rev, file=f), | 522 parent=self.siblings(fl.parents(n), fl.rev, file=f), |
516 child=self.siblings(fl.children(n), fl.rev, file=f), | 523 child=self.siblings(fl.children(n), fl.rev, file=f), |
524 rename=self.renamelink(fl, n), | |
517 permissions=self.repo.manifest.readflags(mfn)[f]) | 525 permissions=self.repo.manifest.readflags(mfn)[f]) |
518 | 526 |
519 def fileannotate(self, f, node): | 527 def fileannotate(self, f, node): |
520 bcache = {} | 528 bcache = {} |
521 ncache = {} | 529 ncache = {} |
563 rev=changerev, | 571 rev=changerev, |
564 node=hex(cn), | 572 node=hex(cn), |
565 manifest=hex(mfn), | 573 manifest=hex(mfn), |
566 author=cs[1], | 574 author=cs[1], |
567 date=cs[2], | 575 date=cs[2], |
576 rename=self.renamelink(fl, n), | |
568 parent=self.siblings(fl.parents(n), fl.rev, file=f), | 577 parent=self.siblings(fl.parents(n), fl.rev, file=f), |
569 child=self.siblings(fl.children(n), fl.rev, file=f), | 578 child=self.siblings(fl.children(n), fl.rev, file=f), |
570 permissions=self.repo.manifest.readflags(mfn)[f]) | 579 permissions=self.repo.manifest.readflags(mfn)[f]) |
571 | 580 |
572 def manifest(self, mnode, path): | 581 def manifest(self, mnode, path): |