mercurial/hgweb/webcommands.py
changeset 30825 4deb7c1a07ab
parent 30816 96f811bceb85
child 30826 923336cf8b8a
equal deleted inserted replaced
30824:6e1d54be7588 30825:4deb7c1a07ab
   972     morevars['revcount'] = revcount * 2
   972     morevars['revcount'] = revcount * 2
   973 
   973 
   974     count = fctx.filerev() + 1
   974     count = fctx.filerev() + 1
   975     start = max(0, fctx.filerev() - revcount + 1) # first rev on this page
   975     start = max(0, fctx.filerev() - revcount + 1) # first rev on this page
   976     end = min(count, start + revcount) # last rev on this page
   976     end = min(count, start + revcount) # last rev on this page
   977     parity = paritygen(web.stripecount, offset=start - end + 1)
   977     parity = paritygen(web.stripecount, offset=start - end)
   978 
   978 
   979     repo = web.repo
   979     repo = web.repo
   980     revs = fctx.filelog().revs(start, end - 1)
   980     revs = fctx.filelog().revs(start, end - 1)
   981     entries = []
   981     entries = []
   982     for i in reversed(revs):
   982     for i in revs:
   983         iterfctx = fctx.filectx(i)
   983         iterfctx = fctx.filectx(i)
   984         entries.append(dict(
   984         entries.append(dict(
   985             parity=next(parity),
   985             parity=next(parity),
   986             filerev=i,
   986             filerev=i,
   987             file=f,
   987             file=f,
   988             rename=webutil.renamelink(iterfctx),
   988             rename=webutil.renamelink(iterfctx),
   989             **webutil.commonentry(repo, iterfctx)))
   989             **webutil.commonentry(repo, iterfctx)))
       
   990     entries.reverse()
   990 
   991 
   991     latestentry = entries[:1]
   992     latestentry = entries[:1]
   992 
   993 
   993     revnav = webutil.filerevnav(web.repo, fctx.path())
   994     revnav = webutil.filerevnav(web.repo, fctx.path())
   994     nav = revnav.gen(end - 1, revcount, count)
   995     nav = revnav.gen(end - 1, revcount, count)