# HG changeset patch # User Mikael Berthe # Date 1342310291 -7200 # Node ID ed98b8ea395d8afc586b8c7145febb2d39a6cd78 # Parent d7843f267d7987fc3ca193fe182662f133222346 Improve hg_pull_and_see (accept hg pull argument) diff -r d7843f267d79 -r ed98b8ea395d zshrc.d/30-functions-hg.zrc --- a/zshrc.d/30-functions-hg.zrc Sun Jul 15 01:37:40 2012 +0200 +++ b/zshrc.d/30-functions-hg.zrc Sun Jul 15 01:58:11 2012 +0200 @@ -1,18 +1,20 @@ +# Use the same arguments as hg pull +# e.g. "hg_pull_and_see -u" function hg_pull_and_see() { if ! $HG_ROOT_CMD > /dev/null; then print "Not a Mercurial repository!" return -1 fi - local i=$(hg id --num) - local i_h=$(hg id --id) - hg pull -u - local j=$(hg id --num) - local j_h=$(hg id --id) + local i=$(hg id -r tip --num) + local i_h=$(hg id -r tip --id) + hg pull $@ + local j=$(hg id -r tip --num) + local j_h=$(hg id -r tip --id) if (( $i != $j ));then - print "\nChangelog from ${i_h} to ${j_h}..." hg log --quiet --style=changelog -r "not ancestors($i)" + print "\nPulled from ${i_h} to ${j_h}." fi }