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 2012/11/14 21:08:50 UTC
git commit: [#4961] WIP
Updated Branches:
refs/heads/tv/4961 [created] 05321570d
[#4961] WIP
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/05321570
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/05321570
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/05321570
Branch: refs/heads/tv/4961
Commit: 05321570d4d56c897c152783c6cead34987d7909
Parents: 2e70d71
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Nov 14 20:08:33 2012 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Wed Nov 14 20:08:33 2012 +0000
----------------------------------------------------------------------
ForgeSVN/forgesvn/model/svn.py | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/05321570/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index eca7229..5e616e7 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -177,8 +177,21 @@ class SVNImplementation(M.RepositoryImplementation):
session(self._repo).flush(self._repo)
log.info('Initialize %r as a clone of %s',
self._repo, source_url)
- check_call(['svnsync', 'init', self._url, source_url])
- check_call(['svnsync', '--non-interactive', 'sync', self._url])
+
+ if source_url.startswith('file://'):
+ # src repo is on the local filesystem - use hotcopy (faster)
+ source_path = source_url[7:]
+ dest_path = self._url[7:]
+ fullname = os.path.join(self._repo.fs_path, self._repo.name)
+ if os.path.exists(fullname):
+ shutil.rmtree(fullname)
+ check_call(['svnadmin', 'hotcopy', source_path, dest_path])
+ check_call(['svnsync', '--non-interactive', '--allow-non-empty',
+ 'initialize', self._url, source_url])
+ else:
+ check_call(['svnsync', 'init', self._url, source_url])
+ check_call(['svnsync', '--non-interactive', 'sync', self._url])
+
log.info('... %r cloned', self._repo)
if not svn_path_exists("file://%s%s/%s" %
(self._repo.fs_path,