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/07/15 23:04:46 UTC

[50/50] [abbrv] git commit: [#6355] Handle dots in repo names

[#6355] Handle dots in repo names

Signed-off-by: Tim Van Steenburgh <tv...@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/dbfa5afd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/dbfa5afd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/dbfa5afd

Branch: refs/heads/tv/6355
Commit: dbfa5afd2849f9d33901aa4ac170bb5b9d8945f5
Parents: d2a60bb
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Jul 2 14:33:11 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Mon Jul 15 21:03:18 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/auth.py               | 7 ++++---
 ForgeGit/forgegit/tests/functional/test_auth.py | 7 +++++++
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dbfa5afd/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index 5b3acf3..4e197e6 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -309,12 +309,13 @@ class AuthController(BaseController):
                      project_path, repo_path)
             response.status = 404
             return dict(disallow, error='unknown project')
-        mount_point = os.path.splitext(rest[0])[0]
         c.project = project
-        c.app = project.app_instance(mount_point)
+        c.app = project.app_instance(rest[0])
+        if not c.app:
+            c.app = project.app_instance(rest[0])[0]
         if c.app is None:
             log.info("Can't find repo at %s on repo_path %s",
-                     mount_point, repo_path)
+                     rest[0], repo_path)
             return disallow
         return dict(allow_read=has_access(c.app, 'read')(user=user),
                     allow_write=has_access(c.app, 'write')(user=user),

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dbfa5afd/ForgeGit/forgegit/tests/functional/test_auth.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_auth.py b/ForgeGit/forgegit/tests/functional/test_auth.py
index fcee919..4a16aab 100644
--- a/ForgeGit/forgegit/tests/functional/test_auth.py
+++ b/ForgeGit/forgegit/tests/functional/test_auth.py
@@ -21,8 +21,10 @@ import json
 from datadiff.tools import assert_equal
 
 from allura.tests import TestController
+from allura.tests.decorators import with_tool
 from forgegit.tests import with_git
 
+
 class TestGitUserPermissions(TestController):
     allow = dict(allow_read=True, allow_write=True, allow_create=True)
     read = dict(allow_read=True, allow_write=False, allow_create=False)
@@ -67,6 +69,11 @@ class TestGitUserPermissions(TestController):
             username='test-usera',
             status=404)
 
+    @with_tool('test', 'Git', 'src.c++.git', 'Git', type='git')
+    def test_dot_and_plus(self):
+        r = self._check_repo('/git/test.p/src.c++.git')
+        assert r == self.allow, r
+
     def _check_repo(self, path, username='test-admin', **kw):
         url = '/auth/repo_permissions'
         r = self.app.get(url, params=dict(