Skip to content

Commit 9a57988

Browse files
apelissegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 20c4b59 commit 9a57988

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

contrib/remote-helpers/test-hg-bidi.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ hg_push () {
5050
}
5151

5252
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
5455
}
5556

5657
setup () {
@@ -62,6 +63,8 @@ setup () {
6263
echo "commit = -d \"0 0\""
6364
echo "debugrawcommit = -d \"0 0\""
6465
echo "tag = -d \"0 0\""
66+
echo "[extensions]"
67+
echo "graphlog ="
6568
) >> "$HOME"/.hgrc &&
6669
git config --global remote-hg.hg-git-compat true
6770

contrib/remote-helpers/test-hg-hg-git.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ hg_push_hg () {
7878
}
7979

8080
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
8283
}
8384

8485
git_log () {
@@ -97,6 +98,7 @@ setup () {
9798
echo "[extensions]"
9899
echo "hgext.bookmarks ="
99100
echo "hggit ="
101+
echo "graphlog ="
100102
) >> "$HOME"/.hgrc &&
101103
git config --global receive.denycurrentbranch warn
102104
git config --global remote-hg.hg-git-compat true

0 commit comments

Comments
 (0)