allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [allura] 01/01: [#8333] updates to go along with ForgeHg's mercurial updates
Date Fri, 13 Sep 2019 21:55:19 GMT
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8333
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 3f387f392723bc647a9708931d4cc690792e33b9
Author: Dave Brondsema <dave@brondsema.net>
AuthorDate: Fri Sep 13 17:54:50 2019 -0400

    [#8333] updates to go along with ForgeHg's mercurial updates
---
 Allura/allura/lib/custom_middleware.py                 | 8 +++++---
 ForgeGit/forgegit/tests/functional/test_controllers.py | 4 +++-
 ForgeSVN/forgesvn/tests/functional/test_controllers.py | 3 ++-
 scripts/perf/benchmark-scm.py                          | 3 ++-
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/Allura/allura/lib/custom_middleware.py b/Allura/allura/lib/custom_middleware.py
index 27aa2bd..7787b65 100644
--- a/Allura/allura/lib/custom_middleware.py
+++ b/Allura/allura/lib/custom_middleware.py
@@ -362,11 +362,13 @@ class AlluraTimerMiddleware(TimerMiddleware):
             stat_record.add('request_category', c.app.config.tool_name.lower())
         return stat_record
 
-    def entry_point_timers(self):
+    @classmethod
+    def entry_point_timers(cls, module_prefix=None):
         timers = []
         for ep in h.iter_entry_points('allura.timers'):
-            func = ep.load()
-            timers += aslist(func())
+            if not module_prefix or ep.module_name.startswith(module_prefix):
+                func = ep.load()
+                timers += aslist(func())
         return timers
 
 
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 1f2aa0c..28b9f3e 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -140,7 +140,9 @@ class TestRootController(_TestCase):
         assert 'git clone /srv/git' in resp
 
     def test_index_empty(self):
-        self.app.get('/git/')
+        resp = self.app.get('/git/')
+        resp = resp.follow()  # /git/ref/master/
+        resp.mustcontain('First time using Git')
 
     def test_commit_browser(self):
         self.app.get('/src-git/commit_browser')
diff --git a/ForgeSVN/forgesvn/tests/functional/test_controllers.py b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
index 3824e71..81169fa 100644
--- a/ForgeSVN/forgesvn/tests/functional/test_controllers.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
@@ -90,7 +90,8 @@ class TestRootController(SVNTestController):
         assert '[r5]' in resp, resp.showbrowser()
 
     def test_index_empty(self):
-        self.app.get('/svn/')
+        resp = self.app.get('/svn/')
+        resp.mustcontain('Create default directories')
 
     def test_commit_browser(self):
         self.app.get('/src/commit_browser')
diff --git a/scripts/perf/benchmark-scm.py b/scripts/perf/benchmark-scm.py
index be9b93a..6d57c71 100755
--- a/scripts/perf/benchmark-scm.py
+++ b/scripts/perf/benchmark-scm.py
@@ -26,6 +26,7 @@ from datetime import datetime
 import git
 import pysvn
 from mercurial import ui, hg, cmdutil
+import six
 
 
 def main(opts):
@@ -39,7 +40,7 @@ def main(opts):
         names = [n.name for n in tree]
         impl = impl_git_tree if opts.full_tree else impl_git_node
     elif opts.type == 'hg':
-        repo = hg.repository(HgUI(), opts.repo_path)
+        repo = hg.repository(HgUI(), six.ensure_str(opts.repo_path))
         cid = None if opts.cid == 'HEAD' else ['%s:0' % opts.cid]
         path = opts.path.strip('/')
         filenames = repo[


Mime
View raw message