You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2020/01/28 20:16:16 UTC

[allura] 01/08: [#8333] updates to go along with ForgeHg's mercurial updates

This is an automated email from the ASF dual-hosted git repository.

kentontaylor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit e44161d3de4876c0a6d7b8853de0068dd5a2b584
Author: Dave Brondsema <da...@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 ab7ba60..d3f191e 100644
--- a/Allura/allura/lib/custom_middleware.py
+++ b/Allura/allura/lib/custom_middleware.py
@@ -365,11 +365,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 217c48c..366e129 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -142,7 +142,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 91291b4..079aa7e 100644
--- a/ForgeSVN/forgesvn/tests/functional/test_controllers.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
@@ -91,7 +91,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 3dc70b4..f1d8e83 100755
--- a/scripts/perf/benchmark-scm.py
+++ b/scripts/perf/benchmark-scm.py
@@ -27,6 +27,7 @@ from datetime import datetime
 import git
 import pysvn
 from mercurial import ui, hg, cmdutil
+import six
 
 
 def main(opts):
@@ -40,7 +41,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[