Skip to content

Instantly share code, notes, and snippets.

@LefterisJP
Created September 12, 2013 14:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LefterisJP/6538597 to your computer and use it in GitHub Desktop.
Save LefterisJP/6538597 to your computer and use it in GitHub Desktop.
Gource caption file from mercurial tags
#!/usr/bin/env bash
CAPTION_FILE=tags.caption
function extract_tags()
{
hg tags | while read x; do
tag=$(echo $x | awk '{print $1}');
rev=$(echo $x | awk '{print $2}' | awk -F: '{print $2}');
rev_date=$(hg log -r $rev --template 'date: {date}\n' | awk -F. '{print $1}' | awk '{print $2}');
echo "$rev_date|Version $tag released!"
done
}
extract_tags | sort > $CAPTION_FILE
@LefterisJP
Copy link
Author

When used in a mercurial repository it will read all the tags and create a caption file to be used with gource. Simply append the following argument to your gource options to use the file
--caption-file tags.caption

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment