incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#5508] make svn initial commit working dir configurable
Date Sun, 23 Dec 2012 19:56:09 GMT
Updated Branches:
  refs/heads/master dfb062bd4 -> 5c8e2ad30


[#5508] make svn initial commit working dir configurable


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

Branch: refs/heads/master
Commit: 5c8e2ad30621ae2a529373adade327810e635f54
Parents: dfb062b
Author: Dave Brondsema <dbrondsema@geek.net>
Authored: Sun Dec 23 19:55:25 2012 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Sun Dec 23 19:55:25 2012 +0000

----------------------------------------------------------------------
 ForgeSVN/forgesvn/model/svn.py |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5c8e2ad3/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 4b9c724..ef03c86 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -9,7 +9,7 @@ from subprocess import Popen, PIPE
 from hashlib import sha1
 from cStringIO import StringIO
 from datetime import datetime
-from glob import glob
+import tempfile
 
 import tg
 import pysvn
@@ -145,15 +145,22 @@ class SVNImplementation(M.RepositoryImplementation):
         self._repo.status = 'ready'
         # make first commit with dir structure
         if default_dirs:
-            self._repo._impl._svn.checkout('file://'+fullname, fullname+'/tmp')
-            os.mkdir(fullname+'/tmp/trunk')
-            os.mkdir(fullname+'/tmp/tags')
-            os.mkdir(fullname+'/tmp/branches')
-            self._repo._impl._svn.add(fullname+'/tmp/trunk')
-            self._repo._impl._svn.add(fullname+'/tmp/tags')
-            self._repo._impl._svn.add(fullname+'/tmp/branches')
-            self._repo._impl._svn.checkin([fullname+'/tmp/trunk',fullname+'/tmp/tags',fullname+'/tmp/branches'],'Initial
commit')
-            shutil.rmtree(fullname+'/tmp')
+            tmp_working_dir = tempfile.mkdtemp(prefix='allura-svn-r1-',
+                                               dir=tg.config.get('scm.svn.tmpdir', '/tmp'))
+            log.info('tmp dir = %s', tmp_working_dir)
+            self._repo._impl._svn.checkout('file://'+fullname, tmp_working_dir)
+            os.mkdir(tmp_working_dir+'/trunk')
+            os.mkdir(tmp_working_dir+'/tags')
+            os.mkdir(tmp_working_dir+'/branches')
+            self._repo._impl._svn.add(tmp_working_dir+'/trunk')
+            self._repo._impl._svn.add(tmp_working_dir+'/tags')
+            self._repo._impl._svn.add(tmp_working_dir+'/branches')
+            self._repo._impl._svn.checkin([tmp_working_dir+'/trunk',
+                                           tmp_working_dir+'/tags',
+                                           tmp_working_dir+'/branches'],
+                                        'Initial commit')
+            shutil.rmtree(tmp_working_dir)
+            log.info('deleted %s', tmp_working_dir)
 
     def clone_from(self, source_url):
         '''Initialize a repo as a clone of another using svnsync'''


Mime
View raw message