view paste/paste.12049 @ 9954:fb3529990ed4

<oerjan> ` echo \'121:122 194:196 770:771 1000:1001 1493 1497 2113:2114 3341:3343 4530:4531 5136:5137 5642:5643 5895 5897 8669:8678 9070:9071 9074:9075\' | xargs -n 1 >share/scowrevs
author HackBot
date Mon, 12 Dec 2016 03:24:20 +0000
parents e925c0adf7ad
children
line wrap: on
line source

#!/bin/sh
count () {
    hg log --template '{desc}\n' |
    egrep '<[^]]*> karma\'$1 |
    fgrep -vix "<$2> karma$1 $2" |
    cut -d' ' -f3 |
    fgrep -cix "$2"
}
plus=$(count + "$1")
minus=$(count - "$1")
echo $(($plus-$minus))