incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [1/25] git commit: [#5076] Removed now unused copy_hooks param
Date Mon, 29 Oct 2012 20:10:46 GMT
Updated Branches:
  refs/heads/cj/5076 f720d85e5 -> c59cb17aa (forced update)


[#5076] Removed now unused copy_hooks param

Signed-off-by: Cory Johns <johnsca@geek.net>


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

Branch: refs/heads/cj/5076
Commit: c59cb17aac9963018797f900699530ec39a4486b
Parents: dc2fa02
Author: Cory Johns <johnsca@geek.net>
Authored: Fri Oct 26 18:40:00 2012 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Mon Oct 29 20:08:20 2012 +0000

----------------------------------------------------------------------
 Allura/allura/model/repository.py                |   12 ++++++------
 Allura/allura/tasks/repo_tasks.py                |    6 ++----
 ForgeGit/forgegit/git_main.py                    |    6 ++----
 ForgeGit/forgegit/model/git_repo.py              |    6 +++---
 ForgeGit/forgegit/tests/model/test_repository.py |    4 ++--
 ForgeHg/forgehg/hg_main.py                       |    6 ++----
 ForgeHg/forgehg/model/hg.py                      |    6 +++---
 ForgeHg/forgehg/tests/model/test_repository.py   |    4 ++--
 ForgeSVN/forgesvn/model/svn.py                   |    6 +++---
 ForgeSVN/forgesvn/svn_main.py                    |    3 +--
 ForgeSVN/forgesvn/tests/model/test_repository.py |    4 ++--
 11 files changed, 28 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c59cb17a/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 2f2328a..30351fa 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -49,7 +49,7 @@ class RepositoryImplementation(object):
     def init(self): # pragma no cover
         raise NotImplementedError, 'init'
 
-    def clone_from(self, source_url, copy_hooks=False): # pragma no cover
+    def clone_from(self, source_url): # pragma no cover
         raise NotImplementedError, 'clone_from'
 
     def commit(self, revision): # pragma no cover
@@ -79,7 +79,7 @@ class RepositoryImplementation(object):
         '''Refresh the data in the commit with id oid'''
         raise NotImplementedError, 'refresh_commit_info'
 
-    def _setup_hooks(self, source_path=None, copy_hooks=False): # pragma no cover
+    def _setup_hooks(self, source_path=None): # pragma no cover
         '''Install a hook in the repository that will ping the refresh url for
         the repo.  Optionally provide a path from which to copy existing hooks.'''
         raise NotImplementedError, '_setup_hooks'
@@ -136,12 +136,12 @@ class RepositoryImplementation(object):
                 log.warn('setup_paths error %s' % path, exc_info=True)
         return fullname
 
-    def _setup_special_files(self, source_path=None, copy_hooks=False):
+    def _setup_special_files(self, source_path=None):
         magic_file = os.path.join(self._repo.fs_path, self._repo.name, '.SOURCEFORGE-REPOSITORY')
         with open(magic_file, 'w') as f:
             f.write(self._repo.repo_id)
         os.chmod(magic_file, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH)
-        self._setup_hooks(source_path, copy_hooks)
+        self._setup_hooks(source_path)
 
 class Repository(Artifact, ActivityObject):
     BATCH_SIZE=100
@@ -221,12 +221,12 @@ class Repository(Artifact, ActivityObject):
             ci.set_context(self)
             yield ci
 
-    def init_as_clone(self, source_path, source_name, source_url, copy_hooks=False):
+    def init_as_clone(self, source_path, source_name, source_url):
         self.upstream_repo.name = source_name
         self.upstream_repo.url = source_url
         session(self).flush(self)
         source = source_path if source_path else source_url
-        self._impl.clone_from(source, copy_hooks)
+        self._impl.clone_from(source)
 
     def log(self, branch='master', offset=0, limit=10):
         return list(self._log(branch, offset, limit))

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c59cb17a/Allura/allura/tasks/repo_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/repo_tasks.py b/Allura/allura/tasks/repo_tasks.py
index e57ac89..ee7e58f 100644
--- a/Allura/allura/tasks/repo_tasks.py
+++ b/Allura/allura/tasks/repo_tasks.py
@@ -22,15 +22,13 @@ def init(**kwargs):
 def clone(
     cloned_from_path,
     cloned_from_name,
-    cloned_from_url,
-    copy_hooks=False):
+    cloned_from_url):
     try:
         from allura import model as M
         c.app.repo.init_as_clone(
             cloned_from_path,
             cloned_from_name,
-            cloned_from_url,
-            copy_hooks)
+            cloned_from_url)
         M.Notification.post_user(
             c.user, c.app.repo, 'created',
             text='Repository %s/%s created' % (

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c59cb17a/ForgeGit/forgegit/git_main.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/git_main.py b/ForgeGit/forgegit/git_main.py
index f3992f2..c4a2e7b 100644
--- a/ForgeGit/forgegit/git_main.py
+++ b/ForgeGit/forgegit/git_main.py
@@ -64,13 +64,11 @@ class ForgeGitApp(RepositoryApp):
             allura.tasks.repo_tasks.clone.post(
                 cloned_from_path=cloned_from.full_fs_path,
                 cloned_from_name=cloned_from.app.config.script_name(),
-                cloned_from_url=cloned_from.full_fs_path,
-                copy_hooks=self.config.options.get('copy_hooks', False))
+                cloned_from_url=cloned_from.full_fs_path)
         elif init_from_url or init_from_path:
             allura.tasks.repo_tasks.clone.post(
                 cloned_from_path=init_from_path,
                 cloned_from_name=None,
-                cloned_from_url=init_from_url,
-                copy_hooks=self.config.options.get('copy_hooks', False))
+                cloned_from_url=init_from_url)
         else:
             allura.tasks.repo_tasks.init.post()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c59cb17a/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 416b931..dba6477 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -89,7 +89,7 @@ class GitImplementation(M.RepositoryImplementation):
         self._setup_special_files()
         self._repo.status = 'ready'
 
-    def clone_from(self, source_url, copy_hooks=False):
+    def clone_from(self, source_url):
         '''Initialize a repo as a clone of another'''
         self._repo.status = 'cloning'
         session(self._repo).flush(self._repo)
@@ -104,7 +104,7 @@ class GitImplementation(M.RepositoryImplementation):
                 to_path=fullname,
                 bare=True)
             self.__dict__['_git'] = repo
-            self._setup_special_files(source_url, copy_hooks)
+            self._setup_special_files(source_url)
         except:
             self._repo.status = 'ready'
             session(self._repo).flush(self._repo)
@@ -260,7 +260,7 @@ class GitImplementation(M.RepositoryImplementation):
     def blob_size(self, blob):
         return self._object(blob._id).data_stream.size
 
-    def _setup_hooks(self, source_path=None, copy_hooks=False):
+    def _setup_hooks(self, source_path=None):
         'Set up the git post-commit hook'
         text = self.post_receive_template.substitute(
             url=tg.config.get('base_url', 'http://localhost:8080')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c59cb17a/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 c82d4fd..deb8b63 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -142,7 +142,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
         if os.path.exists(dirname):
             shutil.rmtree(dirname)
         repo.init()
-        repo._impl.clone_from(repo_path, copy_hooks=False)
+        repo._impl.clone_from(repo_path)
         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')
@@ -161,7 +161,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
         if os.path.exists(dirname):
             shutil.rmtree(dirname)
         repo.init()
-        repo._impl.clone_from(repo_path, copy_hooks=True)
+        repo._impl.clone_from(repo_path)
         assert len(repo.log())
         assert not os.path.exists('/tmp/testgit.git/hooks/update')
         assert not os.path.exists('/tmp/testgit.git/hooks/post-receive-user')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c59cb17a/ForgeHg/forgehg/hg_main.py
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/hg_main.py b/ForgeHg/forgehg/hg_main.py
index a98b720..77ccdbb 100644
--- a/ForgeHg/forgehg/hg_main.py
+++ b/ForgeHg/forgehg/hg_main.py
@@ -64,14 +64,12 @@ class ForgeHgApp(RepositoryApp):
             allura.tasks.repo_tasks.clone.post(
                 cloned_from_path=cloned_from.full_fs_path,
                 cloned_from_name=cloned_from.app.config.script_name(),
-                cloned_from_url=cloned_from.full_fs_path,
-                copy_hooks=self.config.options.get('copy_hooks', False))
+                cloned_from_url=cloned_from.full_fs_path)
         elif init_from_url or init_from_path:
             allura.tasks.repo_tasks.clone.post(
                 cloned_from_path=init_from_path,
                 cloned_from_name=None,
-                cloned_from_url=init_from_url,
-                copy_hooks=self.config.options.get('copy_hooks', False))
+                cloned_from_url=init_from_url)
         else:
             allura.tasks.repo_tasks.init.post()
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c59cb17a/ForgeHg/forgehg/model/hg.py
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/model/hg.py b/ForgeHg/forgehg/model/hg.py
index 09d815d..726b4ae 100644
--- a/ForgeHg/forgehg/model/hg.py
+++ b/ForgeHg/forgehg/model/hg.py
@@ -74,7 +74,7 @@ class HgImplementation(M.RepositoryImplementation):
         self._setup_special_files()
         self._repo.status = 'ready'
 
-    def clone_from(self, source_url, copy_hooks=False):
+    def clone_from(self, source_url):
         '''Initialize a repo as a clone of another'''
         self._repo.status = 'cloning'
         session(self._repo).flush(self._repo)
@@ -91,7 +91,7 @@ class HgImplementation(M.RepositoryImplementation):
                 self._repo.full_fs_path.encode('utf-8'),
                 update=False)
             self.__dict__['_hg'] = repo
-            self._setup_special_files(source_url, copy_hooks)
+            self._setup_special_files(source_url)
         except:
             self._repo.status = 'raise'
             session(self._repo).flush(self._repo)
@@ -256,7 +256,7 @@ class HgImplementation(M.RepositoryImplementation):
         fctx = self._hg[blob.commit._id][h.really_unicode(blob.path()).encode('utf-8')[1:]]
         return fctx.size()
 
-    def _setup_hooks(self, source_path=None, copy_hooks=False):
+    def _setup_hooks(self, source_path=None):
         'Set up the hg changegroup hook'
         hgrc = os.path.join(self._repo.fs_path, self._repo.name, '.hg', 'hgrc')
         cp = ConfigParser()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c59cb17a/ForgeHg/forgehg/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/model/test_repository.py b/ForgeHg/forgehg/tests/model/test_repository.py
index 7f14d5f..c88a406 100644
--- a/ForgeHg/forgehg/tests/model/test_repository.py
+++ b/ForgeHg/forgehg/tests/model/test_repository.py
@@ -128,7 +128,7 @@ class TestHgRepo(unittest.TestCase, RepoImplTestBase):
         if os.path.exists(dirname):
             shutil.rmtree(dirname)
         repo.init()
-        repo._impl.clone_from(repo_path, copy_hooks=False)
+        repo._impl.clone_from(repo_path)
         assert len(repo.log())
         assert not os.path.exists('/tmp/testrepo.hg/.hg/external-changegroup')
         assert not os.path.exists('/tmp/testrepo.hg/.hg/nested/nested-file')
@@ -156,7 +156,7 @@ class TestHgRepo(unittest.TestCase, RepoImplTestBase):
         if os.path.exists(dirname):
             shutil.rmtree(dirname)
         repo.init()
-        repo._impl.clone_from(repo_path, copy_hooks=True)
+        repo._impl.clone_from(repo_path)
         assert len(repo.log())
         assert not os.path.exists('/tmp/testrepo.hg/.hg/external-changegroup')
         assert not os.path.exists('/tmp/testrepo.hg/.hg/nested/nested-file')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c59cb17a/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index aabdc3e..93b7cb6 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -158,7 +158,7 @@ class SVNImplementation(M.RepositoryImplementation):
             self._repo._impl._svn.checkin([fullname+'/tmp/trunk',fullname+'/tmp/tags',fullname+'/tmp/branches'],'Initial
commit')
             shutil.rmtree(fullname+'/tmp')
 
-    def clone_from(self, source_url, copy_hooks=False):
+    def clone_from(self, source_url):
         '''Initialize a repo as a clone of another using svnsync'''
         self.init(default_dirs=False, skip_special_files=True)
         # Need a pre-revprop-change hook for cloning
@@ -189,7 +189,7 @@ class SVNImplementation(M.RepositoryImplementation):
                           c.app.config.options['checkout_url'])):
             c.app.config.options['checkout_url'] = ""
         self._repo.refresh(notify=False)
-        self._setup_special_files(source_url, copy_hooks)
+        self._setup_special_files(source_url)
 
     def refresh_heads(self):
         info = self._svn.info2(
@@ -434,7 +434,7 @@ class SVNImplementation(M.RepositoryImplementation):
 
         return size
 
-    def _setup_hooks(self, source_path=None, copy_hooks=False):
+    def _setup_hooks(self, source_path=None):
         'Set up the post-commit and pre-revprop-change hooks'
         # setup a post-commit hook to notify Allura of changes to the repo
         # the hook should also call the user-defined post-commit-user hook

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c59cb17a/ForgeSVN/forgesvn/svn_main.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/svn_main.py b/ForgeSVN/forgesvn/svn_main.py
index d51ee33..f8aa748 100644
--- a/ForgeSVN/forgesvn/svn_main.py
+++ b/ForgeSVN/forgesvn/svn_main.py
@@ -70,8 +70,7 @@ class ForgeSVNApp(RepositoryApp):
             allura.tasks.repo_tasks.clone.post(
                 cloned_from_path=init_from_path,
                 cloned_from_name=None,
-                cloned_from_url=init_from_url,
-                copy_hooks=self.config.options.get('copy_hooks', False))
+                cloned_from_url=init_from_url)
         else:
             allura.tasks.repo_tasks.init.post()
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c59cb17a/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index a2d8e68..9e9270c 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -129,7 +129,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
         if os.path.exists(dirname):
             shutil.rmtree(dirname)
         repo.init()
-        repo._impl.clone_from('file://' + repo_path, copy_hooks=False)
+        repo._impl.clone_from('file://' + repo_path)
         assert len(repo.log())
         assert os.path.exists('/tmp/testsvn/hooks/pre-revprop-change')
         assert os.access('/tmp/testsvn/hooks/pre-revprop-change', os.X_OK)
@@ -157,7 +157,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
         if os.path.exists(dirname):
             shutil.rmtree(dirname)
         repo.init()
-        repo._impl.clone_from('file://' + repo_path, copy_hooks=True)
+        repo._impl.clone_from('file://' + repo_path)
         assert len(repo.log())
         assert os.path.exists('/tmp/testsvn/hooks/pre-revprop-change')
         assert os.access('/tmp/testsvn/hooks/pre-revprop-change', os.X_OK)


Mime
View raw message