From fe45cfb518f7cb313051986e03c402bc206e55af Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Wed, 9 Apr 2014 13:50:00 -0500 Subject: remote-helpers: allow all tests running from any dir Commit d3243d7 (test-bzr.sh, test-hg.sh: allow running from any dir) allowed the tests to run from any directory, however, it didn't update all the tests. Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano diff --git a/contrib/remote-helpers/test-hg-bidi.sh b/contrib/remote-helpers/test-hg-bidi.sh index e24c51d..d86e147 100755 --- a/contrib/remote-helpers/test-hg-bidi.sh +++ b/contrib/remote-helpers/test-hg-bidi.sh @@ -8,7 +8,8 @@ test_description='Test bidirectionality of remote-hg' -. ./test-lib.sh +test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t +. "$TEST_DIRECTORY"/test-lib.sh if ! test_have_prereq PYTHON then diff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh index 6dcd95d..b23909a 100755 --- a/contrib/remote-helpers/test-hg-hg-git.sh +++ b/contrib/remote-helpers/test-hg-hg-git.sh @@ -8,7 +8,8 @@ test_description='Test remote-hg output compared to hg-git' -. ./test-lib.sh +test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t +. "$TEST_DIRECTORY"/test-lib.sh if ! test_have_prereq PYTHON then -- cgit v0.10.2-6-g49f6 From 867bf7b490d6a4bd19b6f9ff7d30af654e9df276 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Wed, 9 Apr 2014 13:50:01 -0500 Subject: remote-hg: always normalize paths Apparently Mercurial can have paths such as 'foo//bar', so normalize all paths. Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index eb89ef6..84e3872 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -260,6 +260,7 @@ class Parser: return (user, int(date), -tz) def fix_file_path(path): + path = os.path.normpath(path) if not os.path.isabs(path): return path return os.path.relpath(path, '/') -- cgit v0.10.2-6-g49f6 From 5ff569908dd6e174c2d81df8e25ecc8af34fc5a8 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Wed, 9 Apr 2014 13:50:02 -0500 Subject: remote-bzr: add support for older versions Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr index 332aba7..7f354c8 100755 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@ -759,7 +759,7 @@ def clone(path, remote_branch): def get_remote_branch(name): remote_branch = bzrlib.branch.Branch.open(branches[name], possible_transports=transports) - if isinstance(remote_branch.user_transport, bzrlib.transport.local.LocalTransport): + if isinstance(remote_branch.bzrdir.root_transport, bzrlib.transport.local.LocalTransport): return remote_branch branch_path = os.path.join(dirname, 'clone', name) @@ -842,7 +842,7 @@ def get_repo(url, alias): if not wanted: try: repo = origin.open_repository() - if not repo.user_transport.listable(): + if not repo.bzrdir.root_transport.listable(): # this repository is not usable for us raise bzrlib.errors.NoRepositoryPresent(repo.bzrdir) except bzrlib.errors.NoRepositoryPresent: -- cgit v0.10.2-6-g49f6 From 62210887f783d942ddfa918b3974b42311d3ef9d Mon Sep 17 00:00:00 2001 From: dequis Date: Wed, 9 Apr 2014 13:50:03 -0500 Subject: remote-bzr: include authors field in pushed commits Tests-by: Felipe Contreras Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr index 7f354c8..6ca1e97 100755 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@ -618,10 +618,12 @@ def parse_commit(parser): files[path] = f committer, date, tz = committer + author, _, _ = author parents = [mark_to_rev(p) for p in parents] revid = bzrlib.generate_ids.gen_revision_id(committer, date) props = {} props['branch-nick'] = branch.nick + props['authors'] = author mtree = CustomTree(branch, revid, parents, files) changes = mtree.iter_changes() diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh index 1e53ff9..11a6e18 100755 --- a/contrib/remote-helpers/test-bzr.sh +++ b/contrib/remote-helpers/test-bzr.sh @@ -391,4 +391,28 @@ test_expect_success 'export utf-8 authors' ' test_cmp expected actual ' +test_expect_success 'push different author' ' + test_when_finished "rm -rf bzrrepo gitrepo" && + + bzr init bzrrepo && + + ( + git init gitrepo && + cd gitrepo && + echo john >> content && + git add content && + git commit -m john --author "John Doe " && + git remote add bzr "bzr::../bzrrepo" && + git push bzr master + ) && + + ( + cd bzrrepo && + bzr log | grep "^author: " > ../actual + ) && + + echo "author: John Doe " > expected && + test_cmp expected actual +' + test_done -- cgit v0.10.2-6-g49f6 From 7569accf41d28a3ede684ef96bf6edece5f06ce9 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 11 Apr 2014 18:24:05 -0500 Subject: remote-bzr: trivial test fix So that the committer is reset properly. Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh index 11a6e18..5d2c5b2 100755 --- a/contrib/remote-helpers/test-bzr.sh +++ b/contrib/remote-helpers/test-bzr.sh @@ -362,7 +362,7 @@ test_expect_success 'strip' ' ' test_expect_success 'export utf-8 authors' ' - test_when_finished "rm -rf bzrrepo gitrepo && LC_ALL=C && unset GIT_COMMITTER_NAME" && + test_when_finished "rm -rf bzrrepo gitrepo && LC_ALL=C && GIT_COMMITTER_NAME=\"C O Mitter\"" LC_ALL=en_US.UTF-8 export LC_ALL -- cgit v0.10.2-6-g49f6