mercurial/hgweb/webutil.py
changeset 14562 fccd3b966da7
parent 14561 925d9f2b188b
child 14570 9f908ef5a595
equal deleted inserted replaced
14561:925d9f2b188b 14562:fccd3b966da7
   221     def pct(i):
   221     def pct(i):
   222         if maxtotal == 0:
   222         if maxtotal == 0:
   223             return 0
   223             return 0
   224         return (float(i) / maxtotal) * 100
   224         return (float(i) / maxtotal) * 100
   225 
   225 
       
   226     fileno = 0
   226     for filename, adds, removes, isbinary in stats:
   227     for filename, adds, removes, isbinary in stats:
   227         template = filename in files and 'diffstatlink' or 'diffstatnolink'
   228         template = filename in files and 'diffstatlink' or 'diffstatnolink'
   228         total = adds + removes
   229         total = adds + removes
   229         yield tmpl(template, node=ctx.hex(), file=filename,
   230         fileno += 1
       
   231         yield tmpl(template, node=ctx.hex(), file=filename, fileno=fileno,
   230                    total=total, addpct=pct(adds), removepct=pct(removes),
   232                    total=total, addpct=pct(adds), removepct=pct(removes),
   231                    parity=parity.next())
   233                    parity=parity.next())
   232 
   234 
   233 class sessionvars(object):
   235 class sessionvars(object):
   234     def __init__(self, vars, start='?'):
   236     def __init__(self, vars, start='?'):