You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/03/12 21:04:51 UTC

[6/50] [abbrv] git commit: [#5557] Clean up created pre-revprop-change hook after sync

[#5557] Clean up created pre-revprop-change hook after sync

Signed-off-by: Cory Johns <jo...@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/a6c59e4c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a6c59e4c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a6c59e4c

Branch: refs/heads/si/5453
Commit: a6c59e4caa6687485793f668325c1562690e2b70
Parents: b6a3df2
Author: Cory Johns <jo...@geek.net>
Authored: Wed Mar 6 23:02:40 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Mar 7 23:05:28 2013 +0000

----------------------------------------------------------------------
 ForgeSVN/forgesvn/model/svn.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a6c59e4c/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index ca0e8ac..7aba890 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -222,6 +222,11 @@ class SVNImplementation(M.RepositoryImplementation):
                 fp.write('#!/bin/sh\n')
             os.chmod(fn, 0755)
 
+        def clear_hook(hook_name):
+            fn = os.path.join(self._repo.fs_path, self._repo.name,
+                              'hooks', hook_name)
+            os.remove(fn)
+
         self._repo.status = 'importing'
         session(self._repo).flush(self._repo)
         log.info('Initialize %r as a clone of %s',
@@ -241,10 +246,12 @@ class SVNImplementation(M.RepositoryImplementation):
             set_hook('pre-revprop-change')
             self.check_call(['svnsync', '--non-interactive', '--allow-non-empty',
               'initialize', self._url, source_url])
+            clear_hook('pre-revprop-change')
         else:
             set_hook('pre-revprop-change')
             self.check_call(['svnsync', 'init', self._url, source_url])
             self.check_call(['svnsync', '--non-interactive', 'sync', self._url])
+            clear_hook('pre-revprop-change')
 
         log.info('... %r cloned', self._repo)
         if not svn_path_exists("file://%s%s/%s" %