remote-hg: activate graphlog extension for hg_log()

The hg_log() test helper uses the "--graph" parameter that is implemented by the GraphLog extension. If the extension is not activated by the user, the parameter is not available. Activate the extension in setup(). Also changes the way we grep the output in hg_log(). The pipe operator can hide the return code of hg command. As a matter of fact, if log fails because it doesn't know about "--graph", it doesn't report any failure and let's you think everything worked. Signed-off-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Antoine Pelisse committed Apr 11, 2013 at 07:23 UTC 9a57988b3fac79e0458515a555392d00b759cf4c
2 files changed +7 -2
contrib/remote-helpers/test-hg-bidi.sh
+4 -1
@@ -50,7 +50,8 @@ hg_push () {
50 }
51
52 hg_log () {
53 - hg -R $1 log --graph --debug | grep -v 'tag: *default/'
53 + hg -R $1 log --graph --debug >log &&
54 + grep -v 'tag: *default/' log
55 }
56
57 setup () {
@@ -62,6 +63,8 @@ setup () {
63 echo "commit = -d \"0 0\""
64 echo "debugrawcommit = -d \"0 0\""
65 echo "tag = -d \"0 0\""
66 + echo "[extensions]"
67 + echo "graphlog ="
68 ) >> "$HOME"/.hgrc &&
69 git config --global remote-hg.hg-git-compat true
70
contrib/remote-helpers/test-hg-hg-git.sh
+3 -1
@@ -78,7 +78,8 @@ hg_push_hg () {
78 }
79
80 hg_log () {
81 - hg -R $1 log --graph --debug | grep -v 'tag: *default/'
81 + hg -R $1 log --graph --debug >log &&
82 + grep -v 'tag: *default/' log
83 }
84
85 git_log () {
@@ -97,6 +98,7 @@ setup () {
98 echo "[extensions]"
99 echo "hgext.bookmarks ="
100 echo "hggit ="
101 + echo "graphlog ="
102 ) >> "$HOME"/.hgrc &&
103 git config --global receive.denycurrentbranch warn
104 git config --global remote-hg.hg-git-compat true