168 if 'rev' in req.form: |
168 if 'rev' in req.form: |
169 hi = req.form['rev'][0] |
169 hi = req.form['rev'][0] |
170 else: |
170 else: |
171 hi = web.repo.changelog.count() - 1 |
171 hi = web.repo.changelog.count() - 1 |
172 try: |
172 try: |
173 ctx = web.repo.changectx(hi) |
173 ctx = web.repo[hi] |
174 except RepoError: |
174 except RepoError: |
175 return _search(web, tmpl, hi) # XXX redirect to 404 page? |
175 return _search(web, tmpl, hi) # XXX redirect to 404 page? |
176 |
176 |
177 def changelist(limit=0, **map): |
177 def changelist(limit=0, **map): |
178 cl = web.repo.changelog |
178 cl = web.repo.changelog |
179 l = [] # build a list in forward order for efficiency |
179 l = [] # build a list in forward order for efficiency |
180 for i in xrange(start, end): |
180 for i in xrange(start, end): |
181 ctx = web.repo.changectx(i) |
181 ctx = web.repo[i] |
182 n = ctx.node() |
182 n = ctx.node() |
183 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n) |
183 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n) |
184 |
184 |
185 l.insert(0, {"parity": parity.next(), |
185 l.insert(0, {"parity": parity.next(), |
186 "author": ctx.user(), |
186 "author": ctx.user(), |
341 if limit > 0 and count >= limit: |
341 if limit > 0 and count >= limit: |
342 continue |
342 continue |
343 count = count + 1 |
343 count = count + 1 |
344 yield {"parity": parity.next(), |
344 yield {"parity": parity.next(), |
345 "tag": k, |
345 "tag": k, |
346 "date": web.repo.changectx(n).date(), |
346 "date": web.repo[n].date(), |
347 "node": hex(n)} |
347 "node": hex(n)} |
348 |
348 |
349 return tmpl("tags", |
349 return tmpl("tags", |
350 node=hex(web.repo.changelog.tip()), |
350 node=hex(web.repo.changelog.tip()), |
351 entries=lambda **x: entries(False,0, **x), |
351 entries=lambda **x: entries(False,0, **x), |
369 |
369 |
370 yield tmpl("tagentry", |
370 yield tmpl("tagentry", |
371 parity=parity.next(), |
371 parity=parity.next(), |
372 tag=k, |
372 tag=k, |
373 node=hex(n), |
373 node=hex(n), |
374 date=web.repo.changectx(n).date()) |
374 date=web.repo[n].date()) |
375 |
375 |
376 def branches(**map): |
376 def branches(**map): |
377 parity = paritygen(web.stripecount) |
377 parity = paritygen(web.stripecount) |
378 |
378 |
379 b = web.repo.branchtags() |
379 b = web.repo.branchtags() |
380 l = [(-web.repo.changelog.rev(n), n, t) for t, n in b.items()] |
380 l = [(-web.repo.changelog.rev(n), n, t) for t, n in b.items()] |
381 l.sort() |
381 l.sort() |
382 |
382 |
383 for r,n,t in l: |
383 for r,n,t in l: |
384 ctx = web.repo.changectx(n) |
|
385 yield {'parity': parity.next(), |
384 yield {'parity': parity.next(), |
386 'branch': t, |
385 'branch': t, |
387 'node': hex(n), |
386 'node': hex(n), |
388 'date': ctx.date()} |
387 'date': web.repo[n].date()} |
389 |
388 |
390 def changelist(**map): |
389 def changelist(**map): |
391 parity = paritygen(web.stripecount, offset=start-end) |
390 parity = paritygen(web.stripecount, offset=start-end) |
392 l = [] # build a list in forward order for efficiency |
391 l = [] # build a list in forward order for efficiency |
393 for i in xrange(start, end): |
392 for i in xrange(start, end): |
394 ctx = web.repo.changectx(i) |
393 ctx = web.repo[i] |
395 n = ctx.node() |
394 n = ctx.node() |
396 hn = hex(n) |
395 hn = hex(n) |
397 |
396 |
398 l.insert(0, tmpl( |
397 l.insert(0, tmpl( |
399 'shortlogentry', |
398 'shortlogentry', |