##// END OF EJS Templates
webcommands: add 'branches' command, similar to 'tags'
Sune Foldager -
r8352:eefcb59d default
parent child Browse files
Show More
@@ -19,8 +19,8 from mercurial import graphmod, util
19 19
20 20 __all__ = [
21 21 'log', 'rawfile', 'file', 'changelog', 'shortlog', 'changeset', 'rev',
22 'manifest', 'tags', 'summary', 'filediff', 'diff', 'annotate', 'filelog',
23 'archive', 'static', 'graph',
22 'manifest', 'tags', 'branches', 'summary', 'filediff', 'diff', 'annotate',
23 'filelog', 'archive', 'static', 'graph',
24 24 ]
25 25
26 26 def log(web, req, tmpl):
@@ -358,6 +358,26 def tags(web, req, tmpl):
358 358 entriesnotip=lambda **x: entries(True,0, **x),
359 359 latestentry=lambda **x: entries(True,1, **x))
360 360
361 def branches(web, req, tmpl):
362 b = web.repo.branchtags()
363 l = [(-web.repo.changelog.rev(n), n, t) for t, n in b.iteritems()]
364 parity = paritygen(web.stripecount)
365
366 def entries(limit, **map):
367 count = 0
368 for r, n, t in sorted(l):
369 if limit > 0 and count >= limit:
370 return
371 count += 1
372 yield {'parity': parity.next(),
373 'branch': t,
374 'node': hex(n),
375 'date': web.repo[n].date()}
376
377 return tmpl('branches', node=hex(web.repo.changelog.tip()),
378 entries=lambda **x: entries(0, **x),
379 latestentry=lambda **x: entries(1, **x))
380
361 381 def summary(web, req, tmpl):
362 382 i = web.repo.tagslist()
363 383 i.reverse()
General Comments 0
You need to be logged in to leave comments. Login now