Open PS2 Loader / scripts / make_changelog.sh

#!/bin/bash

hgchangeset=`eval hg log | grep changeset: | sed -n 's/changeset: *//p' | sed -n 's/:[^.]*//p'`
hg log | grep summary: | sed -n 's/summary: *//p' >rev_summary
hg log | grep date: | sed -n 's/date: *//p' >rev_date

i=0
changeset_array=$(echo $hgchangeset | tr " " "\n")
for x in $changeset_array; do
	changeset[$i]=$x
	i=$(($i + 1))		
done
echo "found $i revision changesets..."

i=0
while read line; do
	summary[$i]=$line
	i=$(($i + 1))
done <rev_summary
echo "found $i revision summaries..."

i=0
while read line; do
	date[$i]=$line
	i=$(($i + 1))
done <rev_date
echo "found $i revision dates..."

echo "-----------------------------------------------------------------------------" >DETAILED_CHANGELOG
echo "" >>DETAILED_CHANGELOG
echo "  Copyright 2009-2010, Ifcaro & jimmikaelkael" >>DETAILED_CHANGELOG
echo "  Licenced under Academic Free License version 3.0" >>DETAILED_CHANGELOG
echo "  Review Open PS2 Loader README & LICENSE files for further details." >>DETAILED_CHANGELOG
echo "" >>DETAILED_CHANGELOG
echo "-----------------------------------------------------------------------------" >>DETAILED_CHANGELOG
echo "" >>DETAILED_CHANGELOG
echo "Open PS2 Loader detailed ChangeLog:" >>DETAILED_CHANGELOG
echo "" >>DETAILED_CHANGELOG

for ((j=0; j<$i; j++)); do
	echo "rev${changeset[$j]} - ${summary[$j]} - ${date[$j]}" >>DETAILED_CHANGELOG
done

rm rev_summary
rm rev_date
cp -f DETAILED_CHANGELOG ../
rm DETAILED_CHANGELOG

echo "DETAILED_CHANGELOG file created."
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.