zshrc.d/30-functions-hg.zrc
changeset 42 2431e6a9344a
parent 25 709f9a3b120e
equal deleted inserted replaced
41:be88f546392c 42:2431e6a9344a
     5     if ! $HG_ROOT_CMD > /dev/null; then
     5     if ! $HG_ROOT_CMD > /dev/null; then
     6         print "Not a Mercurial repository!"
     6         print "Not a Mercurial repository!"
     7         return -1
     7         return -1
     8     fi
     8     fi
     9 
     9 
    10     local i=$(hg id -r tip --num)
    10     integer i j
       
    11     i=$(hg id -r tip --num)
    11     local i_h=$(hg id -r tip --id)
    12     local i_h=$(hg id -r tip --id)
    12     hg pull $@
    13     hg pull $@
    13     local j=$(hg id -r tip --num)
    14     j=$(hg id -r tip --num)
    14     local j_h=$(hg id -r tip --id)
    15     local j_h=$(hg id -r tip --id)
    15 
    16 
    16     if (( $i != $j ));then
    17     if (( $i != $j ));then
    17         hg log --quiet --style=changelog -r "$i:$j and not $i"
    18         hg log --quiet --style=changelog -r "$i:$j and not $i"
    18         print "\nPulled from ${i_h} to ${j_h}."
    19         print "\nPulled from ${i_h} to ${j_h}."