Skip to content

Instantly share code, notes, and snippets.

@LefterisJP
Created September 12, 2013 14:41

Revisions

  1. LefterisJP created this gist Sep 12, 2013.
    15 changes: 15 additions & 0 deletions read_tags.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/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