#!/usr/bin/env ruby
# Generate list of authors from repository commits

log = `hg log --template='{author}'%`

authors = Hash.new(0)
log.split('%').each do |i|
  authors[i] += 1
end

# sort list by descending number of commits
authors = authors.sort_by {|k, v| v}.reverse

# print out authors
authors.each do |k, v|
  #print "    #{k} (#{v})\n"
  print "    #{k}\n"
end