Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgweb_mod.py @ 6125:74406f50bd46
Make hgweb annotate link to target line numbers (issue623)
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 15 Feb 2008 21:34:16 +0100 |
parents | f7f25f58693a |
children | 50a277e6ceae |
comparison
equal
deleted
inserted
replaced
6124:b4f86eb13dbd | 6125:74406f50bd46 |
---|---|
634 fl = fctx.filelog() | 634 fl = fctx.filelog() |
635 parity = paritygen(self.stripecount) | 635 parity = paritygen(self.stripecount) |
636 | 636 |
637 def annotate(**map): | 637 def annotate(**map): |
638 last = None | 638 last = None |
639 for lineno, (f, l) in enumerate(fctx.annotate(follow=True)): | 639 lines = enumerate(fctx.annotate(follow=True, linenumber=True)) |
640 for lineno, ((f, targetline), l) in lines: | |
640 fnode = f.filenode() | 641 fnode = f.filenode() |
641 name = self.repo.ui.shortuser(f.user()) | 642 name = self.repo.ui.shortuser(f.user()) |
642 | 643 |
643 if last != fnode: | 644 if last != fnode: |
644 last = fnode | 645 last = fnode |
646 yield {"parity": parity.next(), | 647 yield {"parity": parity.next(), |
647 "node": hex(f.node()), | 648 "node": hex(f.node()), |
648 "rev": f.rev(), | 649 "rev": f.rev(), |
649 "author": name, | 650 "author": name, |
650 "file": f.path(), | 651 "file": f.path(), |
652 "targetline": targetline, | |
651 "line": l, | 653 "line": l, |
652 "lineid": "l%d" % (lineno + 1), | 654 "lineid": "l%d" % (lineno + 1), |
653 "linenumber": "% 6d" % (lineno + 1)} | 655 "linenumber": "% 6d" % (lineno + 1)} |
654 | 656 |
655 return tmpl("fileannotate", | 657 return tmpl("fileannotate", |