##// END OF EJS Templates
hgweb: no do not use listinsert(0, ...)...
Pierre-Yves David -
r18319:e350ce79 default
parent child Browse files
Show More
@@ -202,26 +202,25 b' def changelog(web, req, tmpl, shortlog=F'
202 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
202 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
203 files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)
203 files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)
204
204
205 l.insert(0, {"parity": parity.next(),
205 l.append({"parity": parity.next(),
206 "author": ctx.user(),
206 "author": ctx.user(),
207 "parent": webutil.parents(ctx, i - 1),
207 "parent": webutil.parents(ctx, i - 1),
208 "child": webutil.children(ctx, i + 1),
208 "child": webutil.children(ctx, i + 1),
209 "changelogtag": showtags,
209 "changelogtag": showtags,
210 "desc": ctx.description(),
210 "desc": ctx.description(),
211 "date": ctx.date(),
211 "date": ctx.date(),
212 "files": files,
212 "files": files,
213 "rev": i,
213 "rev": i,
214 "node": hex(n),
214 "node": hex(n),
215 "tags": webutil.nodetagsdict(web.repo, n),
215 "tags": webutil.nodetagsdict(web.repo, n),
216 "bookmarks": webutil.nodebookmarksdict(web.repo, n),
216 "bookmarks": webutil.nodebookmarksdict(web.repo, n),
217 "inbranch": webutil.nodeinbranch(web.repo, ctx),
217 "inbranch": webutil.nodeinbranch(web.repo, ctx),
218 "branches": webutil.nodebranchdict(web.repo, ctx)
218 "branches": webutil.nodebranchdict(web.repo, ctx)
219 })
219 })
220 if limit > 0:
221 l = l[-limit:]
220
222
221 if limit > 0:
223 for e in reversed(l):
222 l = l[:limit]
223
224 for e in l:
225 yield e
224 yield e
226
225
227 revcount = shortlog and web.maxshortchanges or web.maxchanges
226 revcount = shortlog and web.maxshortchanges or web.maxchanges
@@ -520,7 +519,7 b' def summary(web, req, tmpl):'
520 n = ctx.node()
519 n = ctx.node()
521 hn = hex(n)
520 hn = hex(n)
522
521
523 l.insert(0, tmpl(
522 l.append(tmpl(
524 'shortlogentry',
523 'shortlogentry',
525 parity=parity.next(),
524 parity=parity.next(),
526 author=ctx.user(),
525 author=ctx.user(),
@@ -533,6 +532,7 b' def summary(web, req, tmpl):'
533 inbranch=webutil.nodeinbranch(web.repo, ctx),
532 inbranch=webutil.nodeinbranch(web.repo, ctx),
534 branches=webutil.nodebranchdict(web.repo, ctx)))
533 branches=webutil.nodebranchdict(web.repo, ctx)))
535
534
535 l.reverse()
536 yield l
536 yield l
537
537
538 tip = web.repo['tip']
538 tip = web.repo['tip']
@@ -748,27 +748,27 b' def filelog(web, req, tmpl):'
748 for i in xrange(start, end):
748 for i in xrange(start, end):
749 iterfctx = fctx.filectx(i)
749 iterfctx = fctx.filectx(i)
750
750
751 l.insert(0, {"parity": parity.next(),
751 l.append({"parity": parity.next(),
752 "filerev": i,
752 "filerev": i,
753 "file": f,
753 "file": f,
754 "node": iterfctx.hex(),
754 "node": iterfctx.hex(),
755 "author": iterfctx.user(),
755 "author": iterfctx.user(),
756 "date": iterfctx.date(),
756 "date": iterfctx.date(),
757 "rename": webutil.renamelink(iterfctx),
757 "rename": webutil.renamelink(iterfctx),
758 "parent": webutil.parents(iterfctx),
758 "parent": webutil.parents(iterfctx),
759 "child": webutil.children(iterfctx),
759 "child": webutil.children(iterfctx),
760 "desc": iterfctx.description(),
760 "desc": iterfctx.description(),
761 "tags": webutil.nodetagsdict(repo, iterfctx.node()),
761 "tags": webutil.nodetagsdict(repo, iterfctx.node()),
762 "bookmarks": webutil.nodebookmarksdict(
762 "bookmarks": webutil.nodebookmarksdict(
763 repo, iterfctx.node()),
763 repo, iterfctx.node()),
764 "branch": webutil.nodebranchnodefault(iterfctx),
764 "branch": webutil.nodebranchnodefault(iterfctx),
765 "inbranch": webutil.nodeinbranch(repo, iterfctx),
765 "inbranch": webutil.nodeinbranch(repo, iterfctx),
766 "branches": webutil.nodebranchdict(repo, iterfctx)})
766 "branches": webutil.nodebranchdict(repo, iterfctx)})
767
767
768 if limit > 0:
768 if limit > 0:
769 l = l[:limit]
769 l = l[-limit:]
770
770
771 for e in l:
771 for e in reversed(l):
772 yield e
772 yield e
773
773
774 nodefunc = lambda x: fctx.filectx(fileid=x)
774 nodefunc = lambda x: fctx.filectx(fileid=x)
General Comments 0
You need to be logged in to leave comments. Login now