def showdiffstat(repo, ctx, templ, **args):
    """:diffstat: String. Statistics of changes with the following format:
    "modified files: +added/-removed lines"
    """
    stats = patch.diffstatdata(util.iterlines(ctx.diff()))
    maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
    return '%s: +%s/-%s' % (len(stats), adds, removes)
Example #2
0
def showdiffstat(repo, ctx, templ, **args):
    files, adds, removes = 0, 0, 0
    for i in patch.diffstatdata(util.iterlines(ctx.diff())):
        files += 1
        adds += i[1]
        removes += i[2]
    return '%s: +%s/-%s' % (files, adds, removes)
Example #3
0
 def showdiffstat(**args):
     diff = patch.diff(self.repo, ctx.parents()[0].node(), ctx.node())
     files, adds, removes = 0, 0, 0
     for i in patch.diffstatdata(util.iterlines(diff)):
         files += 1
         adds += i[1]
         removes += i[2]
     return '%s: +%s/-%s' % (files, adds, removes)
Example #4
0
def showdiffstat(repo, ctx, templ, **args):
    diff = patch.diff(repo, ctx.parents()[0].node(), ctx.node())
    files, adds, removes = 0, 0, 0
    for i in patch.diffstatdata(util.iterlines(diff)):
        files += 1
        adds += i[1]
        removes += i[2]
    return '%s: +%s/-%s' % (files, adds, removes)