Add hg_pull_and_see
authorMikael Berthe <mikael@lilotux.net>
Sat, 14 Jul 2012 22:50:44 +0200
changeset 4 ca432c482cc9
parent 3 f2f4db4d9c34
child 5 5dbc9ebf690c
Add hg_pull_and_see
zshrc.d/30-functions-hg.zrc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zshrc.d/30-functions-hg.zrc	Sat Jul 14 22:50:44 2012 +0200
@@ -0,0 +1,15 @@
+
+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
+}