zshrc.d/30-functions-hg.zrc
author Mikael Berthe <mikael@lilotux.net>
Sat, 14 Jul 2012 23:13:35 +0200
changeset 6 7671e95ab8b0
parent 4 ca432c482cc9
child 9 d7843f267d79
permissions -rw-r--r--
Change my local mkcd alias into a function I was grepping for my mkcd alias in the wrong terminal and found another version, which turned out to be a good thing as Frank's implementation looks better :) https://dev.0x50.de/projects/ftzsh/repository/revisions/master/entry/functions/mkcd


function hg_pull_and_see() {
    if ! $HG_ROOT_CMD > /dev/null; then
        print "Not a Mercurial repository!"
        return -1
    fi

    local i=$(hg id -i)
    hg pull -u
    local j=$(hg id -i)

    if [[ $i != $j ]];then
        hg log --quiet -r${i}:tip --style=changelog
    fi
}