Last Updated: February 25, 2016
·
1.461K
· bripkens

Create a Mercurial changeset summary in JSON format

#!/bin/bash

OUT="changesets.json"

echo "[" > $OUT
hg log | \
  grep "^changeset:" | \
  sed 's/changeset.*:/  "/g' | \
  sed 's/$/",/g' | \
  sed '$s/,$//' >> $OUT
echo ']' >> $OUT