Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 17087DDCD for ; Thu, 1 Nov 2012 19:51:25 +0000 (UTC) Received: (qmail 86184 invoked by uid 500); 1 Nov 2012 19:51:25 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 86161 invoked by uid 500); 1 Nov 2012 19:51:25 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 85877 invoked by uid 99); 1 Nov 2012 19:51:24 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Nov 2012 19:51:24 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 49CD4518EE; Thu, 1 Nov 2012 19:51:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: brondsem@apache.org To: allura-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [14/15] git commit: [#5076] Removed _copy_hooks from ForgeGit (moved to ForgeClassic) Message-Id: <20121101195124.49CD4518EE@tyr.zones.apache.org> Date: Thu, 1 Nov 2012 19:51:24 +0000 (UTC) [#5076] Removed _copy_hooks from ForgeGit (moved to ForgeClassic) Signed-off-by: Cory Johns Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/3c462c70 Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/3c462c70 Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/3c462c70 Branch: refs/heads/db/5080 Commit: 3c462c708a41fa8c0015f960f0afbc8e70c51bab Parents: db4407b Author: Cory Johns Authored: Thu Oct 25 18:02:30 2012 +0000 Committer: Cory Johns Committed: Mon Oct 29 20:08:19 2012 +0000 ---------------------------------------------------------------------- ForgeGit/forgegit/model/git_repo.py | 14 -------------- ForgeGit/forgegit/tests/model/test_repository.py | 10 ++-------- 2 files changed, 2 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3c462c70/ForgeGit/forgegit/model/git_repo.py ---------------------------------------------------------------------- diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py index 68887af..416b931 100644 --- a/ForgeGit/forgegit/model/git_repo.py +++ b/ForgeGit/forgegit/model/git_repo.py @@ -260,22 +260,8 @@ class GitImplementation(M.RepositoryImplementation): def blob_size(self, blob): return self._object(blob._id).data_stream.size - def _copy_hooks(self, source_path): - '''Copy existing hooks if source path is given and exists.''' - if source_path is None or not os.path.exists(source_path): - return - for hook in glob(os.path.join(source_path, 'hooks/*')): - filename = os.path.basename(hook) - target_filename = filename - if filename == 'post-receive': - target_filename = 'post-receive-user' - target = os.path.join(self._repo.full_fs_path, 'hooks', target_filename) - shutil.copy2(hook, target) - def _setup_hooks(self, source_path=None, copy_hooks=False): 'Set up the git post-commit hook' - if copy_hooks: - self._copy_hooks(source_path) text = self.post_receive_template.substitute( url=tg.config.get('base_url', 'http://localhost:8080') + '/auth/refresh_repo' + self._repo.url()) http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3c462c70/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 910391d..c82d4fd 100644 --- a/ForgeGit/forgegit/tests/model/test_repository.py +++ b/ForgeGit/forgegit/tests/model/test_repository.py @@ -163,14 +163,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase): repo.init() repo._impl.clone_from(repo_path, copy_hooks=True) assert len(repo.log()) - assert os.path.exists('/tmp/testgit.git/hooks/update') - assert os.access('/tmp/testgit.git/hooks/update', os.X_OK) - with open('/tmp/testgit.git/hooks/update') as f: c = f.read() - self.assertEqual(c, 'update\n') - assert os.path.exists('/tmp/testgit.git/hooks/post-receive-user') - assert os.access('/tmp/testgit.git/hooks/post-receive-user', os.X_OK) - with open('/tmp/testgit.git/hooks/post-receive-user') as f: c = f.read() - self.assertEqual(c, 'post-receive\n') + assert not os.path.exists('/tmp/testgit.git/hooks/update') + assert not os.path.exists('/tmp/testgit.git/hooks/post-receive-user') assert os.path.exists('/tmp/testgit.git/hooks/post-receive') assert os.access('/tmp/testgit.git/hooks/post-receive', os.X_OK) with open('/tmp/testgit.git/hooks/post-receive') as f: c = f.read()