incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [1/9] git commit: [#6355] Handle dots in repo names
Date Wed, 17 Jul 2013 21:17:16 GMT
Updated Branches:
  refs/heads/cj/6456 c82d4fac9 -> cec20b962 (forced update)


[#6355] Handle dots in repo names

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/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/cj/6456
Commit: dbfa5afd2849f9d33901aa4ac170bb5b9d8945f5
Parents: d2a60bb
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Tue Jul 2 14:33:11 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@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(


Mime
View raw message