{"thread":{"id":"35118","subject":"[PATCH v2 0/5] remote-helpers: test reorganization","startedAt":"2013-10-12T07:04:20Z","lastAt":"2013-10-12T07:04:24Z","messageCount":5,"participants":["Felipe Contreras"],"isPatch":true,"patchVersion":2,"patchTotal":5},"messages":[{"id":"228786","messageId":"1381561465-20147-1-git-send-email-felipe.contreras@gmail.com","threadId":"35118","inReplyTo":null,"subject":"[PATCH v2 0/5] remote-helpers: test reorganization","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-10-12T07:04:20Z","receivedAt":"2013-10-12T07:04:20Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Now we use PYTHON_PATH properly, and also we are able to do:\n\n  make -C contrib/remote-helpers install\n\nFelipe Contreras (5):\n  remote-helpers: generate scripts\n  build: fix installation of scripts\n  remote-helpers: rename tests\n  remote-helpers: allow direct test execution\n  remote-helpers: add exec-path links\n\n Makefile                                 |   10 +-\n contrib/remote-helpers/.gitignore        |    2 +\n contrib/remote-helpers/Makefile          |   27 +-\n contrib/remote-helpers/git-remote-bzr    |  960 -----------------------\n contrib/remote-helpers/git-remote-bzr.py |  960 +++++++++++++++++++++++\n contrib/remote-helpers/git-remote-hg     | 1220 ------------------------------\n contrib/remote-helpers/git-remote-hg.py  | 1220 ++++++++++++++++++++++++++++++\n contrib/remote-helpers/test-bzr.sh       |  361 ---------\n contrib/remote-helpers/test-bzr.t        |  362 +++++++++\n contrib/remote-helpers/test-hg-bidi.sh   |  240 ------\n contrib/remote-helpers/test-hg-bidi.t    |  241 ++++++\n contrib/remote-helpers/test-hg-hg-git.sh |  527 -------------\n contrib/remote-helpers/test-hg-hg-git.t  |  528 +++++++++++++\n contrib/remote-helpers/test-hg.sh        |  692 -----------------\n contrib/remote-helpers/test-hg.t         |  693 +++++++++++++++++\n 15 files changed, 4034 insertions(+), 4009 deletions(-)\n create mode 100644 contrib/remote-helpers/.gitignore\n delete mode 100755 contrib/remote-helpers/git-remote-bzr\n create mode 100755 contrib/remote-helpers/git-remote-bzr.py\n delete mode 100755 contrib/remote-helpers/git-remote-hg\n create mode 100755 contrib/remote-helpers/git-remote-hg.py\n delete mode 100755 contrib/remote-helpers/test-bzr.sh\n create mode 100755 contrib/remote-helpers/test-bzr.t\n delete mode 100755 contrib/remote-helpers/test-hg-bidi.sh\n create mode 100755 contrib/remote-helpers/test-hg-bidi.t\n delete mode 100755 contrib/remote-helpers/test-hg-hg-git.sh\n create mode 100755 contrib/remote-helpers/test-hg-hg-git.t\n delete mode 100755 contrib/remote-helpers/test-hg.sh\n create mode 100755 contrib/remote-helpers/test-hg.t\n\n-- \n1.8.4-fc\n"},{"id":"228789","messageId":"1381561465-20147-2-git-send-email-felipe.contreras@gmail.com","threadId":"35118","inReplyTo":"1381561465-20147-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 5/5] remote-helpers: add exec-path links","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-10-12T07:04:21Z","receivedAt":"2013-10-12T07:04:21Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"This way we don't have to modify the PATH ourselves and it's easier to\ntest without 'make'.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/Makefile | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile\nindex 8799c77..2e14b65 100644\n--- a/contrib/remote-helpers/Makefile\n+++ b/contrib/remote-helpers/Makefile\n@@ -1,15 +1,15 @@\n TESTS := $(wildcard test-*.t)\n SCRIPTS := $(wildcard git-remote-*.py)\n+LINKS := $(addprefix ../../,$(patsubst %.py,%,$(SCRIPTS)))\n \n export T := $(addprefix $(CURDIR)/,$(TESTS))\n export MAKE := $(MAKE) -e\n-export PATH := $(CURDIR):$(PATH)\n export TEST_LINT := test-lint-executable test-lint-shell-syntax\n export TEST_DIRECTORY := $(CURDIR)/../../t\n \n export SCRIPT_PYTHON := $(addprefix $(CURDIR)/,$(SCRIPTS))\n \n-all: $(SCRIPTS)\n+all: $(LINKS)\n \t$(MAKE) -C ../.. build-python-script\n \n install:\n@@ -17,10 +17,14 @@ install:\n \n clean:\n \t$(MAKE) -C ../.. clean-python-script\n+\t$(RM) $(LINKS)\n \n test: all\n \t$(MAKE) -C ../../t $@\n \n+$(LINKS):\n+\tln -sf contrib/remote-helpers/$(notdir $@) ../..\n+\n $(TESTS): all\n \t$(MAKE) -C ../../t $(CURDIR)/$@\n \n-- \n1.8.4-fc\n"},{"id":"228787","messageId":"1381561465-20147-3-git-send-email-felipe.contreras@gmail.com","threadId":"35118","inReplyTo":"1381561465-20147-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 4/5] remote-helpers: allow direct test execution","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-10-12T07:04:22Z","receivedAt":"2013-10-12T07:04:22Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Previously 'make' was the only option, or manually specifying the\n'TEST_DIRECTORY'.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/Makefile         | 1 +\n contrib/remote-helpers/test-bzr.t       | 3 ++-\n contrib/remote-helpers/test-hg-bidi.t   | 3 ++-\n contrib/remote-helpers/test-hg-hg-git.t | 3 ++-\n contrib/remote-helpers/test-hg.t        | 3 ++-\n 5 files changed, 9 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile\nindex 8d5e9be..8799c77 100644\n--- a/contrib/remote-helpers/Makefile\n+++ b/contrib/remote-helpers/Makefile\n@@ -5,6 +5,7 @@ export T := $(addprefix $(CURDIR)/,$(TESTS))\n export MAKE := $(MAKE) -e\n export PATH := $(CURDIR):$(PATH)\n export TEST_LINT := test-lint-executable test-lint-shell-syntax\n+export TEST_DIRECTORY := $(CURDIR)/../../t\n \n export SCRIPT_PYTHON := $(addprefix $(CURDIR)/,$(SCRIPTS))\n \ndiff --git a/contrib/remote-helpers/test-bzr.t b/contrib/remote-helpers/test-bzr.t\nindex 435b280..7ca4a9c 100755\n--- a/contrib/remote-helpers/test-bzr.t\n+++ b/contrib/remote-helpers/test-bzr.t\n@@ -5,7 +5,8 @@\n \n test_description='Test remote-bzr'\n \n-. ./test-lib.sh\n+test -z \"$TEST_DIRECTORY\" && TEST_DIRECTORY=\"$PWD/../../t\"\n+. \"$TEST_DIRECTORY\"/test-lib.sh\n \n if ! test_have_prereq PYTHON; then\n \tskip_all='skipping remote-bzr tests; python not available'\ndiff --git a/contrib/remote-helpers/test-hg-bidi.t b/contrib/remote-helpers/test-hg-bidi.t\nindex 86a3f10..e978932 100755\n--- a/contrib/remote-helpers/test-hg-bidi.t\n+++ b/contrib/remote-helpers/test-hg-bidi.t\n@@ -8,7 +8,8 @@\n \n test_description='Test bidirectionality of remote-hg'\n \n-. ./test-lib.sh\n+test -z \"$TEST_DIRECTORY\" && TEST_DIRECTORY=\"$PWD/../../t\"\n+. \"$TEST_DIRECTORY\"/test-lib.sh\n \n if ! test_have_prereq PYTHON; then\n \tskip_all='skipping remote-hg tests; python not available'\ndiff --git a/contrib/remote-helpers/test-hg-hg-git.t b/contrib/remote-helpers/test-hg-hg-git.t\nindex 0217860..0caa493 100755\n--- a/contrib/remote-helpers/test-hg-hg-git.t\n+++ b/contrib/remote-helpers/test-hg-hg-git.t\n@@ -8,7 +8,8 @@\n \n test_description='Test remote-hg output compared to hg-git'\n \n-. ./test-lib.sh\n+test -z \"$TEST_DIRECTORY\" && TEST_DIRECTORY=\"$PWD/../../t\"\n+. \"$TEST_DIRECTORY\"/test-lib.sh\n \n if ! test_have_prereq PYTHON; then\n \tskip_all='skipping remote-hg tests; python not available'\ndiff --git a/contrib/remote-helpers/test-hg.t b/contrib/remote-helpers/test-hg.t\nindex 30f4ff6..9b6dd95 100755\n--- a/contrib/remote-helpers/test-hg.t\n+++ b/contrib/remote-helpers/test-hg.t\n@@ -8,7 +8,8 @@\n \n test_description='Test remote-hg'\n \n-. ./test-lib.sh\n+test -z \"$TEST_DIRECTORY\" && TEST_DIRECTORY=\"$PWD/../../t\"\n+. \"$TEST_DIRECTORY\"/test-lib.sh\n \n if ! test_have_prereq PYTHON; then\n \tskip_all='skipping remote-hg tests; python not available'\n-- \n1.8.4-fc\n"},{"id":"228790","messageId":"1381561465-20147-4-git-send-email-felipe.contreras@gmail.com","threadId":"35118","inReplyTo":"1381561465-20147-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 3/5] remote-helpers: rename tests","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-10-12T07:04:23Z","receivedAt":"2013-10-12T07:04:23Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"The .t extension is more standard for sharness tests.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/Makefile          |   2 +-\n contrib/remote-helpers/test-bzr.sh       | 361 ----------------\n contrib/remote-helpers/test-bzr.t        | 361 ++++++++++++++++\n contrib/remote-helpers/test-hg-bidi.sh   | 240 -----------\n contrib/remote-helpers/test-hg-bidi.t    | 240 +++++++++++\n contrib/remote-helpers/test-hg-hg-git.sh | 527 -----------------------\n contrib/remote-helpers/test-hg-hg-git.t  | 527 +++++++++++++++++++++++\n contrib/remote-helpers/test-hg.sh        | 692 -------------------------------\n contrib/remote-helpers/test-hg.t         | 692 +++++++++++++++++++++++++++++++\n 9 files changed, 1821 insertions(+), 1821 deletions(-)\n delete mode 100755 contrib/remote-helpers/test-bzr.sh\n create mode 100755 contrib/remote-helpers/test-bzr.t\n delete mode 100755 contrib/remote-helpers/test-hg-bidi.sh\n create mode 100755 contrib/remote-helpers/test-hg-bidi.t\n delete mode 100755 contrib/remote-helpers/test-hg-hg-git.sh\n create mode 100755 contrib/remote-helpers/test-hg-hg-git.t\n delete mode 100755 contrib/remote-helpers/test-hg.sh\n create mode 100755 contrib/remote-helpers/test-hg.t\n\ndiff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile\nindex 973c578..8d5e9be 100644\n--- a/contrib/remote-helpers/Makefile\n+++ b/contrib/remote-helpers/Makefile\n@@ -1,4 +1,4 @@\n-TESTS := $(wildcard test*.sh)\n+TESTS := $(wildcard test-*.t)\n SCRIPTS := $(wildcard git-remote-*.py)\n \n export T := $(addprefix $(CURDIR)/,$(TESTS))\ndiff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh\ndeleted file mode 100755\nindex 435b280..0000000\n--- a/contrib/remote-helpers/test-bzr.sh\n+++ /dev/null\n@@ -1,361 +0,0 @@\n-#!/bin/sh\n-#\n-# Copyright (c) 2012 Felipe Contreras\n-#\n-\n-test_description='Test remote-bzr'\n-\n-. ./test-lib.sh\n-\n-if ! test_have_prereq PYTHON; then\n-\tskip_all='skipping remote-bzr tests; python not available'\n-\ttest_done\n-fi\n-\n-if ! \"$PYTHON_PATH\" -c 'import bzrlib'; then\n-\tskip_all='skipping remote-bzr tests; bzr not available'\n-\ttest_done\n-fi\n-\n-check () {\n-\techo $3 > expected &&\n-\tgit --git-dir=$1/.git log --format='%s' -1 $2 > actual\n-\ttest_cmp expected actual\n-}\n-\n-bzr whoami \"A U Thor <author@example.com>\"\n-\n-test_expect_success 'cloning' '\n-\t(\n-\tbzr init bzrrepo &&\n-\tcd bzrrepo &&\n-\techo one > content &&\n-\tbzr add content &&\n-\tbzr commit -m one\n-\t) &&\n-\n-\tgit clone \"bzr::bzrrepo\" gitrepo &&\n-\tcheck gitrepo HEAD one\n-'\n-\n-test_expect_success 'pulling' '\n-\t(\n-\tcd bzrrepo &&\n-\techo two > content &&\n-\tbzr commit -m two\n-\t) &&\n-\n-\t(cd gitrepo && git pull) &&\n-\n-\tcheck gitrepo HEAD two\n-'\n-\n-test_expect_success 'pushing' '\n-\t(\n-\tcd gitrepo &&\n-\techo three > content &&\n-\tgit commit -a -m three &&\n-\tgit push\n-\t) &&\n-\n-\techo three > expected &&\n-\tcat bzrrepo/content > actual &&\n-\ttest_cmp expected actual\n-'\n-\n-test_expect_success 'roundtrip' '\n-\t(\n-\tcd gitrepo &&\n-\tgit pull &&\n-\tgit log --format=\"%s\" -1 origin/master > actual\n-\t) &&\n-\techo three > expected &&\n-\ttest_cmp expected actual &&\n-\n-\t(cd gitrepo && git push && git pull) &&\n-\n-\t(\n-\tcd bzrrepo &&\n-\techo four > content &&\n-\tbzr commit -m four\n-\t) &&\n-\n-\t(cd gitrepo && git pull && git push) &&\n-\n-\tcheck gitrepo HEAD four &&\n-\n-\t(\n-\tcd gitrepo &&\n-\techo five > content &&\n-\tgit commit -a -m five &&\n-\tgit push && git pull\n-\t) &&\n-\n-\t(cd bzrrepo && bzr revert) &&\n-\n-\techo five > expected &&\n-\tcat bzrrepo/content > actual &&\n-\ttest_cmp expected actual\n-'\n-\n-cat > expected <<EOF\n-100644 blob 54f9d6da5c91d556e6b54340b1327573073030af\tcontent\n-100755 blob 68769579c3eaadbe555379b9c3538e6628bae1eb\texecutable\n-120000 blob 6b584e8ece562ebffc15d38808cd6b98fc3d97ea\tlink\n-EOF\n-\n-test_expect_success 'special modes' '\n-\t(\n-\tcd bzrrepo &&\n-\techo exec > executable\n-\tchmod +x executable &&\n-\tbzr add executable\n-\tbzr commit -m exec &&\n-\tln -s content link\n-\tbzr add link\n-\tbzr commit -m link &&\n-\tmkdir dir &&\n-\tbzr add dir &&\n-\tbzr commit -m dir\n-\t) &&\n-\n-\t(\n-\tcd gitrepo &&\n-\tgit pull\n-\tgit ls-tree HEAD > ../actual\n-\t) &&\n-\n-\ttest_cmp expected actual &&\n-\n-\t(\n-\tcd gitrepo &&\n-\tgit cat-file -p HEAD:link > ../actual\n-\t) &&\n-\n-\tprintf content > expected &&\n-\ttest_cmp expected actual\n-'\n-\n-cat > expected <<EOF\n-100644 blob 54f9d6da5c91d556e6b54340b1327573073030af\tcontent\n-100755 blob 68769579c3eaadbe555379b9c3538e6628bae1eb\texecutable\n-120000 blob 6b584e8ece562ebffc15d38808cd6b98fc3d97ea\tlink\n-040000 tree 35c0caa46693cef62247ac89a680f0c5ce32b37b\tmovedir-new\n-EOF\n-\n-test_expect_success 'moving directory' '\n-\t(\n-\tcd bzrrepo &&\n-\tmkdir movedir &&\n-\techo one > movedir/one &&\n-\techo two > movedir/two &&\n-\tbzr add movedir &&\n-\tbzr commit -m movedir &&\n-\tbzr mv movedir movedir-new &&\n-\tbzr commit -m movedir-new\n-\t) &&\n-\n-\t(\n-\tcd gitrepo &&\n-\tgit pull &&\n-\tgit ls-tree HEAD > ../actual\n-\t) &&\n-\n-\ttest_cmp expected actual\n-'\n-\n-test_expect_success 'different authors' '\n-\t(\n-\tcd bzrrepo &&\n-\techo john >> content &&\n-\tbzr commit -m john \\\n-\t  --author \"Jane Rey <jrey@example.com>\" \\\n-\t  --author \"John Doe <jdoe@example.com>\"\n-\t) &&\n-\n-\t(\n-\tcd gitrepo &&\n-\tgit pull &&\n-\tgit show --format=\"%an <%ae>, %cn <%ce>\" --quiet > ../actual\n-\t) &&\n-\n-\techo \"Jane Rey <jrey@example.com>, A U Thor <author@example.com>\" > expected &&\n-\ttest_cmp expected actual\n-'\n-\n-# cleanup previous stuff\n-rm -rf bzrrepo gitrepo\n-\n-test_expect_success 'fetch utf-8 filenames' '\n-\ttest_when_finished \"rm -rf bzrrepo gitrepo && LC_ALL=C\" &&\n-\n-\tLC_ALL=en_US.UTF-8\n-\texport LC_ALL\n-\n-\t(\n-\tbzr init bzrrepo &&\n-\tcd bzrrepo &&\n-\n-\techo test >> \"ærø\" &&\n-\tbzr add \"ærø\" &&\n-\techo test >> \"ø~?\" &&\n-\tbzr add \"ø~?\" &&\n-\tbzr commit -m add-utf-8 &&\n-\techo test >> \"ærø\" &&\n-\tbzr commit -m test-utf-8 &&\n-\tbzr rm \"ø~?\" &&\n-\tbzr mv \"ærø\" \"ø~?\" &&\n-\tbzr commit -m bzr-mv-utf-8\n-\t) &&\n-\n-\t(\n-\tgit clone \"bzr::bzrrepo\" gitrepo &&\n-\tcd gitrepo &&\n-\tgit -c core.quotepath=false ls-files > ../actual\n-\t) &&\n-\techo \"ø~?\" > expected &&\n-\ttest_cmp expected actual\n-'\n-\n-test_expect_success 'push utf-8 filenames' '\n-\ttest_when_finished \"rm -rf bzrrepo gitrepo && LC_ALL=C\" &&\n-\n-\tmkdir -p tmp && cd tmp &&\n-\n-\tLC_ALL=en_US.UTF-8\n-\texport LC_ALL\n-\n-\t(\n-\tbzr init bzrrepo &&\n-\tcd bzrrepo &&\n-\n-\techo one >> content &&\n-\tbzr add content &&\n-\tbzr commit -m one\n-\t) &&\n-\n-\t(\n-\tgit clone \"bzr::bzrrepo\" gitrepo &&\n-\tcd gitrepo &&\n-\n-\techo test >> \"ærø\" &&\n-\tgit add \"ærø\" &&\n-\tgit commit -m utf-8 &&\n-\n-\tgit push\n-\t) &&\n-\n-\t(cd bzrrepo && bzr ls > ../actual) &&\n-\tprintf \"content\\nærø\\n\" > expected &&\n-\ttest_cmp expected actual\n-'\n-\n-test_expect_success 'pushing a merge' '\n-\ttest_when_finished \"rm -rf bzrrepo gitrepo\" &&\n-\n-\t(\n-\tbzr init bzrrepo &&\n-\tcd bzrrepo &&\n-\techo one > content &&\n-\tbzr add content &&\n-\tbzr commit -m one\n-\t) &&\n-\n-\tgit clone \"bzr::bzrrepo\" gitrepo &&\n-\n-\t(\n-\tcd bzrrepo &&\n-\techo two > content &&\n-\tbzr commit -m two\n-\t) &&\n-\n-\t(\n-\tcd gitrepo &&\n-\techo three > content &&\n-\tgit commit -a -m three &&\n-\tgit fetch &&\n-\tgit merge origin/master || true &&\n-\techo three > content &&\n-\tgit commit -a --no-edit &&\n-\tgit push\n-\t) &&\n-\n-\techo three > expected &&\n-\tcat bzrrepo/content > actual &&\n-\ttest_cmp expected actual\n-'\n-\n-cat > expected <<EOF\n-origin/HEAD\n-origin/branch\n-origin/trunk\n-EOF\n-\n-test_expect_success 'proper bzr repo' '\n-\ttest_when_finished \"rm -rf bzrrepo gitrepo\" &&\n-\n-\tbzr init-repo bzrrepo &&\n-\n-\t(\n-\tbzr init bzrrepo/trunk &&\n-\tcd bzrrepo/trunk &&\n-\techo one >> content &&\n-\tbzr add content &&\n-\tbzr commit -m one\n-\t) &&\n-\n-\t(\n-\tbzr branch bzrrepo/trunk bzrrepo/branch &&\n-\tcd bzrrepo/branch &&\n-\techo two >> content &&\n-\tbzr commit -m one\n-\t) &&\n-\n-\t(\n-\tgit clone \"bzr::bzrrepo\" gitrepo &&\n-\tcd gitrepo &&\n-\tgit for-each-ref --format \"%(refname:short)\" refs/remotes/origin > ../actual\n-\t) &&\n-\n-\ttest_cmp expected actual\n-'\n-\n-test_expect_success 'strip' '\n-\ttest_when_finished \"rm -rf bzrrepo gitrepo\" &&\n-\n-\t(\n-\tbzr init bzrrepo &&\n-\tcd bzrrepo &&\n-\n-\techo one >> content &&\n-\tbzr add content &&\n-\tbzr commit -m one &&\n-\n-\techo two >> content &&\n-\tbzr commit -m two\n-\t) &&\n-\n-\tgit clone \"bzr::bzrrepo\" gitrepo &&\n-\n-\t(\n-\tcd bzrrepo &&\n-\tbzr uncommit --force &&\n-\n-\techo three >> content &&\n-\tbzr commit -m three &&\n-\n-\techo four >> content &&\n-\tbzr commit -m four &&\n-\tbzr log --line | sed -e \"s/^[0-9][0-9]*: //\" > ../expected\n-\t) &&\n-\n-\t(\n-\tcd gitrepo &&\n-\tgit fetch &&\n-\tgit log --format=\"%an %ad %s\" --date=short origin/master > ../actual\n-\t) &&\n-\n-\ttest_cmp expected actual\n-'\n-\n-test_done\ndiff --git a/contrib/remote-helpers/test-bzr.t b/contrib/remote-helpers/test-bzr.t\nnew file mode 100755\nindex 0000000..435b280\n--- /dev/null\n+++ b/contrib/remote-helpers/test-bzr.t\n@@ -0,0 +1,361 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2012 Felipe Contreras\n+#\n+\n+test_description='Test remote-bzr'\n+\n+. ./test-lib.sh\n+\n+if ! test_have_prereq PYTHON; then\n+\tskip_all='skipping remote-bzr tests; python not available'\n+\ttest_done\n+fi\n+\n+if ! \"$PYTHON_PATH\" -c 'import bzrlib'; then\n+\tskip_all='skipping remote-bzr tests; bzr not available'\n+\ttest_done\n+fi\n+\n+check () {\n+\techo $3 > expected &&\n+\tgit --git-dir=$1/.git log --format='%s' -1 $2 > actual\n+\ttest_cmp expected actual\n+}\n+\n+bzr whoami \"A U Thor <author@example.com>\"\n+\n+test_expect_success 'cloning' '\n+\t(\n+\tbzr init bzrrepo &&\n+\tcd bzrrepo &&\n+\techo one > content &&\n+\tbzr add content &&\n+\tbzr commit -m one\n+\t) &&\n+\n+\tgit clone \"bzr::bzrrepo\" gitrepo &&\n+\tcheck gitrepo HEAD one\n+'\n+\n+test_expect_success 'pulling' '\n+\t(\n+\tcd bzrrepo &&\n+\techo two > content &&\n+\tbzr commit -m two\n+\t) &&\n+\n+\t(cd gitrepo && git pull) &&\n+\n+\tcheck gitrepo HEAD two\n+'\n+\n+test_expect_success 'pushing' '\n+\t(\n+\tcd gitrepo &&\n+\techo three > content &&\n+\tgit commit -a -m three &&\n+\tgit push\n+\t) &&\n+\n+\techo three > expected &&\n+\tcat bzrrepo/content > actual &&\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'roundtrip' '\n+\t(\n+\tcd gitrepo &&\n+\tgit pull &&\n+\tgit log --format=\"%s\" -1 origin/master > actual\n+\t) &&\n+\techo three > expected &&\n+\ttest_cmp expected actual &&\n+\n+\t(cd gitrepo && git push && git pull) &&\n+\n+\t(\n+\tcd bzrrepo &&\n+\techo four > content &&\n+\tbzr commit -m four\n+\t) &&\n+\n+\t(cd gitrepo && git pull && git push) &&\n+\n+\tcheck gitrepo HEAD four &&\n+\n+\t(\n+\tcd gitrepo &&\n+\techo five > content &&\n+\tgit commit -a -m five &&\n+\tgit push && git pull\n+\t) &&\n+\n+\t(cd bzrrepo && bzr revert) &&\n+\n+\techo five > expected &&\n+\tcat bzrrepo/content > actual &&\n+\ttest_cmp expected actual\n+'\n+\n+cat > expected <<EOF\n+100644 blob 54f9d6da5c91d556e6b54340b1327573073030af\tcontent\n+100755 blob 68769579c3eaadbe555379b9c3538e6628bae1eb\texecutable\n+120000 blob 6b584e8ece562ebffc15d38808cd6b98fc3d97ea\tlink\n+EOF\n+\n+test_expect_success 'special modes' '\n+\t(\n+\tcd bzrrepo &&\n+\techo exec > executable\n+\tchmod +x executable &&\n+\tbzr add executable\n+\tbzr commit -m exec &&\n+\tln -s content link\n+\tbzr add link\n+\tbzr commit -m link &&\n+\tmkdir dir &&\n+\tbzr add dir &&\n+\tbzr commit -m dir\n+\t) &&\n+\n+\t(\n+\tcd gitrepo &&\n+\tgit pull\n+\tgit ls-tree HEAD > ../actual\n+\t) &&\n+\n+\ttest_cmp expected actual &&\n+\n+\t(\n+\tcd gitrepo &&\n+\tgit cat-file -p HEAD:link > ../actual\n+\t) &&\n+\n+\tprintf content > expected &&\n+\ttest_cmp expected actual\n+'\n+\n+cat > expected <<EOF\n+100644 blob 54f9d6da5c91d556e6b54340b1327573073030af\tcontent\n+100755 blob 68769579c3eaadbe555379b9c3538e6628bae1eb\texecutable\n+120000 blob 6b584e8ece562ebffc15d38808cd6b98fc3d97ea\tlink\n+040000 tree 35c0caa46693cef62247ac89a680f0c5ce32b37b\tmovedir-new\n+EOF\n+\n+test_expect_success 'moving directory' '\n+\t(\n+\tcd bzrrepo &&\n+\tmkdir movedir &&\n+\techo one > movedir/one &&\n+\techo two > movedir/two &&\n+\tbzr add movedir &&\n+\tbzr commit -m movedir &&\n+\tbzr mv movedir movedir-new &&\n+\tbzr commit -m movedir-new\n+\t) &&\n+\n+\t(\n+\tcd gitrepo &&\n+\tgit pull &&\n+\tgit ls-tree HEAD > ../actual\n+\t) &&\n+\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'different authors' '\n+\t(\n+\tcd bzrrepo &&\n+\techo john >> content &&\n+\tbzr commit -m john \\\n+\t  --author \"Jane Rey <jrey@example.com>\" \\\n+\t  --author \"John Doe <jdoe@example.com>\"\n+\t) &&\n+\n+\t(\n+\tcd gitrepo &&\n+\tgit pull &&\n+\tgit show --format=\"%an <%ae>, %cn <%ce>\" --quiet > ../actual\n+\t) &&\n+\n+\techo \"Jane Rey <jrey@example.com>, A U Thor <author@example.com>\" > expected &&\n+\ttest_cmp expected actual\n+'\n+\n+# cleanup previous stuff\n+rm -rf bzrrepo gitrepo\n+\n+test_expect_success 'fetch utf-8 filenames' '\n+\ttest_when_finished \"rm -rf bzrrepo gitrepo && LC_ALL=C\" &&\n+\n+\tLC_ALL=en_US.UTF-8\n+\texport LC_ALL\n+\n+\t(\n+\tbzr init bzrrepo &&\n+\tcd bzrrepo &&\n+\n+\techo test >> \"ærø\" &&\n+\tbzr add \"ærø\" &&\n+\techo test >> \"ø~?\" &&\n+\tbzr add \"ø~?\" &&\n+\tbzr commit -m add-utf-8 &&\n+\techo test >> \"ærø\" &&\n+\tbzr commit -m test-utf-8 &&\n+\tbzr rm \"ø~?\" &&\n+\tbzr mv \"ærø\" \"ø~?\" &&\n+\tbzr commit -m bzr-mv-utf-8\n+\t) &&\n+\n+\t(\n+\tgit clone \"bzr::bzrrepo\" gitrepo &&\n+\tcd gitrepo &&\n+\tgit -c core.quotepath=false ls-files > ../actual\n+\t) &&\n+\techo \"ø~?\" > expected &&\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'push utf-8 filenames' '\n+\ttest_when_finished \"rm -rf bzrrepo gitrepo && LC_ALL=C\" &&\n+\n+\tmkdir -p tmp && cd tmp &&\n+\n+\tLC_ALL=en_US.UTF-8\n+\texport LC_ALL\n+\n+\t(\n+\tbzr init bzrrepo &&\n+\tcd bzrrepo &&\n+\n+\techo one >> content &&\n+\tbzr add content &&\n+\tbzr commit -m one\n+\t) &&\n+\n+\t(\n+\tgit clone \"bzr::bzrrepo\" gitrepo &&\n+\tcd gitrepo &&\n+\n+\techo test >> \"ærø\" &&\n+\tgit add \"ærø\" &&\n+\tgit commit -m utf-8 &&\n+\n+\tgit push\n+\t) &&\n+\n+\t(cd bzrrepo && bzr ls > ../actual) &&\n+\tprintf \"content\\nærø\\n\" > expected &&\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'pushing a merge' '\n+\ttest_when_finished \"rm -rf bzrrepo gitrepo\" &&\n+\n+\t(\n+\tbzr init bzrrepo &&\n+\tcd bzrrepo &&\n+\techo one > content &&\n+\tbzr add content &&\n+\tbzr commit -m one\n+\t) &&\n+\n+\tgit clone \"bzr::bzrrepo\" gitrepo &&\n+\n+\t(\n+\tcd bzrrepo &&\n+\techo two > content &&\n+\tbzr commit -m two\n+\t) &&\n+\n+\t(\n+\tcd gitrepo &&\n+\techo three > content &&\n+\tgit commit -a -m three &&\n+\tgit fetch &&\n+\tgit merge origin/master || true &&\n+\techo three > content &&\n+\tgit commit -a --no-edit &&\n+\tgit push\n+\t) &&\n+\n+\techo three > expected &&\n+\tcat bzrrepo/content > actual &&\n+\ttest_cmp expected actual\n+'\n+\n+cat > expected <<EOF\n+origin/HEAD\n+origin/branch\n+origin/trunk\n+EOF\n+\n+test_expect_success 'proper bzr repo' '\n+\ttest_when_finished \"rm -rf bzrrepo gitrepo\" &&\n+\n+\tbzr init-repo bzrrepo &&\n+\n+\t(\n+\tbzr init bzrrepo/trunk &&\n+\tcd bzrrepo/trunk &&\n+\techo one >> content &&\n+\tbzr add content &&\n+\tbzr commit -m one\n+\t) &&\n+\n+\t(\n+\tbzr branch bzrrepo/trunk bzrrepo/branch &&\n+\tcd bzrrepo/branch &&\n+\techo two >> content &&\n+\tbzr commit -m one\n+\t) &&\n+\n+\t(\n+\tgit clone \"bzr::bzrrepo\" gitrepo &&\n+\tcd gitrepo &&\n+\tgit for-each-ref --format \"%(refname:short)\" refs/remotes/origin > ../actual\n+\t) &&\n+\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'strip' '\n+\ttest_when_finished \"rm -rf bzrrepo gitrepo\" &&\n+\n+\t(\n+\tbzr init bzrrepo &&\n+\tcd bzrrepo &&\n+\n+\techo one >> content &&\n+\tbzr add content &&\n+\tbzr commit -m one &&\n+\n+\techo two >> content &&\n+\tbzr commit -m two\n+\t) &&\n+\n+\tgit clone \"bzr::bzrrepo\" gitrepo &&\n+\n+\t(\n+\tcd bzrrepo &&\n+\tbzr uncommit --force &&\n+\n+\techo three >> content &&\n+\tbzr commit -m three &&\n+\n+\techo four >> content &&\n+\tbzr commit -m four &&\n+\tbzr log --line | sed -e \"s/^[0-9][0-9]*: //\" > ../expected\n+\t) &&\n+\n+\t(\n+\tcd gitrepo &&\n+\tgit fetch &&\n+\tgit log --format=\"%an %ad %s\" --date=short origin/master > ../actual\n+\t) &&\n+\n+\ttest_cmp expected actual\n+'\n+\n+test_done\ndiff --git a/contrib/remote-helpers/test-hg-bidi.sh b/contrib/remote-helpers/test-hg-bidi.sh\ndeleted file mode 100755\nindex 86a3f10..0000000\n--- a/contrib/remote-helpers/test-hg-bidi.sh\n+++ /dev/null\n@@ -1,240 +0,0 @@\n-#!/bin/sh\n-#\n-# Copyright (c) 2012 Felipe Contreras\n-#\n-# Base commands from hg-git tests:\n-# https://bitbucket.org/durin42/hg-git/src\n-#\n-\n-test_description='Test bidirectionality of remote-hg'\n-\n-. ./test-lib.sh\n-\n-if ! test_have_prereq PYTHON; then\n-\tskip_all='skipping remote-hg tests; python not available'\n-\ttest_done\n-fi\n-\n-if ! \"$PYTHON_PATH\" -c 'import mercurial'; then\n-\tskip_all='skipping remote-hg tests; mercurial not available'\n-\ttest_done\n-fi\n-\n-# clone to a git repo\n-git_clone () {\n-\tgit clone -q \"hg::$1\" $2\n-}\n-\n-# clone to an hg repo\n-hg_clone () {\n-\t(\n-\thg init $2 &&\n-\tcd $1 &&\n-\tgit push -q \"hg::../$2\" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*'\n-\t) &&\n-\n-\t(cd $2 && hg -q update)\n-}\n-\n-# push an hg repo\n-hg_push () {\n-\t(\n-\tcd $2\n-\tgit checkout -q -b tmp &&\n-\tgit fetch -q \"hg::../$1\" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&\n-\tgit checkout -q @{-1} &&\n-\tgit branch -q -D tmp 2> /dev/null || true\n-\t)\n-}\n-\n-hg_log () {\n-\thg -R $1 log --graph --debug\n-}\n-\n-setup () {\n-\t(\n-\techo \"[ui]\"\n-\techo \"username = A U Thor <author@example.com>\"\n-\techo \"[defaults]\"\n-\techo \"backout = -d \\\"0 0\\\"\"\n-\techo \"commit = -d \\\"0 0\\\"\"\n-\techo \"debugrawcommit = -d \\\"0 0\\\"\"\n-\techo \"tag = -d \\\"0 0\\\"\"\n-\techo \"[extensions]\"\n-\techo \"graphlog =\"\n-\t) >> \"$HOME\"/.hgrc &&\n-\tgit config --global remote-hg.hg-git-compat true\n-\tgit config --global remote-hg.track-branches true\n-\n-\tHGEDITOR=/usr/bin/true\n-\tGIT_AUTHOR_DATE=\"2007-01-01 00:00:00 +0230\"\n-\tGIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"\n-\texport HGEDITOR GIT_AUTHOR_DATE GIT_COMMITTER_DATE\n-}\n-\n-setup\n-\n-test_expect_success 'encoding' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\tgit init -q gitrepo &&\n-\tcd gitrepo &&\n-\n-\techo alpha > alpha &&\n-\tgit add alpha &&\n-\tgit commit -m \"add älphà\" &&\n-\n-\tGIT_AUTHOR_NAME=\"tést èncödîng\" &&\n-\texport GIT_AUTHOR_NAME &&\n-\techo beta > beta &&\n-\tgit add beta &&\n-\tgit commit -m \"add beta\" &&\n-\n-\techo gamma > gamma &&\n-\tgit add gamma &&\n-\tgit commit -m \"add gämmâ\" &&\n-\n-\t: TODO git config i18n.commitencoding latin-1 &&\n-\techo delta > delta &&\n-\tgit add delta &&\n-\tgit commit -m \"add déltà\"\n-\t) &&\n-\n-\thg_clone gitrepo hgrepo &&\n-\tgit_clone hgrepo gitrepo2 &&\n-\thg_clone gitrepo2 hgrepo2 &&\n-\n-\tHGENCODING=utf-8 hg_log hgrepo > expected &&\n-\tHGENCODING=utf-8 hg_log hgrepo2 > actual &&\n-\n-\ttest_cmp expected actual\n-'\n-\n-test_expect_success 'file removal' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\tgit init -q gitrepo &&\n-\tcd gitrepo &&\n-\techo alpha > alpha &&\n-\tgit add alpha &&\n-\tgit commit -m \"add alpha\" &&\n-\techo beta > beta &&\n-\tgit add beta &&\n-\tgit commit -m \"add beta\"\n-\tmkdir foo &&\n-\techo blah > foo/bar &&\n-\tgit add foo &&\n-\tgit commit -m \"add foo\" &&\n-\tgit rm alpha &&\n-\tgit commit -m \"remove alpha\" &&\n-\tgit rm foo/bar &&\n-\tgit commit -m \"remove foo/bar\"\n-\t) &&\n-\n-\thg_clone gitrepo hgrepo &&\n-\tgit_clone hgrepo gitrepo2 &&\n-\thg_clone gitrepo2 hgrepo2 &&\n-\n-\thg_log hgrepo > expected &&\n-\thg_log hgrepo2 > actual &&\n-\n-\ttest_cmp expected actual\n-'\n-\n-test_expect_success 'git tags' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\tgit init -q gitrepo &&\n-\tcd gitrepo &&\n-\tgit config receive.denyCurrentBranch ignore &&\n-\techo alpha > alpha &&\n-\tgit add alpha &&\n-\tgit commit -m \"add alpha\" &&\n-\tgit tag alpha &&\n-\n-\techo beta > beta &&\n-\tgit add beta &&\n-\tgit commit -m \"add beta\" &&\n-\tgit tag -a -m \"added tag beta\" beta\n-\t) &&\n-\n-\thg_clone gitrepo hgrepo &&\n-\tgit_clone hgrepo gitrepo2 &&\n-\thg_clone gitrepo2 hgrepo2 &&\n-\n-\thg_log hgrepo > expected &&\n-\thg_log hgrepo2 > actual &&\n-\n-\ttest_cmp expected actual\n-'\n-\n-test_expect_success 'hg branch' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\tgit init -q gitrepo &&\n-\tcd gitrepo &&\n-\n-\techo alpha > alpha &&\n-\tgit add alpha &&\n-\tgit commit -q -m \"add alpha\" &&\n-\tgit checkout -q -b not-master\n-\t) &&\n-\n-\t(\n-\thg_clone gitrepo hgrepo &&\n-\n-\tcd hgrepo &&\n-\thg -q co default &&\n-\thg mv alpha beta &&\n-\thg -q commit -m \"rename alpha to beta\" &&\n-\thg branch gamma | grep -v \"permanent and global\" &&\n-\thg -q commit -m \"started branch gamma\"\n-\t) &&\n-\n-\thg_push hgrepo gitrepo &&\n-\thg_clone gitrepo hgrepo2 &&\n-\n-\t: Back to the common revision &&\n-\t(cd hgrepo && hg checkout default) &&\n-\n-\thg_log hgrepo > expected &&\n-\thg_log hgrepo2 > actual &&\n-\n-\ttest_cmp expected actual\n-'\n-\n-test_expect_success 'hg tags' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\tgit init -q gitrepo &&\n-\tcd gitrepo &&\n-\n-\techo alpha > alpha &&\n-\tgit add alpha &&\n-\tgit commit -m \"add alpha\" &&\n-\tgit checkout -q -b not-master\n-\t) &&\n-\n-\t(\n-\thg_clone gitrepo hgrepo &&\n-\n-\tcd hgrepo &&\n-\thg co default &&\n-\thg tag alpha\n-\t) &&\n-\n-\thg_push hgrepo gitrepo &&\n-\thg_clone gitrepo hgrepo2 &&\n-\n-\thg_log hgrepo > expected &&\n-\thg_log hgrepo2 > actual &&\n-\n-\ttest_cmp expected actual\n-'\n-\n-test_done\ndiff --git a/contrib/remote-helpers/test-hg-bidi.t b/contrib/remote-helpers/test-hg-bidi.t\nnew file mode 100755\nindex 0000000..86a3f10\n--- /dev/null\n+++ b/contrib/remote-helpers/test-hg-bidi.t\n@@ -0,0 +1,240 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2012 Felipe Contreras\n+#\n+# Base commands from hg-git tests:\n+# https://bitbucket.org/durin42/hg-git/src\n+#\n+\n+test_description='Test bidirectionality of remote-hg'\n+\n+. ./test-lib.sh\n+\n+if ! test_have_prereq PYTHON; then\n+\tskip_all='skipping remote-hg tests; python not available'\n+\ttest_done\n+fi\n+\n+if ! \"$PYTHON_PATH\" -c 'import mercurial'; then\n+\tskip_all='skipping remote-hg tests; mercurial not available'\n+\ttest_done\n+fi\n+\n+# clone to a git repo\n+git_clone () {\n+\tgit clone -q \"hg::$1\" $2\n+}\n+\n+# clone to an hg repo\n+hg_clone () {\n+\t(\n+\thg init $2 &&\n+\tcd $1 &&\n+\tgit push -q \"hg::../$2\" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*'\n+\t) &&\n+\n+\t(cd $2 && hg -q update)\n+}\n+\n+# push an hg repo\n+hg_push () {\n+\t(\n+\tcd $2\n+\tgit checkout -q -b tmp &&\n+\tgit fetch -q \"hg::../$1\" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&\n+\tgit checkout -q @{-1} &&\n+\tgit branch -q -D tmp 2> /dev/null || true\n+\t)\n+}\n+\n+hg_log () {\n+\thg -R $1 log --graph --debug\n+}\n+\n+setup () {\n+\t(\n+\techo \"[ui]\"\n+\techo \"username = A U Thor <author@example.com>\"\n+\techo \"[defaults]\"\n+\techo \"backout = -d \\\"0 0\\\"\"\n+\techo \"commit = -d \\\"0 0\\\"\"\n+\techo \"debugrawcommit = -d \\\"0 0\\\"\"\n+\techo \"tag = -d \\\"0 0\\\"\"\n+\techo \"[extensions]\"\n+\techo \"graphlog =\"\n+\t) >> \"$HOME\"/.hgrc &&\n+\tgit config --global remote-hg.hg-git-compat true\n+\tgit config --global remote-hg.track-branches true\n+\n+\tHGEDITOR=/usr/bin/true\n+\tGIT_AUTHOR_DATE=\"2007-01-01 00:00:00 +0230\"\n+\tGIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"\n+\texport HGEDITOR GIT_AUTHOR_DATE GIT_COMMITTER_DATE\n+}\n+\n+setup\n+\n+test_expect_success 'encoding' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\tgit init -q gitrepo &&\n+\tcd gitrepo &&\n+\n+\techo alpha > alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"add älphà\" &&\n+\n+\tGIT_AUTHOR_NAME=\"tést èncödîng\" &&\n+\texport GIT_AUTHOR_NAME &&\n+\techo beta > beta &&\n+\tgit add beta &&\n+\tgit commit -m \"add beta\" &&\n+\n+\techo gamma > gamma &&\n+\tgit add gamma &&\n+\tgit commit -m \"add gämmâ\" &&\n+\n+\t: TODO git config i18n.commitencoding latin-1 &&\n+\techo delta > delta &&\n+\tgit add delta &&\n+\tgit commit -m \"add déltà\"\n+\t) &&\n+\n+\thg_clone gitrepo hgrepo &&\n+\tgit_clone hgrepo gitrepo2 &&\n+\thg_clone gitrepo2 hgrepo2 &&\n+\n+\tHGENCODING=utf-8 hg_log hgrepo > expected &&\n+\tHGENCODING=utf-8 hg_log hgrepo2 > actual &&\n+\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'file removal' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\tgit init -q gitrepo &&\n+\tcd gitrepo &&\n+\techo alpha > alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"add alpha\" &&\n+\techo beta > beta &&\n+\tgit add beta &&\n+\tgit commit -m \"add beta\"\n+\tmkdir foo &&\n+\techo blah > foo/bar &&\n+\tgit add foo &&\n+\tgit commit -m \"add foo\" &&\n+\tgit rm alpha &&\n+\tgit commit -m \"remove alpha\" &&\n+\tgit rm foo/bar &&\n+\tgit commit -m \"remove foo/bar\"\n+\t) &&\n+\n+\thg_clone gitrepo hgrepo &&\n+\tgit_clone hgrepo gitrepo2 &&\n+\thg_clone gitrepo2 hgrepo2 &&\n+\n+\thg_log hgrepo > expected &&\n+\thg_log hgrepo2 > actual &&\n+\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'git tags' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\tgit init -q gitrepo &&\n+\tcd gitrepo &&\n+\tgit config receive.denyCurrentBranch ignore &&\n+\techo alpha > alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"add alpha\" &&\n+\tgit tag alpha &&\n+\n+\techo beta > beta &&\n+\tgit add beta &&\n+\tgit commit -m \"add beta\" &&\n+\tgit tag -a -m \"added tag beta\" beta\n+\t) &&\n+\n+\thg_clone gitrepo hgrepo &&\n+\tgit_clone hgrepo gitrepo2 &&\n+\thg_clone gitrepo2 hgrepo2 &&\n+\n+\thg_log hgrepo > expected &&\n+\thg_log hgrepo2 > actual &&\n+\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'hg branch' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\tgit init -q gitrepo &&\n+\tcd gitrepo &&\n+\n+\techo alpha > alpha &&\n+\tgit add alpha &&\n+\tgit commit -q -m \"add alpha\" &&\n+\tgit checkout -q -b not-master\n+\t) &&\n+\n+\t(\n+\thg_clone gitrepo hgrepo &&\n+\n+\tcd hgrepo &&\n+\thg -q co default &&\n+\thg mv alpha beta &&\n+\thg -q commit -m \"rename alpha to beta\" &&\n+\thg branch gamma | grep -v \"permanent and global\" &&\n+\thg -q commit -m \"started branch gamma\"\n+\t) &&\n+\n+\thg_push hgrepo gitrepo &&\n+\thg_clone gitrepo hgrepo2 &&\n+\n+\t: Back to the common revision &&\n+\t(cd hgrepo && hg checkout default) &&\n+\n+\thg_log hgrepo > expected &&\n+\thg_log hgrepo2 > actual &&\n+\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'hg tags' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\tgit init -q gitrepo &&\n+\tcd gitrepo &&\n+\n+\techo alpha > alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"add alpha\" &&\n+\tgit checkout -q -b not-master\n+\t) &&\n+\n+\t(\n+\thg_clone gitrepo hgrepo &&\n+\n+\tcd hgrepo &&\n+\thg co default &&\n+\thg tag alpha\n+\t) &&\n+\n+\thg_push hgrepo gitrepo &&\n+\thg_clone gitrepo hgrepo2 &&\n+\n+\thg_log hgrepo > expected &&\n+\thg_log hgrepo2 > actual &&\n+\n+\ttest_cmp expected actual\n+'\n+\n+test_done\ndiff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh\ndeleted file mode 100755\nindex 0217860..0000000\n--- a/contrib/remote-helpers/test-hg-hg-git.sh\n+++ /dev/null\n@@ -1,527 +0,0 @@\n-#!/bin/sh\n-#\n-# Copyright (c) 2012 Felipe Contreras\n-#\n-# Base commands from hg-git tests:\n-# https://bitbucket.org/durin42/hg-git/src\n-#\n-\n-test_description='Test remote-hg output compared to hg-git'\n-\n-. ./test-lib.sh\n-\n-if ! test_have_prereq PYTHON; then\n-\tskip_all='skipping remote-hg tests; python not available'\n-\ttest_done\n-fi\n-\n-if ! \"$PYTHON_PATH\" -c 'import mercurial'; then\n-\tskip_all='skipping remote-hg tests; mercurial not available'\n-\ttest_done\n-fi\n-\n-if ! \"$PYTHON_PATH\" -c 'import hggit'; then\n-\tskip_all='skipping remote-hg tests; hg-git not available'\n-\ttest_done\n-fi\n-\n-# clone to a git repo with git\n-git_clone_git () {\n-\tgit clone -q \"hg::$1\" $2 &&\n-\t(cd $2 && git checkout master && git branch -D default)\n-}\n-\n-# clone to an hg repo with git\n-hg_clone_git () {\n-\t(\n-\thg init $2 &&\n-\thg -R $2 bookmark -i master &&\n-\tcd $1 &&\n-\tgit push -q \"hg::../$2\" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*'\n-\t) &&\n-\n-\t(cd $2 && hg -q update)\n-}\n-\n-# clone to a git repo with hg\n-git_clone_hg () {\n-\t(\n-\tgit init -q $2 &&\n-\tcd $1 &&\n-\thg bookmark -i -f -r tip master &&\n-\thg -q push -r master ../$2 || true\n-\t)\n-}\n-\n-# clone to an hg repo with hg\n-hg_clone_hg () {\n-\thg -q clone $1 $2\n-}\n-\n-# push an hg repo with git\n-hg_push_git () {\n-\t(\n-\tcd $2\n-\tgit checkout -q -b tmp &&\n-\tgit fetch -q \"hg::../$1\" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&\n-\tgit branch -D default &&\n-\tgit checkout -q @{-1} &&\n-\tgit branch -q -D tmp 2> /dev/null || true\n-\t)\n-}\n-\n-# push an hg git repo with hg\n-hg_push_hg () {\n-\t(\n-\tcd $1 &&\n-\thg -q push ../$2 || true\n-\t)\n-}\n-\n-hg_log () {\n-\thg -R $1 log --graph --debug >log &&\n-\tgrep -v 'tag: *default/' log\n-}\n-\n-git_log () {\n-\tgit --git-dir=$1/.git fast-export --branches\n-}\n-\n-setup () {\n-\t(\n-\techo \"[ui]\"\n-\techo \"username = A U Thor <author@example.com>\"\n-\techo \"[defaults]\"\n-\techo \"backout = -d \\\"0 0\\\"\"\n-\techo \"commit = -d \\\"0 0\\\"\"\n-\techo \"debugrawcommit = -d \\\"0 0\\\"\"\n-\techo \"tag = -d \\\"0 0\\\"\"\n-\techo \"[extensions]\"\n-\techo \"hgext.bookmarks =\"\n-\techo \"hggit =\"\n-\techo \"graphlog =\"\n-\t) >> \"$HOME\"/.hgrc &&\n-\tgit config --global receive.denycurrentbranch warn\n-\tgit config --global remote-hg.hg-git-compat true\n-\tgit config --global remote-hg.track-branches false\n-\n-\tHGEDITOR=true\n-\tHGMERGE=true\n-\n-\tGIT_AUTHOR_DATE=\"2007-01-01 00:00:00 +0230\"\n-\tGIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"\n-\texport HGEDITOR HGMERGE GIT_AUTHOR_DATE GIT_COMMITTER_DATE\n-}\n-\n-setup\n-\n-test_expect_success 'executable bit' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\tgit init -q gitrepo &&\n-\tcd gitrepo &&\n-\techo alpha > alpha &&\n-\tchmod 0644 alpha &&\n-\tgit add alpha &&\n-\tgit commit -m \"add alpha\" &&\n-\tchmod 0755 alpha &&\n-\tgit add alpha &&\n-\tgit commit -m \"set executable bit\" &&\n-\tchmod 0644 alpha &&\n-\tgit add alpha &&\n-\tgit commit -m \"clear executable bit\"\n-\t) &&\n-\n-\tfor x in hg git; do\n-\t\t(\n-\t\thg_clone_$x gitrepo hgrepo-$x &&\n-\t\tcd hgrepo-$x &&\n-\t\thg_log . &&\n-\t\thg manifest -r 1 -v &&\n-\t\thg manifest -v\n-\t\t) > output-$x &&\n-\n-\t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n-\t\tgit_log gitrepo2-$x > log-$x\n-\tdone &&\n-\n-\ttest_cmp output-hg output-git &&\n-\ttest_cmp log-hg log-git\n-'\n-\n-test_expect_success 'symlink' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\tgit init -q gitrepo &&\n-\tcd gitrepo &&\n-\techo alpha > alpha &&\n-\tgit add alpha &&\n-\tgit commit -m \"add alpha\" &&\n-\tln -s alpha beta &&\n-\tgit add beta &&\n-\tgit commit -m \"add beta\"\n-\t) &&\n-\n-\tfor x in hg git; do\n-\t\t(\n-\t\thg_clone_$x gitrepo hgrepo-$x &&\n-\t\tcd hgrepo-$x &&\n-\t\thg_log . &&\n-\t\thg manifest -v\n-\t\t) > output-$x &&\n-\n-\t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n-\t\tgit_log gitrepo2-$x > log-$x\n-\tdone &&\n-\n-\ttest_cmp output-hg output-git &&\n-\ttest_cmp log-hg log-git\n-'\n-\n-test_expect_success 'merge conflict 1' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\thg init hgrepo1 &&\n-\tcd hgrepo1 &&\n-\techo A > afile &&\n-\thg add afile &&\n-\thg ci -m \"origin\" &&\n-\n-\techo B > afile &&\n-\thg ci -m \"A->B\" &&\n-\n-\thg up -r0 &&\n-\techo C > afile &&\n-\thg ci -m \"A->C\" &&\n-\n-\thg merge -r1 &&\n-\techo C > afile &&\n-\thg resolve -m afile &&\n-\thg ci -m \"merge to C\"\n-\t) &&\n-\n-\tfor x in hg git; do\n-\t\tgit_clone_$x hgrepo1 gitrepo-$x &&\n-\t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n-\t\thg_log hgrepo2-$x > hg-log-$x &&\n-\t\tgit_log gitrepo-$x > git-log-$x\n-\tdone &&\n-\n-\ttest_cmp hg-log-hg hg-log-git &&\n-\ttest_cmp git-log-hg git-log-git\n-'\n-\n-test_expect_success 'merge conflict 2' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\thg init hgrepo1 &&\n-\tcd hgrepo1 &&\n-\techo A > afile &&\n-\thg add afile &&\n-\thg ci -m \"origin\" &&\n-\n-\techo B > afile &&\n-\thg ci -m \"A->B\" &&\n-\n-\thg up -r0 &&\n-\techo C > afile &&\n-\thg ci -m \"A->C\" &&\n-\n-\thg merge -r1 || true &&\n-\techo B > afile &&\n-\thg resolve -m afile &&\n-\thg ci -m \"merge to B\"\n-\t) &&\n-\n-\tfor x in hg git; do\n-\t\tgit_clone_$x hgrepo1 gitrepo-$x &&\n-\t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n-\t\thg_log hgrepo2-$x > hg-log-$x &&\n-\t\tgit_log gitrepo-$x > git-log-$x\n-\tdone &&\n-\n-\ttest_cmp hg-log-hg hg-log-git &&\n-\ttest_cmp git-log-hg git-log-git\n-'\n-\n-test_expect_success 'converged merge' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\thg init hgrepo1 &&\n-\tcd hgrepo1 &&\n-\techo A > afile &&\n-\thg add afile &&\n-\thg ci -m \"origin\" &&\n-\n-\techo B > afile &&\n-\thg ci -m \"A->B\" &&\n-\n-\techo C > afile &&\n-\thg ci -m \"B->C\" &&\n-\n-\thg up -r0 &&\n-\techo C > afile &&\n-\thg ci -m \"A->C\" &&\n-\n-\thg merge -r2 || true &&\n-\thg ci -m \"merge\"\n-\t) &&\n-\n-\tfor x in hg git; do\n-\t\tgit_clone_$x hgrepo1 gitrepo-$x &&\n-\t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n-\t\thg_log hgrepo2-$x > hg-log-$x &&\n-\t\tgit_log gitrepo-$x > git-log-$x\n-\tdone &&\n-\n-\ttest_cmp hg-log-hg hg-log-git &&\n-\ttest_cmp git-log-hg git-log-git\n-'\n-\n-test_expect_success 'encoding' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\tgit init -q gitrepo &&\n-\tcd gitrepo &&\n-\n-\techo alpha > alpha &&\n-\tgit add alpha &&\n-\tgit commit -m \"add älphà\" &&\n-\n-\tGIT_AUTHOR_NAME=\"tést èncödîng\" &&\n-\texport GIT_AUTHOR_NAME &&\n-\techo beta > beta &&\n-\tgit add beta &&\n-\tgit commit -m \"add beta\" &&\n-\n-\techo gamma > gamma &&\n-\tgit add gamma &&\n-\tgit commit -m \"add gämmâ\" &&\n-\n-\t: TODO git config i18n.commitencoding latin-1 &&\n-\techo delta > delta &&\n-\tgit add delta &&\n-\tgit commit -m \"add déltà\"\n-\t) &&\n-\n-\tfor x in hg git; do\n-\t\thg_clone_$x gitrepo hgrepo-$x &&\n-\t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n-\n-\t\tHGENCODING=utf-8 hg_log hgrepo-$x > hg-log-$x &&\n-\t\tgit_log gitrepo2-$x > git-log-$x\n-\tdone &&\n-\n-\ttest_cmp hg-log-hg hg-log-git &&\n-\ttest_cmp git-log-hg git-log-git\n-'\n-\n-test_expect_success 'file removal' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\tgit init -q gitrepo &&\n-\tcd gitrepo &&\n-\techo alpha > alpha &&\n-\tgit add alpha &&\n-\tgit commit -m \"add alpha\" &&\n-\techo beta > beta &&\n-\tgit add beta &&\n-\tgit commit -m \"add beta\"\n-\tmkdir foo &&\n-\techo blah > foo/bar &&\n-\tgit add foo &&\n-\tgit commit -m \"add foo\" &&\n-\tgit rm alpha &&\n-\tgit commit -m \"remove alpha\" &&\n-\tgit rm foo/bar &&\n-\tgit commit -m \"remove foo/bar\"\n-\t) &&\n-\n-\tfor x in hg git; do\n-\t\t(\n-\t\thg_clone_$x gitrepo hgrepo-$x &&\n-\t\tcd hgrepo-$x &&\n-\t\thg_log . &&\n-\t\thg manifest -r 3 &&\n-\t\thg manifest\n-\t\t) > output-$x &&\n-\n-\t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n-\t\tgit_log gitrepo2-$x > log-$x\n-\tdone &&\n-\n-\ttest_cmp output-hg output-git &&\n-\ttest_cmp log-hg log-git\n-'\n-\n-test_expect_success 'git tags' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\t(\n-\tgit init -q gitrepo &&\n-\tcd gitrepo &&\n-\tgit config receive.denyCurrentBranch ignore &&\n-\techo alpha > alpha &&\n-\tgit add alpha &&\n-\tgit commit -m \"add alpha\" &&\n-\tgit tag alpha &&\n-\n-\techo beta > beta &&\n-\tgit add beta &&\n-\tgit commit -m \"add beta\" &&\n-\tgit tag -a -m \"added tag beta\" beta\n-\t) &&\n-\n-\tfor x in hg git; do\n-\t\thg_clone_$x gitrepo hgrepo-$x &&\n-\t\thg_log hgrepo-$x > log-$x\n-\tdone &&\n-\n-\ttest_cmp log-hg log-git\n-'\n-\n-test_expect_success 'hg author' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\tfor x in hg git; do\n-\t\t(\n-\t\tgit init -q gitrepo-$x &&\n-\t\tcd gitrepo-$x &&\n-\n-\t\techo alpha > alpha &&\n-\t\tgit add alpha &&\n-\t\tgit commit -m \"add alpha\" &&\n-\t\tgit checkout -q -b not-master\n-\t\t) &&\n-\n-\t\t(\n-\t\thg_clone_$x gitrepo-$x hgrepo-$x &&\n-\t\tcd hgrepo-$x &&\n-\n-\t\thg co master &&\n-\t\techo beta > beta &&\n-\t\thg add beta &&\n-\t\thg commit -u \"test\" -m \"add beta\" &&\n-\n-\t\techo gamma >> beta &&\n-\t\thg commit -u \"test <test@example.com> (comment)\" -m \"modify beta\" &&\n-\n-\t\techo gamma > gamma &&\n-\t\thg add gamma &&\n-\t\thg commit -u \"<test@example.com>\" -m \"add gamma\" &&\n-\n-\t\techo delta > delta &&\n-\t\thg add delta &&\n-\t\thg commit -u \"name<test@example.com>\" -m \"add delta\" &&\n-\n-\t\techo epsilon > epsilon &&\n-\t\thg add epsilon &&\n-\t\thg commit -u \"name <test@example.com\" -m \"add epsilon\" &&\n-\n-\t\techo zeta > zeta &&\n-\t\thg add zeta &&\n-\t\thg commit -u \" test \" -m \"add zeta\" &&\n-\n-\t\techo eta > eta &&\n-\t\thg add eta &&\n-\t\thg commit -u \"test < test@example.com >\" -m \"add eta\" &&\n-\n-\t\techo theta > theta &&\n-\t\thg add theta &&\n-\t\thg commit -u \"test >test@example.com>\" -m \"add theta\" &&\n-\n-\t\techo iota > iota &&\n-\t\thg add iota &&\n-\t\thg commit -u \"test <test <at> example <dot> com>\" -m \"add iota\"\n-\t\t) &&\n-\n-\t\thg_push_$x hgrepo-$x gitrepo-$x &&\n-\t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n-\n-\t\thg_log hgrepo2-$x > hg-log-$x &&\n-\t\tgit_log gitrepo-$x > git-log-$x\n-\tdone &&\n-\n-\ttest_cmp hg-log-hg hg-log-git &&\n-\ttest_cmp git-log-hg git-log-git\n-'\n-\n-test_expect_success 'hg branch' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\tfor x in hg git; do\n-\t\t(\n-\t\tgit init -q gitrepo-$x &&\n-\t\tcd gitrepo-$x &&\n-\n-\t\techo alpha > alpha &&\n-\t\tgit add alpha &&\n-\t\tgit commit -q -m \"add alpha\" &&\n-\t\tgit checkout -q -b not-master\n-\t\t) &&\n-\n-\t\t(\n-\t\thg_clone_$x gitrepo-$x hgrepo-$x &&\n-\n-\t\tcd hgrepo-$x &&\n-\t\thg -q co master &&\n-\t\thg mv alpha beta &&\n-\t\thg -q commit -m \"rename alpha to beta\" &&\n-\t\thg branch gamma | grep -v \"permanent and global\" &&\n-\t\thg -q commit -m \"started branch gamma\"\n-\t\t) &&\n-\n-\t\thg_push_$x hgrepo-$x gitrepo-$x &&\n-\t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n-\n-\t\thg_log hgrepo2-$x > hg-log-$x &&\n-\t\tgit_log gitrepo-$x > git-log-$x\n-\tdone &&\n-\n-\ttest_cmp hg-log-hg hg-log-git &&\n-\ttest_cmp git-log-hg git-log-git\n-'\n-\n-test_expect_success 'hg tags' '\n-\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n-\n-\tfor x in hg git; do\n-\t\t(\n-\t\tgit init -q gitrepo-$x &&\n-\t\tcd gitrepo-$x &&\n-\n-\t\techo alpha > alpha &&\n-\t\tgit add alpha &&\n-\t\tgit commit -m \"add alpha\" &&\n-\t\tgit checkout -q -b not-master\n-\t\t) &&\n-\n-\t\t(\n-\t\thg_clone_$x gitrepo-$x hgrepo-$x &&\n-\n-\t\tcd hgrepo-$x &&\n-\t\thg co master &&\n-\t\thg tag alpha\n-\t\t) &&\n-\n-\t\thg_push_$x hgrepo-$x gitrepo-$x &&\n-\t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n-\n-\t\t(\n-\t\tgit --git-dir=gitrepo-$x/.git tag -l &&\n-\t\thg_log hgrepo2-$x &&\n-\t\tcat hgrepo2-$x/.hgtags\n-\t\t) > output-$x\n-\tdone &&\n-\n-\ttest_cmp output-hg output-git\n-'\n-\n-test_done\ndiff --git a/contrib/remote-helpers/test-hg-hg-git.t b/contrib/remote-helpers/test-hg-hg-git.t\nnew file mode 100755\nindex 0000000..0217860\n--- /dev/null\n+++ b/contrib/remote-helpers/test-hg-hg-git.t\n@@ -0,0 +1,527 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2012 Felipe Contreras\n+#\n+# Base commands from hg-git tests:\n+# https://bitbucket.org/durin42/hg-git/src\n+#\n+\n+test_description='Test remote-hg output compared to hg-git'\n+\n+. ./test-lib.sh\n+\n+if ! test_have_prereq PYTHON; then\n+\tskip_all='skipping remote-hg tests; python not available'\n+\ttest_done\n+fi\n+\n+if ! \"$PYTHON_PATH\" -c 'import mercurial'; then\n+\tskip_all='skipping remote-hg tests; mercurial not available'\n+\ttest_done\n+fi\n+\n+if ! \"$PYTHON_PATH\" -c 'import hggit'; then\n+\tskip_all='skipping remote-hg tests; hg-git not available'\n+\ttest_done\n+fi\n+\n+# clone to a git repo with git\n+git_clone_git () {\n+\tgit clone -q \"hg::$1\" $2 &&\n+\t(cd $2 && git checkout master && git branch -D default)\n+}\n+\n+# clone to an hg repo with git\n+hg_clone_git () {\n+\t(\n+\thg init $2 &&\n+\thg -R $2 bookmark -i master &&\n+\tcd $1 &&\n+\tgit push -q \"hg::../$2\" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*'\n+\t) &&\n+\n+\t(cd $2 && hg -q update)\n+}\n+\n+# clone to a git repo with hg\n+git_clone_hg () {\n+\t(\n+\tgit init -q $2 &&\n+\tcd $1 &&\n+\thg bookmark -i -f -r tip master &&\n+\thg -q push -r master ../$2 || true\n+\t)\n+}\n+\n+# clone to an hg repo with hg\n+hg_clone_hg () {\n+\thg -q clone $1 $2\n+}\n+\n+# push an hg repo with git\n+hg_push_git () {\n+\t(\n+\tcd $2\n+\tgit checkout -q -b tmp &&\n+\tgit fetch -q \"hg::../$1\" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&\n+\tgit branch -D default &&\n+\tgit checkout -q @{-1} &&\n+\tgit branch -q -D tmp 2> /dev/null || true\n+\t)\n+}\n+\n+# push an hg git repo with hg\n+hg_push_hg () {\n+\t(\n+\tcd $1 &&\n+\thg -q push ../$2 || true\n+\t)\n+}\n+\n+hg_log () {\n+\thg -R $1 log --graph --debug >log &&\n+\tgrep -v 'tag: *default/' log\n+}\n+\n+git_log () {\n+\tgit --git-dir=$1/.git fast-export --branches\n+}\n+\n+setup () {\n+\t(\n+\techo \"[ui]\"\n+\techo \"username = A U Thor <author@example.com>\"\n+\techo \"[defaults]\"\n+\techo \"backout = -d \\\"0 0\\\"\"\n+\techo \"commit = -d \\\"0 0\\\"\"\n+\techo \"debugrawcommit = -d \\\"0 0\\\"\"\n+\techo \"tag = -d \\\"0 0\\\"\"\n+\techo \"[extensions]\"\n+\techo \"hgext.bookmarks =\"\n+\techo \"hggit =\"\n+\techo \"graphlog =\"\n+\t) >> \"$HOME\"/.hgrc &&\n+\tgit config --global receive.denycurrentbranch warn\n+\tgit config --global remote-hg.hg-git-compat true\n+\tgit config --global remote-hg.track-branches false\n+\n+\tHGEDITOR=true\n+\tHGMERGE=true\n+\n+\tGIT_AUTHOR_DATE=\"2007-01-01 00:00:00 +0230\"\n+\tGIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"\n+\texport HGEDITOR HGMERGE GIT_AUTHOR_DATE GIT_COMMITTER_DATE\n+}\n+\n+setup\n+\n+test_expect_success 'executable bit' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\tgit init -q gitrepo &&\n+\tcd gitrepo &&\n+\techo alpha > alpha &&\n+\tchmod 0644 alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"add alpha\" &&\n+\tchmod 0755 alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"set executable bit\" &&\n+\tchmod 0644 alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"clear executable bit\"\n+\t) &&\n+\n+\tfor x in hg git; do\n+\t\t(\n+\t\thg_clone_$x gitrepo hgrepo-$x &&\n+\t\tcd hgrepo-$x &&\n+\t\thg_log . &&\n+\t\thg manifest -r 1 -v &&\n+\t\thg manifest -v\n+\t\t) > output-$x &&\n+\n+\t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n+\t\tgit_log gitrepo2-$x > log-$x\n+\tdone &&\n+\n+\ttest_cmp output-hg output-git &&\n+\ttest_cmp log-hg log-git\n+'\n+\n+test_expect_success 'symlink' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\tgit init -q gitrepo &&\n+\tcd gitrepo &&\n+\techo alpha > alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"add alpha\" &&\n+\tln -s alpha beta &&\n+\tgit add beta &&\n+\tgit commit -m \"add beta\"\n+\t) &&\n+\n+\tfor x in hg git; do\n+\t\t(\n+\t\thg_clone_$x gitrepo hgrepo-$x &&\n+\t\tcd hgrepo-$x &&\n+\t\thg_log . &&\n+\t\thg manifest -v\n+\t\t) > output-$x &&\n+\n+\t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n+\t\tgit_log gitrepo2-$x > log-$x\n+\tdone &&\n+\n+\ttest_cmp output-hg output-git &&\n+\ttest_cmp log-hg log-git\n+'\n+\n+test_expect_success 'merge conflict 1' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\thg init hgrepo1 &&\n+\tcd hgrepo1 &&\n+\techo A > afile &&\n+\thg add afile &&\n+\thg ci -m \"origin\" &&\n+\n+\techo B > afile &&\n+\thg ci -m \"A->B\" &&\n+\n+\thg up -r0 &&\n+\techo C > afile &&\n+\thg ci -m \"A->C\" &&\n+\n+\thg merge -r1 &&\n+\techo C > afile &&\n+\thg resolve -m afile &&\n+\thg ci -m \"merge to C\"\n+\t) &&\n+\n+\tfor x in hg git; do\n+\t\tgit_clone_$x hgrepo1 gitrepo-$x &&\n+\t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n+\t\thg_log hgrepo2-$x > hg-log-$x &&\n+\t\tgit_log gitrepo-$x > git-log-$x\n+\tdone &&\n+\n+\ttest_cmp hg-log-hg hg-log-git &&\n+\ttest_cmp git-log-hg git-log-git\n+'\n+\n+test_expect_success 'merge conflict 2' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\thg init hgrepo1 &&\n+\tcd hgrepo1 &&\n+\techo A > afile &&\n+\thg add afile &&\n+\thg ci -m \"origin\" &&\n+\n+\techo B > afile &&\n+\thg ci -m \"A->B\" &&\n+\n+\thg up -r0 &&\n+\techo C > afile &&\n+\thg ci -m \"A->C\" &&\n+\n+\thg merge -r1 || true &&\n+\techo B > afile &&\n+\thg resolve -m afile &&\n+\thg ci -m \"merge to B\"\n+\t) &&\n+\n+\tfor x in hg git; do\n+\t\tgit_clone_$x hgrepo1 gitrepo-$x &&\n+\t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n+\t\thg_log hgrepo2-$x > hg-log-$x &&\n+\t\tgit_log gitrepo-$x > git-log-$x\n+\tdone &&\n+\n+\ttest_cmp hg-log-hg hg-log-git &&\n+\ttest_cmp git-log-hg git-log-git\n+'\n+\n+test_expect_success 'converged merge' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\thg init hgrepo1 &&\n+\tcd hgrepo1 &&\n+\techo A > afile &&\n+\thg add afile &&\n+\thg ci -m \"origin\" &&\n+\n+\techo B > afile &&\n+\thg ci -m \"A->B\" &&\n+\n+\techo C > afile &&\n+\thg ci -m \"B->C\" &&\n+\n+\thg up -r0 &&\n+\techo C > afile &&\n+\thg ci -m \"A->C\" &&\n+\n+\thg merge -r2 || true &&\n+\thg ci -m \"merge\"\n+\t) &&\n+\n+\tfor x in hg git; do\n+\t\tgit_clone_$x hgrepo1 gitrepo-$x &&\n+\t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n+\t\thg_log hgrepo2-$x > hg-log-$x &&\n+\t\tgit_log gitrepo-$x > git-log-$x\n+\tdone &&\n+\n+\ttest_cmp hg-log-hg hg-log-git &&\n+\ttest_cmp git-log-hg git-log-git\n+'\n+\n+test_expect_success 'encoding' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\tgit init -q gitrepo &&\n+\tcd gitrepo &&\n+\n+\techo alpha > alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"add älphà\" &&\n+\n+\tGIT_AUTHOR_NAME=\"tést èncödîng\" &&\n+\texport GIT_AUTHOR_NAME &&\n+\techo beta > beta &&\n+\tgit add beta &&\n+\tgit commit -m \"add beta\" &&\n+\n+\techo gamma > gamma &&\n+\tgit add gamma &&\n+\tgit commit -m \"add gämmâ\" &&\n+\n+\t: TODO git config i18n.commitencoding latin-1 &&\n+\techo delta > delta &&\n+\tgit add delta &&\n+\tgit commit -m \"add déltà\"\n+\t) &&\n+\n+\tfor x in hg git; do\n+\t\thg_clone_$x gitrepo hgrepo-$x &&\n+\t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n+\n+\t\tHGENCODING=utf-8 hg_log hgrepo-$x > hg-log-$x &&\n+\t\tgit_log gitrepo2-$x > git-log-$x\n+\tdone &&\n+\n+\ttest_cmp hg-log-hg hg-log-git &&\n+\ttest_cmp git-log-hg git-log-git\n+'\n+\n+test_expect_success 'file removal' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\tgit init -q gitrepo &&\n+\tcd gitrepo &&\n+\techo alpha > alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"add alpha\" &&\n+\techo beta > beta &&\n+\tgit add beta &&\n+\tgit commit -m \"add beta\"\n+\tmkdir foo &&\n+\techo blah > foo/bar &&\n+\tgit add foo &&\n+\tgit commit -m \"add foo\" &&\n+\tgit rm alpha &&\n+\tgit commit -m \"remove alpha\" &&\n+\tgit rm foo/bar &&\n+\tgit commit -m \"remove foo/bar\"\n+\t) &&\n+\n+\tfor x in hg git; do\n+\t\t(\n+\t\thg_clone_$x gitrepo hgrepo-$x &&\n+\t\tcd hgrepo-$x &&\n+\t\thg_log . &&\n+\t\thg manifest -r 3 &&\n+\t\thg manifest\n+\t\t) > output-$x &&\n+\n+\t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n+\t\tgit_log gitrepo2-$x > log-$x\n+\tdone &&\n+\n+\ttest_cmp output-hg output-git &&\n+\ttest_cmp log-hg log-git\n+'\n+\n+test_expect_success 'git tags' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\t(\n+\tgit init -q gitrepo &&\n+\tcd gitrepo &&\n+\tgit config receive.denyCurrentBranch ignore &&\n+\techo alpha > alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"add alpha\" &&\n+\tgit tag alpha &&\n+\n+\techo beta > beta &&\n+\tgit add beta &&\n+\tgit commit -m \"add beta\" &&\n+\tgit tag -a -m \"added tag beta\" beta\n+\t) &&\n+\n+\tfor x in hg git; do\n+\t\thg_clone_$x gitrepo hgrepo-$x &&\n+\t\thg_log hgrepo-$x > log-$x\n+\tdone &&\n+\n+\ttest_cmp log-hg log-git\n+'\n+\n+test_expect_success 'hg author' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\tfor x in hg git; do\n+\t\t(\n+\t\tgit init -q gitrepo-$x &&\n+\t\tcd gitrepo-$x &&\n+\n+\t\techo alpha > alpha &&\n+\t\tgit add alpha &&\n+\t\tgit commit -m \"add alpha\" &&\n+\t\tgit checkout -q -b not-master\n+\t\t) &&\n+\n+\t\t(\n+\t\thg_clone_$x gitrepo-$x hgrepo-$x &&\n+\t\tcd hgrepo-$x &&\n+\n+\t\thg co master &&\n+\t\techo beta > beta &&\n+\t\thg add beta &&\n+\t\thg commit -u \"test\" -m \"add beta\" &&\n+\n+\t\techo gamma >> beta &&\n+\t\thg commit -u \"test <test@example.com> (comment)\" -m \"modify beta\" &&\n+\n+\t\techo gamma > gamma &&\n+\t\thg add gamma &&\n+\t\thg commit -u \"<test@example.com>\" -m \"add gamma\" &&\n+\n+\t\techo delta > delta &&\n+\t\thg add delta &&\n+\t\thg commit -u \"name<test@example.com>\" -m \"add delta\" &&\n+\n+\t\techo epsilon > epsilon &&\n+\t\thg add epsilon &&\n+\t\thg commit -u \"name <test@example.com\" -m \"add epsilon\" &&\n+\n+\t\techo zeta > zeta &&\n+\t\thg add zeta &&\n+\t\thg commit -u \" test \" -m \"add zeta\" &&\n+\n+\t\techo eta > eta &&\n+\t\thg add eta &&\n+\t\thg commit -u \"test < test@example.com >\" -m \"add eta\" &&\n+\n+\t\techo theta > theta &&\n+\t\thg add theta &&\n+\t\thg commit -u \"test >test@example.com>\" -m \"add theta\" &&\n+\n+\t\techo iota > iota &&\n+\t\thg add iota &&\n+\t\thg commit -u \"test <test <at> example <dot> com>\" -m \"add iota\"\n+\t\t) &&\n+\n+\t\thg_push_$x hgrepo-$x gitrepo-$x &&\n+\t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n+\n+\t\thg_log hgrepo2-$x > hg-log-$x &&\n+\t\tgit_log gitrepo-$x > git-log-$x\n+\tdone &&\n+\n+\ttest_cmp hg-log-hg hg-log-git &&\n+\ttest_cmp git-log-hg git-log-git\n+'\n+\n+test_expect_success 'hg branch' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\tfor x in hg git; do\n+\t\t(\n+\t\tgit init -q gitrepo-$x &&\n+\t\tcd gitrepo-$x &&\n+\n+\t\techo alpha > alpha &&\n+\t\tgit add alpha &&\n+\t\tgit commit -q -m \"add alpha\" &&\n+\t\tgit checkout -q -b not-master\n+\t\t) &&\n+\n+\t\t(\n+\t\thg_clone_$x gitrepo-$x hgrepo-$x &&\n+\n+\t\tcd hgrepo-$x &&\n+\t\thg -q co master &&\n+\t\thg mv alpha beta &&\n+\t\thg -q commit -m \"rename alpha to beta\" &&\n+\t\thg branch gamma | grep -v \"permanent and global\" &&\n+\t\thg -q commit -m \"started branch gamma\"\n+\t\t) &&\n+\n+\t\thg_push_$x hgrepo-$x gitrepo-$x &&\n+\t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n+\n+\t\thg_log hgrepo2-$x > hg-log-$x &&\n+\t\tgit_log gitrepo-$x > git-log-$x\n+\tdone &&\n+\n+\ttest_cmp hg-log-hg hg-log-git &&\n+\ttest_cmp git-log-hg git-log-git\n+'\n+\n+test_expect_success 'hg tags' '\n+\ttest_when_finished \"rm -rf gitrepo* hgrepo*\" &&\n+\n+\tfor x in hg git; do\n+\t\t(\n+\t\tgit init -q gitrepo-$x &&\n+\t\tcd gitrepo-$x &&\n+\n+\t\techo alpha > alpha &&\n+\t\tgit add alpha &&\n+\t\tgit commit -m \"add alpha\" &&\n+\t\tgit checkout -q -b not-master\n+\t\t) &&\n+\n+\t\t(\n+\t\thg_clone_$x gitrepo-$x hgrepo-$x &&\n+\n+\t\tcd hgrepo-$x &&\n+\t\thg co master &&\n+\t\thg tag alpha\n+\t\t) &&\n+\n+\t\thg_push_$x hgrepo-$x gitrepo-$x &&\n+\t\thg_clone_$x gitrepo-$x hgrepo2-$x &&\n+\n+\t\t(\n+\t\tgit --git-dir=gitrepo-$x/.git tag -l &&\n+\t\thg_log hgrepo2-$x &&\n+\t\tcat hgrepo2-$x/.hgtags\n+\t\t) > output-$x\n+\tdone &&\n+\n+\ttest_cmp output-hg output-git\n+'\n+\n+test_done\ndiff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh\ndeleted file mode 100755\nindex 30f4ff6..0000000\n--- a/contrib/remote-helpers/test-hg.sh\n+++ /dev/null\n@@ -1,692 +0,0 @@\n-#!/bin/sh\n-#\n-# Copyright (c) 2012 Felipe Contreras\n-#\n-# Base commands from hg-git tests:\n-# https://bitbucket.org/durin42/hg-git/src\n-#\n-\n-test_description='Test remote-hg'\n-\n-. ./test-lib.sh\n-\n-if ! test_have_prereq PYTHON; then\n-\tskip_all='skipping remote-hg tests; python not available'\n-\ttest_done\n-fi\n-\n-if ! \"$PYTHON_PATH\" -c 'import mercurial'; then\n-\tskip_all='skipping remote-hg tests; mercurial not available'\n-\ttest_done\n-fi\n-\n-check () {\n-\techo $3 > expected &&\n-\tgit --git-dir=$1/.git log --format='%s' -1 $2 > actual\n-\ttest_cmp expected actual\n-}\n-\n-check_branch () {\n-\tif [ -n \"$3\" ]; then\n-\t\techo $3 > expected &&\n-\t\thg -R $1 log -r $2 --template '{desc}\\n' > actual &&\n-\t\ttest_cmp expected actual\n-\telse\n-\t\thg -R $1 branches > out &&\n-\t\t! grep $2 out\n-\tfi\n-}\n-\n-check_bookmark () {\n-\tif [ -n \"$3\" ]; then\n-\t\techo $3 > expected &&\n-\t\thg -R $1 log -r \"bookmark('$2')\" --template '{desc}\\n' > actual &&\n-\t\ttest_cmp expected actual\n-\telse\n-\t\thg -R $1 bookmarks > out &&\n-\t\t! grep $2 out\n-\tfi\n-}\n-\n-check_push () {\n-\tlocal expected_ret=$1 ret=0 ref_ret=0 IFS=':'\n-\n-\tshift\n-\tgit push origin \"$@\" 2> error\n-\tret=$?\n-\tcat error\n-\n-\twhile read branch kind\n-\tdo\n-\t\tcase \"$kind\" in\n-\t\t'new')\n-\t\t\tgrep \"^ \\* \\[new branch\\] *${branch} -> ${branch}$\" error || ref_ret=1\n-\t\t\t;;\n-\t\t'non-fast-forward')\n-\t\t\tgrep \"^ ! \\[rejected\\] *${branch} -> ${branch} (non-fast-forward)$\" error || ref_ret=1\n-\t\t\t;;\n-\t\t'fetch-first')\n-\t\t\tgrep \"^ ! \\[rejected\\] *${branch} -> ${branch} (fetch first)$\" error || ref_ret=1\n-\t\t\t;;\n-\t\t'forced-update')\n-\t\t\tgrep \"^ + [a-f0-9]*\\.\\.\\.[a-f0-9]* *${branch} -> ${branch} (forced update)$\" error || ref_ret=1\n-\t\t\t;;\n-\t\t'')\n-\t\t\tgrep \"^   [a-f0-9]*\\.\\.[a-f0-9]* *${branch} -> ${branch}$\" error || ref_ret=1\n-\t\t\t;;\n-\t\tesac\n-\t\tlet 'ref_ret' && echo \"match for '$branch' failed\" && break\n-\tdone\n-\n-\tif let 'expected_ret != ret || ref_ret'\n-\tthen\n-\t\treturn 1\n-\tfi\n-\n-\treturn 0\n-}\n-\n-setup () {\n-\t(\n-\techo \"[ui]\"\n-\techo \"username = H G Wells <wells@example.com>\"\n-\techo \"[extensions]\"\n-\techo \"mq =\"\n-\t) >> \"$HOME\"/.hgrc &&\n-\n-\tGIT_AUTHOR_DATE=\"2007-01-01 00:00:00 +0230\" &&\n-\tGIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\" &&\n-\texport GIT_COMMITTER_DATE GIT_AUTHOR_DATE\n-}\n-\n-setup\n-\n-test_expect_success 'cloning' '\n-\ttest_when_finished \"rm -rf gitrepo*\" &&\n-\n-\t(\n-\thg init hgrepo &&\n-\tcd hgrepo &&\n-\techo zero > content &&\n-\thg add content &&\n-\thg commit -m zero\n-\t) &&\n-\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\tcheck gitrepo HEAD zero\n-'\n-\n-test_expect_success 'cloning with branches' '\n-\ttest_when_finished \"rm -rf gitrepo*\" &&\n-\n-\t(\n-\tcd hgrepo &&\n-\thg branch next &&\n-\techo next > content &&\n-\thg commit -m next\n-\t) &&\n-\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\tcheck gitrepo origin/branches/next next\n-'\n-\n-test_expect_success 'cloning with bookmarks' '\n-\ttest_when_finished \"rm -rf gitrepo*\" &&\n-\n-\t(\n-\tcd hgrepo &&\n-\thg checkout default &&\n-\thg bookmark feature-a &&\n-\techo feature-a > content &&\n-\thg commit -m feature-a\n-\t) &&\n-\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\tcheck gitrepo origin/feature-a feature-a\n-'\n-\n-test_expect_success 'update bookmark' '\n-\ttest_when_finished \"rm -rf gitrepo*\" &&\n-\n-\t(\n-\tcd hgrepo &&\n-\thg bookmark devel\n-\t) &&\n-\n-\t(\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\tcd gitrepo &&\n-\tgit checkout --quiet devel &&\n-\techo devel > content &&\n-\tgit commit -a -m devel &&\n-\tgit push --quiet\n-\t) &&\n-\n-\tcheck_bookmark hgrepo devel devel\n-'\n-\n-test_expect_success 'new bookmark' '\n-\ttest_when_finished \"rm -rf gitrepo*\" &&\n-\n-\t(\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\tcd gitrepo &&\n-\tgit checkout --quiet -b feature-b &&\n-\techo feature-b > content &&\n-\tgit commit -a -m feature-b &&\n-\tgit push --quiet origin feature-b\n-\t) &&\n-\n-\tcheck_bookmark hgrepo feature-b feature-b\n-'\n-\n-# cleanup previous stuff\n-rm -rf hgrepo\n-\n-author_test () {\n-\techo $1 >> content &&\n-\thg commit -u \"$2\" -m \"add $1\" &&\n-\techo \"$3\" >> ../expected\n-}\n-\n-test_expect_success 'authors' '\n-\ttest_when_finished \"rm -rf hgrepo gitrepo\" &&\n-\n-\t(\n-\thg init hgrepo &&\n-\tcd hgrepo &&\n-\n-\ttouch content &&\n-\thg add content &&\n-\n-\t> ../expected &&\n-\tauthor_test alpha \"\" \"H G Wells <wells@example.com>\" &&\n-\tauthor_test beta \"test\" \"test <unknown>\" &&\n-\tauthor_test beta \"test <test@example.com> (comment)\" \"test <test@example.com>\" &&\n-\tauthor_test gamma \"<test@example.com>\" \"Unknown <test@example.com>\" &&\n-\tauthor_test delta \"name<test@example.com>\" \"name <test@example.com>\" &&\n-\tauthor_test epsilon \"name <test@example.com\" \"name <test@example.com>\" &&\n-\tauthor_test zeta \" test \" \"test <unknown>\" &&\n-\tauthor_test eta \"test < test@example.com >\" \"test <test@example.com>\" &&\n-\tauthor_test theta \"test >test@example.com>\" \"test <test@example.com>\" &&\n-\tauthor_test iota \"test < test <at> example <dot> com>\" \"test <unknown>\" &&\n-\tauthor_test kappa \"test@example.com\" \"Unknown <test@example.com>\"\n-\t) &&\n-\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\tgit --git-dir=gitrepo/.git log --reverse --format=\"%an <%ae>\" > actual &&\n-\n-\ttest_cmp expected actual\n-'\n-\n-test_expect_success 'strip' '\n-\ttest_when_finished \"rm -rf hgrepo gitrepo\" &&\n-\n-\t(\n-\thg init hgrepo &&\n-\tcd hgrepo &&\n-\n-\techo one >> content &&\n-\thg add content &&\n-\thg commit -m one &&\n-\n-\techo two >> content &&\n-\thg commit -m two\n-\t) &&\n-\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\n-\t(\n-\tcd hgrepo &&\n-\thg strip 1 &&\n-\n-\techo three >> content &&\n-\thg commit -m three &&\n-\n-\techo four >> content &&\n-\thg commit -m four\n-\t) &&\n-\n-\t(\n-\tcd gitrepo &&\n-\tgit fetch &&\n-\tgit log --format=\"%s\" origin/master > ../actual\n-\t) &&\n-\n-\thg -R hgrepo log --template \"{desc}\\n\" > expected &&\n-\ttest_cmp actual expected\n-'\n-\n-test_expect_success 'remote push with master bookmark' '\n-\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n-\n-\t(\n-\thg init hgrepo &&\n-\tcd hgrepo &&\n-\techo zero > content &&\n-\thg add content &&\n-\thg commit -m zero &&\n-\thg bookmark master &&\n-\techo one > content &&\n-\thg commit -m one\n-\t) &&\n-\n-\t(\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\tcd gitrepo &&\n-\techo two > content &&\n-\tgit commit -a -m two &&\n-\tgit push\n-\t) &&\n-\n-\tcheck_branch hgrepo default two\n-'\n-\n-cat > expected <<EOF\n-changeset:   0:6e2126489d3d\n-tag:         tip\n-user:        A U Thor <author@example.com>\n-date:        Mon Jan 01 00:00:00 2007 +0230\n-summary:     one\n-\n-EOF\n-\n-test_expect_success 'remote push from master branch' '\n-\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n-\n-\thg init hgrepo &&\n-\n-\t(\n-\tgit init gitrepo &&\n-\tcd gitrepo &&\n-\tgit remote add origin \"hg::../hgrepo\" &&\n-\techo one > content &&\n-\tgit add content &&\n-\tgit commit -a -m one &&\n-\tgit push origin master\n-\t) &&\n-\n-\thg -R hgrepo log > actual &&\n-\tcat actual &&\n-\ttest_cmp expected actual &&\n-\n-\tcheck_branch hgrepo default one\n-'\n-\n-GIT_REMOTE_HG_TEST_REMOTE=1\n-export GIT_REMOTE_HG_TEST_REMOTE\n-\n-test_expect_success 'remote cloning' '\n-\ttest_when_finished \"rm -rf gitrepo*\" &&\n-\n-\t(\n-\thg init hgrepo &&\n-\tcd hgrepo &&\n-\techo zero > content &&\n-\thg add content &&\n-\thg commit -m zero\n-\t) &&\n-\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\tcheck gitrepo HEAD zero\n-'\n-\n-test_expect_success 'remote update bookmark' '\n-\ttest_when_finished \"rm -rf gitrepo*\" &&\n-\n-\t(\n-\tcd hgrepo &&\n-\thg bookmark devel\n-\t) &&\n-\n-\t(\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\tcd gitrepo &&\n-\tgit checkout --quiet devel &&\n-\techo devel > content &&\n-\tgit commit -a -m devel &&\n-\tgit push --quiet\n-\t) &&\n-\n-\tcheck_bookmark hgrepo devel devel\n-'\n-\n-test_expect_success 'remote new bookmark' '\n-\ttest_when_finished \"rm -rf gitrepo*\" &&\n-\n-\t(\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\tcd gitrepo &&\n-\tgit checkout --quiet -b feature-b &&\n-\techo feature-b > content &&\n-\tgit commit -a -m feature-b &&\n-\tgit push --quiet origin feature-b\n-\t) &&\n-\n-\tcheck_bookmark hgrepo feature-b feature-b\n-'\n-\n-test_expect_success 'remote push diverged' '\n-\ttest_when_finished \"rm -rf gitrepo*\" &&\n-\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\n-\t(\n-\tcd hgrepo &&\n-\thg checkout default &&\n-\techo bump > content &&\n-\thg commit -m bump\n-\t) &&\n-\n-\t(\n-\tcd gitrepo &&\n-\techo diverge > content &&\n-\tgit commit -a -m diverged &&\n-\tcheck_push 1 <<-EOF\n-\tmaster:non-fast-forward\n-\tEOF\n-\t) &&\n-\n-\tcheck_branch hgrepo default bump\n-'\n-\n-test_expect_success 'remote update bookmark diverge' '\n-\ttest_when_finished \"rm -rf gitrepo*\" &&\n-\n-\t(\n-\tcd hgrepo &&\n-\thg checkout tip^ &&\n-\thg bookmark diverge\n-\t) &&\n-\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\n-\t(\n-\tcd hgrepo &&\n-\techo \"bump bookmark\" > content &&\n-\thg commit -m \"bump bookmark\"\n-\t) &&\n-\n-\t(\n-\tcd gitrepo &&\n-\tgit checkout --quiet diverge &&\n-\techo diverge > content &&\n-\tgit commit -a -m diverge &&\n-\tcheck_push 1 <<-EOF\n-\tdiverge:fetch-first\n-\tEOF\n-\t) &&\n-\n-\tcheck_bookmark hgrepo diverge \"bump bookmark\"\n-'\n-\n-test_expect_success 'remote new bookmark multiple branch head' '\n-\ttest_when_finished \"rm -rf gitrepo*\" &&\n-\n-\t(\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\tcd gitrepo &&\n-\tgit checkout --quiet -b feature-c HEAD^ &&\n-\techo feature-c > content &&\n-\tgit commit -a -m feature-c &&\n-\tgit push --quiet origin feature-c\n-\t) &&\n-\n-\tcheck_bookmark hgrepo feature-c feature-c\n-'\n-\n-# cleanup previous stuff\n-rm -rf hgrepo\n-\n-setup_big_push () {\n-\t(\n-\thg init hgrepo &&\n-\tcd hgrepo &&\n-\techo zero > content &&\n-\thg add content &&\n-\thg commit -m zero &&\n-\thg bookmark bad_bmark1 &&\n-\techo one > content &&\n-\thg commit -m one &&\n-\thg bookmark bad_bmark2 &&\n-\thg bookmark good_bmark &&\n-\thg bookmark -i good_bmark &&\n-\thg -q branch good_branch &&\n-\techo \"good branch\" > content &&\n-\thg commit -m \"good branch\" &&\n-\thg -q branch bad_branch &&\n-\techo \"bad branch\" > content &&\n-\thg commit -m \"bad branch\"\n-\t) &&\n-\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\n-\t(\n-\tcd gitrepo &&\n-\techo two > content &&\n-\tgit commit -q -a -m two &&\n-\n-\tgit checkout -q good_bmark &&\n-\techo three > content &&\n-\tgit commit -q -a -m three &&\n-\n-\tgit checkout -q bad_bmark1 &&\n-\tgit reset --hard HEAD^ &&\n-\techo four > content &&\n-\tgit commit -q -a -m four &&\n-\n-\tgit checkout -q bad_bmark2 &&\n-\tgit reset --hard HEAD^ &&\n-\techo five > content &&\n-\tgit commit -q -a -m five &&\n-\n-\tgit checkout -q -b new_bmark master &&\n-\techo six > content &&\n-\tgit commit -q -a -m six &&\n-\n-\tgit checkout -q branches/good_branch &&\n-\techo seven > content &&\n-\tgit commit -q -a -m seven &&\n-\techo eight > content &&\n-\tgit commit -q -a -m eight &&\n-\n-\tgit checkout -q branches/bad_branch &&\n-\tgit reset --hard HEAD^ &&\n-\techo nine > content &&\n-\tgit commit -q -a -m nine &&\n-\n-\tgit checkout -q -b branches/new_branch master &&\n-\techo ten > content &&\n-\tgit commit -q -a -m ten\n-\t)\n-}\n-\n-test_expect_success 'remote big push' '\n-\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n-\n-\tsetup_big_push\n-\n-\t(\n-\tcd gitrepo &&\n-\n-\tcheck_push 1 --all <<-EOF\n-\tmaster\n-\tgood_bmark\n-\tbranches/good_branch\n-\tnew_bmark:new\n-\tbranches/new_branch:new\n-\tbad_bmark1:non-fast-forward\n-\tbad_bmark2:non-fast-forward\n-\tbranches/bad_branch:non-fast-forward\n-\tEOF\n-\t) &&\n-\n-\tcheck_branch hgrepo default one &&\n-\tcheck_branch hgrepo good_branch \"good branch\" &&\n-\tcheck_branch hgrepo bad_branch \"bad branch\" &&\n-\tcheck_branch hgrepo new_branch '' &&\n-\tcheck_bookmark hgrepo good_bmark one &&\n-\tcheck_bookmark hgrepo bad_bmark1 one &&\n-\tcheck_bookmark hgrepo bad_bmark2 one &&\n-\tcheck_bookmark hgrepo new_bmark ''\n-'\n-\n-test_expect_success 'remote big push fetch first' '\n-\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n-\n-\t(\n-\thg init hgrepo &&\n-\tcd hgrepo &&\n-\techo zero > content &&\n-\thg add content &&\n-\thg commit -m zero &&\n-\thg bookmark bad_bmark &&\n-\thg bookmark good_bmark &&\n-\thg bookmark -i good_bmark &&\n-\thg -q branch good_branch &&\n-\techo \"good branch\" > content &&\n-\thg commit -m \"good branch\" &&\n-\thg -q branch bad_branch &&\n-\techo \"bad branch\" > content &&\n-\thg commit -m \"bad branch\"\n-\t) &&\n-\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\n-\t(\n-\tcd hgrepo &&\n-\thg bookmark -f bad_bmark &&\n-\techo update_bmark > content &&\n-\thg commit -m \"update bmark\"\n-\t) &&\n-\n-\t(\n-\tcd gitrepo &&\n-\techo two > content &&\n-\tgit commit -q -a -m two &&\n-\n-\tgit checkout -q good_bmark &&\n-\techo three > content &&\n-\tgit commit -q -a -m three &&\n-\n-\tgit checkout -q bad_bmark &&\n-\techo four > content &&\n-\tgit commit -q -a -m four &&\n-\n-\tgit checkout -q branches/bad_branch &&\n-\techo five > content &&\n-\tgit commit -q -a -m five &&\n-\n-\tcheck_push 1 --all <<-EOF\n-\tmaster\n-\tgood_bmark\n-\tnew_bmark:new\n-\tnew_branch:new\n-\tbad_bmark:fetch-first\n-\tbranches/bad_branch:festch-first\n-\tEOF\n-\n-\tgit fetch &&\n-\n-\tcheck_push 1 --all <<-EOF\n-\tmaster\n-\tgood_bmark\n-\tbad_bmark:non-fast-forward\n-\tbranches/bad_branch:non-fast-forward\n-\tEOF\n-\t)\n-'\n-\n-test_expect_failure 'remote big push force' '\n-\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n-\n-\tsetup_big_push\n-\n-\t(\n-\tcd gitrepo &&\n-\n-\tcheck_push 0 --force --all <<-EOF\n-\tmaster\n-\tgood_bmark\n-\tbranches/good_branch\n-\tnew_bmark:new\n-\tbranches/new_branch:new\n-\tbad_bmark1:forced-update\n-\tbad_bmark2:forced-update\n-\tbranches/bad_branch:forced-update\n-\tEOF\n-\t) &&\n-\n-\tcheck_branch hgrepo default six &&\n-\tcheck_branch hgrepo good_branch eight &&\n-\tcheck_branch hgrepo bad_branch nine &&\n-\tcheck_branch hgrepo new_branch ten &&\n-\tcheck_bookmark hgrepo good_bmark three &&\n-\tcheck_bookmark hgrepo bad_bmark1 four &&\n-\tcheck_bookmark hgrepo bad_bmark2 five &&\n-\tcheck_bookmark hgrepo new_bmark six\n-'\n-\n-test_expect_failure 'remote big push dry-run' '\n-\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n-\n-\tsetup_big_push\n-\n-\t(\n-\tcd gitrepo &&\n-\n-\tcheck_push 0 --dry-run --all <<-EOF\n-\tmaster\n-\tgood_bmark\n-\tbranches/good_branch\n-\tnew_bmark:new\n-\tbranches/new_branch:new\n-\tbad_bmark1:non-fast-forward\n-\tbad_bmark2:non-fast-forward\n-\tbranches/bad_branch:non-fast-forward\n-\tEOF\n-\n-\tcheck_push 0 --dry-run master good_bmark new_bmark branches/good_branch branches/new_branch <<-EOF\n-\tmaster\n-\tgood_bmark\n-\tbranches/good_branch\n-\tnew_bmark:new\n-\tbranches/new_branch:new\n-\tEOF\n-\t) &&\n-\n-\tcheck_branch hgrepo default one &&\n-\tcheck_branch hgrepo good_branch \"good branch\" &&\n-\tcheck_branch hgrepo bad_branch \"bad branch\" &&\n-\tcheck_branch hgrepo new_branch '' &&\n-\tcheck_bookmark hgrepo good_bmark one &&\n-\tcheck_bookmark hgrepo bad_bmark1 one &&\n-\tcheck_bookmark hgrepo bad_bmark2 one &&\n-\tcheck_bookmark hgrepo new_bmark ''\n-'\n-\n-test_expect_success 'remote double failed push' '\n-\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n-\n-\t(\n-\thg init hgrepo &&\n-\tcd hgrepo &&\n-\techo zero > content &&\n-\thg add content &&\n-\thg commit -m zero &&\n-\techo one > content &&\n-\thg commit -m one\n-\t) &&\n-\n-\t(\n-\tgit clone \"hg::hgrepo\" gitrepo &&\n-\tcd gitrepo &&\n-\tgit reset --hard HEAD^ &&\n-\techo two > content &&\n-\tgit commit -a -m two &&\n-\ttest_expect_code 1 git push &&\n-\ttest_expect_code 1 git push\n-\t)\n-'\n-\n-test_done\ndiff --git a/contrib/remote-helpers/test-hg.t b/contrib/remote-helpers/test-hg.t\nnew file mode 100755\nindex 0000000..30f4ff6\n--- /dev/null\n+++ b/contrib/remote-helpers/test-hg.t\n@@ -0,0 +1,692 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2012 Felipe Contreras\n+#\n+# Base commands from hg-git tests:\n+# https://bitbucket.org/durin42/hg-git/src\n+#\n+\n+test_description='Test remote-hg'\n+\n+. ./test-lib.sh\n+\n+if ! test_have_prereq PYTHON; then\n+\tskip_all='skipping remote-hg tests; python not available'\n+\ttest_done\n+fi\n+\n+if ! \"$PYTHON_PATH\" -c 'import mercurial'; then\n+\tskip_all='skipping remote-hg tests; mercurial not available'\n+\ttest_done\n+fi\n+\n+check () {\n+\techo $3 > expected &&\n+\tgit --git-dir=$1/.git log --format='%s' -1 $2 > actual\n+\ttest_cmp expected actual\n+}\n+\n+check_branch () {\n+\tif [ -n \"$3\" ]; then\n+\t\techo $3 > expected &&\n+\t\thg -R $1 log -r $2 --template '{desc}\\n' > actual &&\n+\t\ttest_cmp expected actual\n+\telse\n+\t\thg -R $1 branches > out &&\n+\t\t! grep $2 out\n+\tfi\n+}\n+\n+check_bookmark () {\n+\tif [ -n \"$3\" ]; then\n+\t\techo $3 > expected &&\n+\t\thg -R $1 log -r \"bookmark('$2')\" --template '{desc}\\n' > actual &&\n+\t\ttest_cmp expected actual\n+\telse\n+\t\thg -R $1 bookmarks > out &&\n+\t\t! grep $2 out\n+\tfi\n+}\n+\n+check_push () {\n+\tlocal expected_ret=$1 ret=0 ref_ret=0 IFS=':'\n+\n+\tshift\n+\tgit push origin \"$@\" 2> error\n+\tret=$?\n+\tcat error\n+\n+\twhile read branch kind\n+\tdo\n+\t\tcase \"$kind\" in\n+\t\t'new')\n+\t\t\tgrep \"^ \\* \\[new branch\\] *${branch} -> ${branch}$\" error || ref_ret=1\n+\t\t\t;;\n+\t\t'non-fast-forward')\n+\t\t\tgrep \"^ ! \\[rejected\\] *${branch} -> ${branch} (non-fast-forward)$\" error || ref_ret=1\n+\t\t\t;;\n+\t\t'fetch-first')\n+\t\t\tgrep \"^ ! \\[rejected\\] *${branch} -> ${branch} (fetch first)$\" error || ref_ret=1\n+\t\t\t;;\n+\t\t'forced-update')\n+\t\t\tgrep \"^ + [a-f0-9]*\\.\\.\\.[a-f0-9]* *${branch} -> ${branch} (forced update)$\" error || ref_ret=1\n+\t\t\t;;\n+\t\t'')\n+\t\t\tgrep \"^   [a-f0-9]*\\.\\.[a-f0-9]* *${branch} -> ${branch}$\" error || ref_ret=1\n+\t\t\t;;\n+\t\tesac\n+\t\tlet 'ref_ret' && echo \"match for '$branch' failed\" && break\n+\tdone\n+\n+\tif let 'expected_ret != ret || ref_ret'\n+\tthen\n+\t\treturn 1\n+\tfi\n+\n+\treturn 0\n+}\n+\n+setup () {\n+\t(\n+\techo \"[ui]\"\n+\techo \"username = H G Wells <wells@example.com>\"\n+\techo \"[extensions]\"\n+\techo \"mq =\"\n+\t) >> \"$HOME\"/.hgrc &&\n+\n+\tGIT_AUTHOR_DATE=\"2007-01-01 00:00:00 +0230\" &&\n+\tGIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\" &&\n+\texport GIT_COMMITTER_DATE GIT_AUTHOR_DATE\n+}\n+\n+setup\n+\n+test_expect_success 'cloning' '\n+\ttest_when_finished \"rm -rf gitrepo*\" &&\n+\n+\t(\n+\thg init hgrepo &&\n+\tcd hgrepo &&\n+\techo zero > content &&\n+\thg add content &&\n+\thg commit -m zero\n+\t) &&\n+\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\tcheck gitrepo HEAD zero\n+'\n+\n+test_expect_success 'cloning with branches' '\n+\ttest_when_finished \"rm -rf gitrepo*\" &&\n+\n+\t(\n+\tcd hgrepo &&\n+\thg branch next &&\n+\techo next > content &&\n+\thg commit -m next\n+\t) &&\n+\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\tcheck gitrepo origin/branches/next next\n+'\n+\n+test_expect_success 'cloning with bookmarks' '\n+\ttest_when_finished \"rm -rf gitrepo*\" &&\n+\n+\t(\n+\tcd hgrepo &&\n+\thg checkout default &&\n+\thg bookmark feature-a &&\n+\techo feature-a > content &&\n+\thg commit -m feature-a\n+\t) &&\n+\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\tcheck gitrepo origin/feature-a feature-a\n+'\n+\n+test_expect_success 'update bookmark' '\n+\ttest_when_finished \"rm -rf gitrepo*\" &&\n+\n+\t(\n+\tcd hgrepo &&\n+\thg bookmark devel\n+\t) &&\n+\n+\t(\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\tcd gitrepo &&\n+\tgit checkout --quiet devel &&\n+\techo devel > content &&\n+\tgit commit -a -m devel &&\n+\tgit push --quiet\n+\t) &&\n+\n+\tcheck_bookmark hgrepo devel devel\n+'\n+\n+test_expect_success 'new bookmark' '\n+\ttest_when_finished \"rm -rf gitrepo*\" &&\n+\n+\t(\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\tcd gitrepo &&\n+\tgit checkout --quiet -b feature-b &&\n+\techo feature-b > content &&\n+\tgit commit -a -m feature-b &&\n+\tgit push --quiet origin feature-b\n+\t) &&\n+\n+\tcheck_bookmark hgrepo feature-b feature-b\n+'\n+\n+# cleanup previous stuff\n+rm -rf hgrepo\n+\n+author_test () {\n+\techo $1 >> content &&\n+\thg commit -u \"$2\" -m \"add $1\" &&\n+\techo \"$3\" >> ../expected\n+}\n+\n+test_expect_success 'authors' '\n+\ttest_when_finished \"rm -rf hgrepo gitrepo\" &&\n+\n+\t(\n+\thg init hgrepo &&\n+\tcd hgrepo &&\n+\n+\ttouch content &&\n+\thg add content &&\n+\n+\t> ../expected &&\n+\tauthor_test alpha \"\" \"H G Wells <wells@example.com>\" &&\n+\tauthor_test beta \"test\" \"test <unknown>\" &&\n+\tauthor_test beta \"test <test@example.com> (comment)\" \"test <test@example.com>\" &&\n+\tauthor_test gamma \"<test@example.com>\" \"Unknown <test@example.com>\" &&\n+\tauthor_test delta \"name<test@example.com>\" \"name <test@example.com>\" &&\n+\tauthor_test epsilon \"name <test@example.com\" \"name <test@example.com>\" &&\n+\tauthor_test zeta \" test \" \"test <unknown>\" &&\n+\tauthor_test eta \"test < test@example.com >\" \"test <test@example.com>\" &&\n+\tauthor_test theta \"test >test@example.com>\" \"test <test@example.com>\" &&\n+\tauthor_test iota \"test < test <at> example <dot> com>\" \"test <unknown>\" &&\n+\tauthor_test kappa \"test@example.com\" \"Unknown <test@example.com>\"\n+\t) &&\n+\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\tgit --git-dir=gitrepo/.git log --reverse --format=\"%an <%ae>\" > actual &&\n+\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'strip' '\n+\ttest_when_finished \"rm -rf hgrepo gitrepo\" &&\n+\n+\t(\n+\thg init hgrepo &&\n+\tcd hgrepo &&\n+\n+\techo one >> content &&\n+\thg add content &&\n+\thg commit -m one &&\n+\n+\techo two >> content &&\n+\thg commit -m two\n+\t) &&\n+\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\n+\t(\n+\tcd hgrepo &&\n+\thg strip 1 &&\n+\n+\techo three >> content &&\n+\thg commit -m three &&\n+\n+\techo four >> content &&\n+\thg commit -m four\n+\t) &&\n+\n+\t(\n+\tcd gitrepo &&\n+\tgit fetch &&\n+\tgit log --format=\"%s\" origin/master > ../actual\n+\t) &&\n+\n+\thg -R hgrepo log --template \"{desc}\\n\" > expected &&\n+\ttest_cmp actual expected\n+'\n+\n+test_expect_success 'remote push with master bookmark' '\n+\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n+\n+\t(\n+\thg init hgrepo &&\n+\tcd hgrepo &&\n+\techo zero > content &&\n+\thg add content &&\n+\thg commit -m zero &&\n+\thg bookmark master &&\n+\techo one > content &&\n+\thg commit -m one\n+\t) &&\n+\n+\t(\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\tcd gitrepo &&\n+\techo two > content &&\n+\tgit commit -a -m two &&\n+\tgit push\n+\t) &&\n+\n+\tcheck_branch hgrepo default two\n+'\n+\n+cat > expected <<EOF\n+changeset:   0:6e2126489d3d\n+tag:         tip\n+user:        A U Thor <author@example.com>\n+date:        Mon Jan 01 00:00:00 2007 +0230\n+summary:     one\n+\n+EOF\n+\n+test_expect_success 'remote push from master branch' '\n+\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n+\n+\thg init hgrepo &&\n+\n+\t(\n+\tgit init gitrepo &&\n+\tcd gitrepo &&\n+\tgit remote add origin \"hg::../hgrepo\" &&\n+\techo one > content &&\n+\tgit add content &&\n+\tgit commit -a -m one &&\n+\tgit push origin master\n+\t) &&\n+\n+\thg -R hgrepo log > actual &&\n+\tcat actual &&\n+\ttest_cmp expected actual &&\n+\n+\tcheck_branch hgrepo default one\n+'\n+\n+GIT_REMOTE_HG_TEST_REMOTE=1\n+export GIT_REMOTE_HG_TEST_REMOTE\n+\n+test_expect_success 'remote cloning' '\n+\ttest_when_finished \"rm -rf gitrepo*\" &&\n+\n+\t(\n+\thg init hgrepo &&\n+\tcd hgrepo &&\n+\techo zero > content &&\n+\thg add content &&\n+\thg commit -m zero\n+\t) &&\n+\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\tcheck gitrepo HEAD zero\n+'\n+\n+test_expect_success 'remote update bookmark' '\n+\ttest_when_finished \"rm -rf gitrepo*\" &&\n+\n+\t(\n+\tcd hgrepo &&\n+\thg bookmark devel\n+\t) &&\n+\n+\t(\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\tcd gitrepo &&\n+\tgit checkout --quiet devel &&\n+\techo devel > content &&\n+\tgit commit -a -m devel &&\n+\tgit push --quiet\n+\t) &&\n+\n+\tcheck_bookmark hgrepo devel devel\n+'\n+\n+test_expect_success 'remote new bookmark' '\n+\ttest_when_finished \"rm -rf gitrepo*\" &&\n+\n+\t(\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\tcd gitrepo &&\n+\tgit checkout --quiet -b feature-b &&\n+\techo feature-b > content &&\n+\tgit commit -a -m feature-b &&\n+\tgit push --quiet origin feature-b\n+\t) &&\n+\n+\tcheck_bookmark hgrepo feature-b feature-b\n+'\n+\n+test_expect_success 'remote push diverged' '\n+\ttest_when_finished \"rm -rf gitrepo*\" &&\n+\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\n+\t(\n+\tcd hgrepo &&\n+\thg checkout default &&\n+\techo bump > content &&\n+\thg commit -m bump\n+\t) &&\n+\n+\t(\n+\tcd gitrepo &&\n+\techo diverge > content &&\n+\tgit commit -a -m diverged &&\n+\tcheck_push 1 <<-EOF\n+\tmaster:non-fast-forward\n+\tEOF\n+\t) &&\n+\n+\tcheck_branch hgrepo default bump\n+'\n+\n+test_expect_success 'remote update bookmark diverge' '\n+\ttest_when_finished \"rm -rf gitrepo*\" &&\n+\n+\t(\n+\tcd hgrepo &&\n+\thg checkout tip^ &&\n+\thg bookmark diverge\n+\t) &&\n+\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\n+\t(\n+\tcd hgrepo &&\n+\techo \"bump bookmark\" > content &&\n+\thg commit -m \"bump bookmark\"\n+\t) &&\n+\n+\t(\n+\tcd gitrepo &&\n+\tgit checkout --quiet diverge &&\n+\techo diverge > content &&\n+\tgit commit -a -m diverge &&\n+\tcheck_push 1 <<-EOF\n+\tdiverge:fetch-first\n+\tEOF\n+\t) &&\n+\n+\tcheck_bookmark hgrepo diverge \"bump bookmark\"\n+'\n+\n+test_expect_success 'remote new bookmark multiple branch head' '\n+\ttest_when_finished \"rm -rf gitrepo*\" &&\n+\n+\t(\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\tcd gitrepo &&\n+\tgit checkout --quiet -b feature-c HEAD^ &&\n+\techo feature-c > content &&\n+\tgit commit -a -m feature-c &&\n+\tgit push --quiet origin feature-c\n+\t) &&\n+\n+\tcheck_bookmark hgrepo feature-c feature-c\n+'\n+\n+# cleanup previous stuff\n+rm -rf hgrepo\n+\n+setup_big_push () {\n+\t(\n+\thg init hgrepo &&\n+\tcd hgrepo &&\n+\techo zero > content &&\n+\thg add content &&\n+\thg commit -m zero &&\n+\thg bookmark bad_bmark1 &&\n+\techo one > content &&\n+\thg commit -m one &&\n+\thg bookmark bad_bmark2 &&\n+\thg bookmark good_bmark &&\n+\thg bookmark -i good_bmark &&\n+\thg -q branch good_branch &&\n+\techo \"good branch\" > content &&\n+\thg commit -m \"good branch\" &&\n+\thg -q branch bad_branch &&\n+\techo \"bad branch\" > content &&\n+\thg commit -m \"bad branch\"\n+\t) &&\n+\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\n+\t(\n+\tcd gitrepo &&\n+\techo two > content &&\n+\tgit commit -q -a -m two &&\n+\n+\tgit checkout -q good_bmark &&\n+\techo three > content &&\n+\tgit commit -q -a -m three &&\n+\n+\tgit checkout -q bad_bmark1 &&\n+\tgit reset --hard HEAD^ &&\n+\techo four > content &&\n+\tgit commit -q -a -m four &&\n+\n+\tgit checkout -q bad_bmark2 &&\n+\tgit reset --hard HEAD^ &&\n+\techo five > content &&\n+\tgit commit -q -a -m five &&\n+\n+\tgit checkout -q -b new_bmark master &&\n+\techo six > content &&\n+\tgit commit -q -a -m six &&\n+\n+\tgit checkout -q branches/good_branch &&\n+\techo seven > content &&\n+\tgit commit -q -a -m seven &&\n+\techo eight > content &&\n+\tgit commit -q -a -m eight &&\n+\n+\tgit checkout -q branches/bad_branch &&\n+\tgit reset --hard HEAD^ &&\n+\techo nine > content &&\n+\tgit commit -q -a -m nine &&\n+\n+\tgit checkout -q -b branches/new_branch master &&\n+\techo ten > content &&\n+\tgit commit -q -a -m ten\n+\t)\n+}\n+\n+test_expect_success 'remote big push' '\n+\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n+\n+\tsetup_big_push\n+\n+\t(\n+\tcd gitrepo &&\n+\n+\tcheck_push 1 --all <<-EOF\n+\tmaster\n+\tgood_bmark\n+\tbranches/good_branch\n+\tnew_bmark:new\n+\tbranches/new_branch:new\n+\tbad_bmark1:non-fast-forward\n+\tbad_bmark2:non-fast-forward\n+\tbranches/bad_branch:non-fast-forward\n+\tEOF\n+\t) &&\n+\n+\tcheck_branch hgrepo default one &&\n+\tcheck_branch hgrepo good_branch \"good branch\" &&\n+\tcheck_branch hgrepo bad_branch \"bad branch\" &&\n+\tcheck_branch hgrepo new_branch '' &&\n+\tcheck_bookmark hgrepo good_bmark one &&\n+\tcheck_bookmark hgrepo bad_bmark1 one &&\n+\tcheck_bookmark hgrepo bad_bmark2 one &&\n+\tcheck_bookmark hgrepo new_bmark ''\n+'\n+\n+test_expect_success 'remote big push fetch first' '\n+\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n+\n+\t(\n+\thg init hgrepo &&\n+\tcd hgrepo &&\n+\techo zero > content &&\n+\thg add content &&\n+\thg commit -m zero &&\n+\thg bookmark bad_bmark &&\n+\thg bookmark good_bmark &&\n+\thg bookmark -i good_bmark &&\n+\thg -q branch good_branch &&\n+\techo \"good branch\" > content &&\n+\thg commit -m \"good branch\" &&\n+\thg -q branch bad_branch &&\n+\techo \"bad branch\" > content &&\n+\thg commit -m \"bad branch\"\n+\t) &&\n+\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\n+\t(\n+\tcd hgrepo &&\n+\thg bookmark -f bad_bmark &&\n+\techo update_bmark > content &&\n+\thg commit -m \"update bmark\"\n+\t) &&\n+\n+\t(\n+\tcd gitrepo &&\n+\techo two > content &&\n+\tgit commit -q -a -m two &&\n+\n+\tgit checkout -q good_bmark &&\n+\techo three > content &&\n+\tgit commit -q -a -m three &&\n+\n+\tgit checkout -q bad_bmark &&\n+\techo four > content &&\n+\tgit commit -q -a -m four &&\n+\n+\tgit checkout -q branches/bad_branch &&\n+\techo five > content &&\n+\tgit commit -q -a -m five &&\n+\n+\tcheck_push 1 --all <<-EOF\n+\tmaster\n+\tgood_bmark\n+\tnew_bmark:new\n+\tnew_branch:new\n+\tbad_bmark:fetch-first\n+\tbranches/bad_branch:festch-first\n+\tEOF\n+\n+\tgit fetch &&\n+\n+\tcheck_push 1 --all <<-EOF\n+\tmaster\n+\tgood_bmark\n+\tbad_bmark:non-fast-forward\n+\tbranches/bad_branch:non-fast-forward\n+\tEOF\n+\t)\n+'\n+\n+test_expect_failure 'remote big push force' '\n+\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n+\n+\tsetup_big_push\n+\n+\t(\n+\tcd gitrepo &&\n+\n+\tcheck_push 0 --force --all <<-EOF\n+\tmaster\n+\tgood_bmark\n+\tbranches/good_branch\n+\tnew_bmark:new\n+\tbranches/new_branch:new\n+\tbad_bmark1:forced-update\n+\tbad_bmark2:forced-update\n+\tbranches/bad_branch:forced-update\n+\tEOF\n+\t) &&\n+\n+\tcheck_branch hgrepo default six &&\n+\tcheck_branch hgrepo good_branch eight &&\n+\tcheck_branch hgrepo bad_branch nine &&\n+\tcheck_branch hgrepo new_branch ten &&\n+\tcheck_bookmark hgrepo good_bmark three &&\n+\tcheck_bookmark hgrepo bad_bmark1 four &&\n+\tcheck_bookmark hgrepo bad_bmark2 five &&\n+\tcheck_bookmark hgrepo new_bmark six\n+'\n+\n+test_expect_failure 'remote big push dry-run' '\n+\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n+\n+\tsetup_big_push\n+\n+\t(\n+\tcd gitrepo &&\n+\n+\tcheck_push 0 --dry-run --all <<-EOF\n+\tmaster\n+\tgood_bmark\n+\tbranches/good_branch\n+\tnew_bmark:new\n+\tbranches/new_branch:new\n+\tbad_bmark1:non-fast-forward\n+\tbad_bmark2:non-fast-forward\n+\tbranches/bad_branch:non-fast-forward\n+\tEOF\n+\n+\tcheck_push 0 --dry-run master good_bmark new_bmark branches/good_branch branches/new_branch <<-EOF\n+\tmaster\n+\tgood_bmark\n+\tbranches/good_branch\n+\tnew_bmark:new\n+\tbranches/new_branch:new\n+\tEOF\n+\t) &&\n+\n+\tcheck_branch hgrepo default one &&\n+\tcheck_branch hgrepo good_branch \"good branch\" &&\n+\tcheck_branch hgrepo bad_branch \"bad branch\" &&\n+\tcheck_branch hgrepo new_branch '' &&\n+\tcheck_bookmark hgrepo good_bmark one &&\n+\tcheck_bookmark hgrepo bad_bmark1 one &&\n+\tcheck_bookmark hgrepo bad_bmark2 one &&\n+\tcheck_bookmark hgrepo new_bmark ''\n+'\n+\n+test_expect_success 'remote double failed push' '\n+\ttest_when_finished \"rm -rf hgrepo gitrepo*\" &&\n+\n+\t(\n+\thg init hgrepo &&\n+\tcd hgrepo &&\n+\techo zero > content &&\n+\thg add content &&\n+\thg commit -m zero &&\n+\techo one > content &&\n+\thg commit -m one\n+\t) &&\n+\n+\t(\n+\tgit clone \"hg::hgrepo\" gitrepo &&\n+\tcd gitrepo &&\n+\tgit reset --hard HEAD^ &&\n+\techo two > content &&\n+\tgit commit -a -m two &&\n+\ttest_expect_code 1 git push &&\n+\ttest_expect_code 1 git push\n+\t)\n+'\n+\n+test_done\n-- \n1.8.4-fc\n"},{"id":"228788","messageId":"1381561465-20147-5-git-send-email-felipe.contreras@gmail.com","threadId":"35118","inReplyTo":"1381561465-20147-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 2/5] build: fix installation of scripts","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-10-12T07:04:24Z","receivedAt":"2013-10-12T07:04:24Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"They need the gitexecdir.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3588ca1..e51b92e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -511,12 +511,14 @@ build-perl-script: $(SCRIPT_PERL_GEN)\n build-sh-script: $(SCRIPT_SH_GEN)\n build-python-script: $(SCRIPT_PYTHON_GEN)\n \n-.PHONY: install-perl-script install-sh-script install-python-script\n-install-sh-script: $(SCRIPT_SH_INS)\n+.PHONY: install-gitexecdir install-perl-script install-sh-script install-python-script\n+install-gitexecdir:\n+\t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n+install-sh-script: $(SCRIPT_SH_INS) | install-gitexecdir\n \t$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n-install-perl-script: $(SCRIPT_PERL_INS)\n+install-perl-script: $(SCRIPT_PERL_INS) | install-gitexecdir\n \t$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n-install-python-script: $(SCRIPT_PYTHON_INS)\n+install-python-script: $(SCRIPT_PYTHON_INS) | install-gitexecdir\n \t$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n \n .PHONY: clean-perl-script clean-sh-script clean-python-script\n-- \n1.8.4-fc\n"}]}