allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [6/7] allura git commit: [#7830] ticket:744 Use full_fs_path instead of clone_url for merge
Date Fri, 20 Mar 2015 20:41:59 GMT
[#7830] ticket:744 Use full_fs_path instead of clone_url for merge


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/88742194
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/88742194
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/88742194

Branch: refs/heads/master
Commit: 88742194f5bc56370d1cfea28bf163a314e9cf68
Parents: 2b4f69f
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Mar 6 10:08:34 2015 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Mar 20 20:40:30 2015 +0000

----------------------------------------------------------------------
 ForgeGit/forgegit/model/git_repo.py              | 6 +++---
 ForgeGit/forgegit/tests/model/test_repository.py | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/88742194/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 831da5b..62e0604 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -103,7 +103,7 @@ class Repository(M.Repository):
         g = self._impl._git.git
         # http://stackoverflow.com/a/6283843
         # fetch source branch
-        g.fetch(mr.downstream_repo_url, mr.source_branch)
+        g.fetch(mr.downstream_repo.full_fs_path, mr.source_branch)
         # find merge base
         merge_base = g.merge_base(mr.downstream.commit_id, mr.target_branch)
         # print out merge result, but don't actually touch anything
@@ -116,13 +116,13 @@ class Repository(M.Repository):
         # can't merge in bare repo, so need to clone
         tmp_path = tempfile.mkdtemp()
         tmp_repo = git.Repo.clone_from(
-            self.clone_url('rw'),
+            self.full_fs_path,
             to_path=tmp_path,
             bare=False)
         tmp_repo = GitImplementation(Object(full_fs_path=tmp_path))._git
         tmp_repo.git.fetch('origin', mr.target_branch)
         tmp_repo.git.checkout(mr.target_branch)
-        tmp_repo.git.fetch(mr.downstream_repo_url, mr.source_branch)
+        tmp_repo.git.fetch(mr.downstream_repo.full_fs_path, mr.source_branch)
         tmp_repo.git.merge(mr.downstream.commit_id)
         tmp_repo.git.push('origin', mr.target_branch)
         shutil.rmtree(tmp_path, ignore_errors=True)

http://git-wip-us.apache.org/repos/asf/allura/blob/88742194/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index d79fc7b..325a6ea 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -593,7 +593,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
         assert_equals(payload, expected_payload)
 
     def test_can_merge(self):
-        mr = mock.Mock(downstream_repo_url='downstream-url',
+        mr = mock.Mock(downstream_repo=Object(full_fs_path='downstream-url'),
                        source_branch='source-branch',
                        target_branch='target-branch',
                        downstream=mock.Mock(commit_id='cid'))
@@ -615,7 +615,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
     @mock.patch('forgegit.model.git_repo.GitImplementation', autospec=True)
     @mock.patch('forgegit.model.git_repo.shutil', autospec=True)
     def test_merge(self, shutil, GitImplementation, git, tempfile):
-        mr = mock.Mock(downstream_repo_url='downstream-url',
+        mr = mock.Mock(downstream_repo=Object(full_fs_path='downstream-url'),
                        source_branch='source-branch',
                        target_branch='target-branch',
                        downstream=mock.Mock(commit_id='cid'))
@@ -623,7 +623,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
         self.repo._impl._git.git = _git
         self.repo.merge(mr)
         git.Repo.clone_from.assert_called_once_with(
-            self.repo.clone_url('rw'),
+            self.repo.full_fs_path,
             to_path=tempfile.mkdtemp.return_value,
             bare=False)
         tmp_repo = GitImplementation.return_value._git


Mime
View raw message