137 def lines(): |
137 def lines(): |
138 for lineno, t in enumerate(text.splitlines(True)): |
138 for lineno, t in enumerate(text.splitlines(True)): |
139 yield {"line": t, |
139 yield {"line": t, |
140 "lineid": "l%d" % (lineno + 1), |
140 "lineid": "l%d" % (lineno + 1), |
141 "linenumber": "% 6d" % (lineno + 1), |
141 "linenumber": "% 6d" % (lineno + 1), |
142 "parity": parity.next()} |
142 "parity": next(parity)} |
143 |
143 |
144 return tmpl("filerevision", |
144 return tmpl("filerevision", |
145 file=f, |
145 file=f, |
146 path=webutil.up(f), |
146 path=webutil.up(f), |
147 text=lines(), |
147 text=lines(), |
276 n = ctx.node() |
276 n = ctx.node() |
277 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n) |
277 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n) |
278 files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles) |
278 files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles) |
279 |
279 |
280 yield tmpl('searchentry', |
280 yield tmpl('searchentry', |
281 parity=parity.next(), |
281 parity=next(parity), |
282 changelogtag=showtags, |
282 changelogtag=showtags, |
283 files=files, |
283 files=files, |
284 **webutil.commonentry(web.repo, ctx)) |
284 **webutil.commonentry(web.repo, ctx)) |
285 |
285 |
286 if count >= revcount: |
286 if count >= revcount: |
373 curcount += 1 |
373 curcount += 1 |
374 if curcount > revcount + 1: |
374 if curcount > revcount + 1: |
375 break |
375 break |
376 |
376 |
377 entry = webutil.changelistentry(web, web.repo[rev], tmpl) |
377 entry = webutil.changelistentry(web, web.repo[rev], tmpl) |
378 entry['parity'] = parity.next() |
378 entry['parity'] = next(parity) |
379 yield entry |
379 yield entry |
380 |
380 |
381 if shortlog: |
381 if shortlog: |
382 revcount = web.maxshortchanges |
382 revcount = web.maxshortchanges |
383 else: |
383 else: |
543 if v: |
543 if v: |
544 emptydirs.append(k) |
544 emptydirs.append(k) |
545 h = v |
545 h = v |
546 |
546 |
547 path = "%s%s" % (abspath, d) |
547 path = "%s%s" % (abspath, d) |
548 yield {"parity": parity.next(), |
548 yield {"parity": next(parity), |
549 "path": path, |
549 "path": path, |
550 "emptydirs": "/".join(emptydirs), |
550 "emptydirs": "/".join(emptydirs), |
551 "basename": d} |
551 "basename": d} |
552 |
552 |
553 return tmpl("manifest", |
553 return tmpl("manifest", |
554 symrev=symrev, |
554 symrev=symrev, |
555 path=abspath, |
555 path=abspath, |
556 up=webutil.up(abspath), |
556 up=webutil.up(abspath), |
557 upparity=parity.next(), |
557 upparity=next(parity), |
558 fentries=filelist, |
558 fentries=filelist, |
559 dentries=dirlist, |
559 dentries=dirlist, |
560 archives=web.archivelist(hex(node)), |
560 archives=web.archivelist(hex(node)), |
561 **webutil.commonentry(web.repo, ctx)) |
561 **webutil.commonentry(web.repo, ctx)) |
562 |
562 |
675 count += 1 |
675 count += 1 |
676 if count > 10: # limit to 10 tags |
676 if count > 10: # limit to 10 tags |
677 break |
677 break |
678 |
678 |
679 yield tmpl("tagentry", |
679 yield tmpl("tagentry", |
680 parity=parity.next(), |
680 parity=next(parity), |
681 tag=k, |
681 tag=k, |
682 node=hex(n), |
682 node=hex(n), |
683 date=web.repo[n].date()) |
683 date=web.repo[n].date()) |
684 |
684 |
685 def bookmarks(**map): |
685 def bookmarks(**map): |
686 parity = paritygen(web.stripecount) |
686 parity = paritygen(web.stripecount) |
687 marks = [b for b in web.repo._bookmarks.items() if b[1] in web.repo] |
687 marks = [b for b in web.repo._bookmarks.items() if b[1] in web.repo] |
688 sortkey = lambda b: (web.repo[b[1]].rev(), b[0]) |
688 sortkey = lambda b: (web.repo[b[1]].rev(), b[0]) |
689 marks = sorted(marks, key=sortkey, reverse=True) |
689 marks = sorted(marks, key=sortkey, reverse=True) |
690 for k, n in marks[:10]: # limit to 10 bookmarks |
690 for k, n in marks[:10]: # limit to 10 bookmarks |
691 yield {'parity': parity.next(), |
691 yield {'parity': next(parity), |
692 'bookmark': k, |
692 'bookmark': k, |
693 'date': web.repo[n].date(), |
693 'date': web.repo[n].date(), |
694 'node': hex(n)} |
694 'node': hex(n)} |
695 |
695 |
696 def changelist(**map): |
696 def changelist(**map): |
961 revs = fctx.filelog().revs(start, end - 1) |
961 revs = fctx.filelog().revs(start, end - 1) |
962 for i in revs: |
962 for i in revs: |
963 iterfctx = fctx.filectx(i) |
963 iterfctx = fctx.filectx(i) |
964 |
964 |
965 l.append(dict( |
965 l.append(dict( |
966 parity=parity.next(), |
966 parity=next(parity), |
967 filerev=i, |
967 filerev=i, |
968 file=f, |
968 file=f, |
969 rename=webutil.renamelink(iterfctx), |
969 rename=webutil.renamelink(iterfctx), |
970 **webutil.commonentry(repo, iterfctx))) |
970 **webutil.commonentry(repo, iterfctx))) |
971 for e in reversed(l): |
971 for e in reversed(l): |