incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: [#6086] Don't create initial commit in svn repos
Date Tue, 16 Apr 2013 16:04:38 GMT
Updated Branches:
  refs/heads/master 630309eed -> 442cb9ab7


[#6086] Don't create initial commit in svn repos

- Don't create /trunk, /branches, /tags dirs in new svn repos
- Give user instructions on how to do it manually
- Don't show "empty repo" if only 1 commit

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>


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

Branch: refs/heads/master
Commit: 442cb9ab7c08a5974aa468f736168b10367bdce1
Parents: 630309e
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Mon Apr 15 22:43:04 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Tue Apr 16 16:04:21 2013 +0000

----------------------------------------------------------------------
 ForgeSVN/forgesvn/controllers.py                   |    2 +-
 ForgeSVN/forgesvn/model/svn.py                     |    4 +-
 ForgeSVN/forgesvn/svn_main.py                      |    2 +-
 ForgeSVN/forgesvn/templates/svn/index.html         |   24 +++++++++++++-
 .../forgesvn/tests/functional/test_controllers.py  |    2 +-
 5 files changed, 27 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/442cb9ab/ForgeSVN/forgesvn/controllers.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/controllers.py b/ForgeSVN/forgesvn/controllers.py
index 0a87b40..0567a5d 100644
--- a/ForgeSVN/forgesvn/controllers.py
+++ b/ForgeSVN/forgesvn/controllers.py
@@ -14,7 +14,7 @@ class BranchBrowser(repository.BranchBrowser):
     @with_trailing_slash
     def index(self, limit=None, page=0, count=0, **kw):
         latest = c.app.repo.latest(branch=self._branch)
-        if not latest or (latest._id.split(':')[1] == '1' and h.has_access(c.app, 'write')()):
+        if not latest:
             return dict(allow_fork=False, log=[])
         redirect(c.app.repo._impl.url_for_symbolic(latest._id) + 'tree/')
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/442cb9ab/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 2e18b2c..0fef5b1 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -180,7 +180,7 @@ class SVNImplementation(M.RepositoryImplementation):
         return '%s%d/' % (
             self._repo.url(), self._revno(object_id))
 
-    def init(self, default_dirs=True, skip_special_files=False):
+    def init(self, default_dirs=False, skip_special_files=False):
         fullname = self._setup_paths()
         log.info('svn init %s', fullname)
         if os.path.exists(fullname):
@@ -233,7 +233,7 @@ class SVNImplementation(M.RepositoryImplementation):
 
     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)
+        self.init(skip_special_files=True)
 
         def set_hook(hook_name):
             fn = os.path.join(self._repo.fs_path, self._repo.name,

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/442cb9ab/ForgeSVN/forgesvn/svn_main.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/svn_main.py b/ForgeSVN/forgesvn/svn_main.py
index 2df8ea4..229f7dd 100644
--- a/ForgeSVN/forgesvn/svn_main.py
+++ b/ForgeSVN/forgesvn/svn_main.py
@@ -32,7 +32,7 @@ class ForgeSVNApp(RepositoryApp):
     '''This is the SVN app for PyForge'''
     __version__ = version.__version__
     config_options = RepositoryApp.config_options + [
-        ConfigOption('checkout_url', str, 'trunk')
+        ConfigOption('checkout_url', str, '')
         ]
     tool_label='SVN'
     tool_description="""

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/442cb9ab/ForgeSVN/forgesvn/templates/svn/index.html
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/templates/svn/index.html b/ForgeSVN/forgesvn/templates/svn/index.html
index a26aac8..a433745 100644
--- a/ForgeSVN/forgesvn/templates/svn/index.html
+++ b/ForgeSVN/forgesvn/templates/svn/index.html
@@ -28,7 +28,7 @@
         <a href="http://svnbook.red-bean.com/">Learn the basics</a>.
       </div>
     </div>
-    
+
     <div class="message error scm-empty-repo">
       <h6>Empty Repository</h6>
       <div class="content">
@@ -36,8 +36,28 @@
       </div>
     </div>
 
-    <h2>Import project on disk to Subversion</h2>
+    <h2>Create default directories</h2>
+    <p>It's common practice among Subversion users to create a <code>/trunk</code>,
+      <code>/branches</code>, and <code>/tags</code> directory at
the root of each
+      repository. If you'd like to do that, follow these instructions:
+    <p>
+    <div class="codehilite">
+      <pre>
+{{c.app.repo.clone_command('rw')}}
+cd {{c.app.repo.suggested_clone_dest_path()}}
+mkdir trunk branches tags
+svn add trunk branches tags
+svn ci -m "Add initial directories"
+      </pre>
+    </div>
+    <p>To make the default checkout url for your repo point to your new
+      <code>/trunk</code> directory instead of the root, go to the
+      <a href="{{c.project.url() + 'admin/tools'}}">Admin / Tools</a>
+      screen, click on 'Checkout URL' under your repo, add 'trunk' to the
+      end of the url, and click 'Save.'
+    </p>
 
+    <h2>Import project on disk to Subversion</h2>
     <div class="codehilite">
       <pre>cd existing-{{c.app.repo.suggested_clone_dest_path()}}
 svn import {{c.app.repo.clone_url('rw', c.user.username)}} -m "Initial commit"</pre>

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/442cb9ab/ForgeSVN/forgesvn/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/functional/test_controllers.py b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
index ce19a79..3519519 100644
--- a/ForgeSVN/forgesvn/tests/functional/test_controllers.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
@@ -106,7 +106,7 @@ class TestRootController(SVNTestController):
         self.app.post('/p/test/admin/src/set_checkout_url',
                       {"checkout_url": "badurl"})
         r = self.app.get('/p/test/admin/src/checkout_url')
-        assert 'value="trunk"' in r
+        assert 'value="badurl"' not in r
         self.app.post('/p/test/admin/src/set_checkout_url',
                       {"checkout_url": ""})
         r = self.app.get('/p/test/admin/src/checkout_url')


Mime
View raw message