fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote2011-02-21 02:33 pm

Put together some bash scripts to determine which repositories we've modified

I just stuck this in my .bashrc file, to let me easily find out which repositories have had commits since the last time it was tagged, so I can put a new tag on it:


codepush_all() {
    #for dir in `find . -type d -depth 1`
    for dir in dw-free dw-nonfree bml s2 vcv js
    do
        echo -e "** looking in $dir\n"
        if [[ -e "$dir/.hg" ]]
        then
            cd $dir
            codepush
            cd ..
        fi
    done
}
codepush() {
    distance=$(( $( hg log -l1 --template '{latesttagdistance}' ) - 1 ))
    if (( "$distance" >= 1 ))
    then
        echo "$distance commits since " $( hg log -l1 --template '{latesttag}' )
        hg log -l $distance --style=changelog
    fi
}