From: Eric Sunshine <sunshine@sunshineco.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 1/4] remote-hg: add more tests
Date: Sun, 4 May 2014 05:40:05 -0400 [thread overview]
Message-ID: <CAPig+cSP+M_HDaif+Xy-x2tuNcjtemmugSQK2V-jKxup-Nizxw@mail.gmail.com> (raw)
In-Reply-To: <1399169814-20201-2-git-send-email-felipe.contreras@gmail.com>
On Sat, May 3, 2014 at 10:16 PM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> Inspired by the tests in gitifyhg.
>
> One test is failing, but that's because of a limitation of
> remote-helpers.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
> contrib/remote-helpers/test-hg.sh | 150 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 150 insertions(+)
>
> diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh
> index 7d90056..33a434d 100755
> --- a/contrib/remote-helpers/test-hg.sh
> +++ b/contrib/remote-helpers/test-hg.sh
> @@ -845,4 +845,154 @@ test_expect_success 'clone remote with generic null bookmark, then push to the b
> )
> '
>
> +test_expect_success 'notes' '
> + test_when_finished "rm -rf hgrepo gitrepo" &&
> +
> + (
> + hg init hgrepo &&
> + cd hgrepo &&
> + echo one > content &&
> + hg add content &&
> + hg commit -m one &&
> + echo two > content &&
> + hg commit -m two
> + ) &&
> +
> + git clone "hg::hgrepo" gitrepo &&
> + hg -R hgrepo log --template "{node}\n\n" > expected &&
> + git --git-dir=gitrepo/.git log --pretty="tformat:%N" --notes=hg > actual &&
> + test_cmp expected actual
> +'
> +
> +test_expect_failure 'push updates notes' '
> + test_when_finished "rm -rf hgrepo gitrepo" &&
> +
> + (
> + hg init hgrepo &&
> + cd hgrepo &&
> + echo one > content &&
> + hg add content &&
> + hg commit -m one
> + ) &&
> +
> + git clone "hg::hgrepo" gitrepo &&
> +
> + (
> + cd gitrepo &&
> + echo two > content &&
> + git commit -a -m two
> + git push
> + ) &&
> +
> + hg -R hgrepo log --template "{node}\n\n" > expected &&
> + git --git-dir=gitrepo/.git log --pretty="tformat:%N" --notes=hg > actual &&
> + test_cmp expected actual
> +'
> +
> +test_expect_success 'pull tags' '
> + test_when_finished "rm -rf hgrepo gitrepo" &&
> +
> + (
> + hg init hgrepo &&
> + cd hgrepo &&
> + echo one > content &&
> + hg add content &&
> + hg commit -m one
> + ) &&
> +
> + git clone "hg::hgrepo" gitrepo &&
> +
> + (cd hgrepo && hg tag v1.0) &&
> + (cd gitrepo && git pull) &&
> +
> + echo "v1.0" > expected &&
> + git --git-dir=gitrepo/.git tag > actual &&
> + test_cmp expected actual
> +'
> +
> +test_expect_success 'push merged named branch' '
> + test_when_finished "rm -rf hgrepo gitrepo" &&
> +
> + (
> + hg init hgrepo &&
> + cd hgrepo &&
> + echo one > content &&
> + hg add content &&
> + hg commit -m one &&
> + hg branch feature &&
> + echo two > content &&
> + hg commit -m two &&
> + hg update default &&
> + echo three > content &&
> + hg commit -m three
> + ) &&
> +
> + (
> + git clone "hg::hgrepo" gitrepo &&
> + cd gitrepo &&
> + git merge -m Merge -Xtheirs origin/branches/feature &&
> + git push
> + ) &&
> +
> + cat > expected <<-EOF
Broken &&-chain.
> + Merge
> + three
> + two
> + one
> + EOF
> + hg -R hgrepo log --template "{desc}\n" > actual &&
> + test_cmp expected actual
> +'
> +
> +test_expect_success 'light tag sets author' '
> + test_when_finished "rm -rf hgrepo gitrepo" &&
> +
> + (
> + hg init hgrepo &&
> + cd hgrepo &&
> + echo one > content &&
> + hg add content &&
> + hg commit -m one
> + ) &&
> +
> + (
> + git clone "hg::hgrepo" gitrepo &&
> + cd gitrepo &&
> + git tag v1.0 &&
> + git push --tags
> + ) &&
> +
> + echo "C O Mitter <committer@example.com>" > expected &&
> + hg -R hgrepo log --template "{author}\n" -r tip > actual &&
> + test_cmp expected actual
> +'
> +
> +test_expect_success 'push tag different branch' '
> + test_when_finished "rm -rf hgrepo gitrepo" &&
> +
> + (
> + hg init hgrepo &&
> + cd hgrepo &&
> + echo one > content &&
> + hg add content &&
> + hg commit -m one
> + hg branch feature &&
> + echo two > content &&
> + hg commit -m two
> + ) &&
> +
> + (
> + git clone "hg::hgrepo" gitrepo &&
> + cd gitrepo &&
> + git branch &&
> + git checkout branches/feature &&
> + git tag v1.0 &&
> + git push --tags
> + ) &&
> +
> + echo feature > expected &&
> + hg -R hgrepo log --template="{branch}\n" -r tip > actual &&
> + test_cmp expected actual
> +'
> +
> test_done
> --
> 1.9.2+fc1.20.g204a630
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-05-04 9:40 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-04 2:16 [PATCH 0/4] remote-hg: more improvements Felipe Contreras
2014-05-04 2:16 ` [PATCH 1/4] remote-hg: add more tests Felipe Contreras
2014-05-04 9:40 ` Eric Sunshine [this message]
2014-05-04 2:16 ` [PATCH 2/4] t: remote-hg: add file operation tests Felipe Contreras
2014-05-04 2:16 ` [PATCH 3/4] t: remote-hg: trivial cleanups and fixes Felipe Contreras
2014-05-04 2:16 ` [PATCH 4/4] remote-hg: add support for hg v3.0 Felipe Contreras
2014-05-07 18:12 ` [PATCH 0/4] remote-hg: more improvements Junio C Hamano
2014-05-07 19:01 ` Felipe Contreras
2014-05-07 20:28 ` Junio C Hamano
2014-05-07 20:37 ` Felipe Contreras
2014-05-07 23:59 ` Junio C Hamano
2014-05-08 1:09 ` Felipe Contreras
2014-05-08 1:34 ` James Denholm
2014-05-08 20:15 ` Felipe Contreras
2014-05-11 19:33 ` Philippe Vaucher
2014-05-12 12:19 ` Philippe Vaucher
2014-05-12 19:50 ` Junio C Hamano
2014-05-12 20:19 ` Felipe Contreras
2014-05-12 20:40 ` Junio C Hamano
2014-05-12 22:21 ` Felipe Contreras
2014-05-14 9:12 ` Philippe Vaucher
2014-05-14 9:30 ` David Kastrup
2014-05-14 9:36 ` Philippe Vaucher
2014-05-14 9:55 ` David Kastrup
2014-05-14 12:11 ` Philippe Vaucher
2014-05-14 12:50 ` David Kastrup
2014-05-14 13:13 ` Philippe Vaucher
2014-05-14 13:51 ` David Kastrup
2014-05-14 16:06 ` Philippe Vaucher
2014-05-14 20:19 ` Felipe Contreras
2014-05-14 20:58 ` David Kastrup
2014-05-14 21:39 ` Felipe Contreras
2014-05-14 22:12 ` David Kastrup
2014-05-14 22:30 ` Felipe Contreras
2014-05-15 6:03 ` David Kastrup
2014-05-14 22:24 ` Junio C Hamano
2014-05-14 22:30 ` David Kastrup
2014-05-14 22:34 ` Junio C Hamano
2014-05-08 0:00 ` Junio C Hamano
2014-05-08 1:36 ` Felipe Contreras
2014-05-08 18:36 ` Junio C Hamano
2014-05-08 19:56 ` Felipe Contreras
2014-05-08 22:22 ` Junio C Hamano
2014-05-08 22:42 ` Felipe Contreras
2014-05-08 23:06 ` Junio C Hamano
2014-05-08 23:39 ` Felipe Contreras
2014-05-09 0:23 ` Felipe Contreras
2014-05-09 17:16 ` Junio C Hamano
2014-05-09 17:59 ` Felipe Contreras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPig+cSP+M_HDaif+Xy-x2tuNcjtemmugSQK2V-jKxup-Nizxw@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).