Improve hg_pull_and_see
authorMikael Berthe <mikael@lilotux.net>
Sun, 15 Jul 2012 01:37:40 +0200
changeset 9 d7843f267d79
parent 8 3f68f355bf1a
child 10 ed98b8ea395d
Improve hg_pull_and_see
zshrc.d/30-functions-hg.zrc
--- a/zshrc.d/30-functions-hg.zrc	Sun Jul 15 01:17:55 2012 +0200
+++ b/zshrc.d/30-functions-hg.zrc	Sun Jul 15 01:37:40 2012 +0200
@@ -5,11 +5,14 @@
         return -1
     fi
 
-    local i=$(hg id -i)
+    local i=$(hg id --num)
+    local i_h=$(hg id --id)
     hg pull -u
-    local j=$(hg id -i)
+    local j=$(hg id --num)
+    local j_h=$(hg id --id)
 
-    if [[ $i != $j ]];then
-        hg log --quiet -r${i}:tip --style=changelog
+    if (( $i != $j ));then
+        print "\nChangelog from ${i_h} to ${j_h}..."
+        hg log --quiet --style=changelog -r "not ancestors($i)"
     fi
 }