#!/bin/bash
# Small script to easily generate a ChangeLog from hg log.

project=Lazygal

HG=$(which hg)
AWK=$(which awk)

repo=$(dirname $0)/..

$HG log --template '{tags}|{date|shortdate}|{desc|firstline}\n' -R $repo |\
    $AWK -F'|'\
        '/^tip\|/ { print "  * " $3 }\
         /^\|/    { print "  * " $3 }\
         /^[0-9]/ { gsub(/\_/,".",$1);\
                    print "\nLazygal " $1 " (" $2 ")";
                    print "  * " $3\
                  }'\
    > $repo/ChangeLog
