remote-hg: add check_bookmark() test helper

And check in a more proper way. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed May 24, 2013 at 21:29 UTC b082b4f94ff1a82ce42223f7a46c9423e99c48e9
1 file changed +7 -1
contrib/remote-helpers/test-hg.sh
+7 -1
@@ -32,6 +32,12 @@ check_branch () {
32 test_cmp expected actual
33 }
34
35 +check_bookmark () {
36 + echo $3 > expected &&
37 + hg -R $1 log -r "bookmark('$2')" --template '{desc}\n' > actual &&
38 + test_cmp expected actual
39 +}
40 +
41 setup () {
42 (
43 echo "[ui]"
@@ -108,7 +114,7 @@ test_expect_success 'update bookmark' '
114 git push --quiet
115 ) &&
116
111 - hg -R hgrepo bookmarks | egrep "devel[ ]+3:"
117 + check_bookmark hgrepo devel devel
118 '
119
120 # cleanup previous stuff