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:15 UTC
[allura] branch master updated (62447da -> 47c5a44)
This is an automated email from the ASF dual-hosted git repository.
kentontaylor pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git.
from 62447da Upgrade activitystream to 0.3
new e44161d [#8333] updates to go along with ForgeHg's mercurial updates
new dc0e1dd [#8333] never give option to merge *into* a tag; give ForgeHg a hook to customize tags you can merge *from*
new 1bccf4e [#8333] fix logging statement
new ca2bdaa [#8333] avoid encoding issues in LastCommit.__repr__ by using the repr of the path
new c33458d [#8333] fixes for tags & branches with unicode chars
new b55b5cb [#8333] download snapshot fixes when dirs have unicode chars
new 4d3a8c6 [#8333] add unicode test for GitLikeTree.__repr__ (related to timermiddleware fix; may be helpful during py3 upgrade changes)
new 47c5a44 [#8333] Bump timermiddleware version
The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
Allura/allura/controllers/repository.py | 19 ++++++++-----------
Allura/allura/lib/custom_middleware.py | 8 +++++---
Allura/allura/lib/repository.py | 4 ++--
Allura/allura/model/repository.py | 8 ++++----
Allura/allura/tests/model/test_repo.py | 7 +++++++
.../forgegit/tests/functional/test_controllers.py | 4 +++-
.../forgesvn/tests/functional/test_controllers.py | 3 ++-
requirements.in | 2 +-
requirements.txt | 2 +-
scripts/perf/benchmark-scm.py | 3 ++-
10 files changed, 35 insertions(+), 25 deletions(-)
[allura] 06/08: [#8333] download snapshot fixes when dirs have
unicode chars
Posted by ke...@apache.org.
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 b55b5cb0ef649cc4d3c5ed4f8b23261c3ea33221
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Tue Sep 17 15:42:28 2019 -0400
[#8333] download snapshot fixes when dirs have unicode chars
---
Allura/allura/controllers/repository.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 6d940d6..225ea97 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -717,7 +717,7 @@ class CommitBrowser(BaseController):
status = c.app.repo.get_tarball_status(rev, path)
if not status and request.method == 'POST':
allura.tasks.repo_tasks.tarball.post(rev, path)
- redirect('tarball' + '?path={0}'.format(path) if path else '')
+ redirect(('tarball' + u'?path={0}'.format(path) if path else '').encode('utf-8'))
return dict(commit=self._commit, revision=rev, status=status)
@expose('json:')
@@ -777,10 +777,10 @@ class TreeBrowser(BaseController, DispatchIndex):
tool_subscribed = M.Mailbox.subscribed()
tarball_url = None
if asbool(tg.config.get('scm.repos.tarball.enable', False)):
- cutout = len('tree' + self._path)
+ cutout = len('tree' + self._path.encode('utf8'))
if request.path.endswith('/') and not self._path.endswith('/'):
cutout += 1
- tarball_url = quote('%starball' % unquote(request.path)[:-cutout])
+ tarball_url = h.urlquote('%starball' % unquote(request.path)[:-cutout])
return dict(
repo=c.app.repo,
commit=self._commit,
[allura] 04/08: [#8333] avoid encoding issues in
LastCommit.__repr__ by using the repr of the path
Posted by ke...@apache.org.
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 ca2bdaa05ee75c5ac07053d27d213f3eb024d703
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Tue Sep 17 14:52:01 2019 -0400
[#8333] avoid encoding issues in LastCommit.__repr__ by using the repr of the path
---
Allura/allura/model/repository.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index be077d3..5507356 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -1549,7 +1549,7 @@ class EmptyBlob(Blob):
class LastCommit(RepoObject):
def __repr__(self):
- return '<LastCommit /%s %s>' % (self.path, self.commit_id)
+ return '<LastCommit /%r %s>' % (self.path, self.commit_id)
@classmethod
def _last_commit_id(cls, commit, path):
[allura] 05/08: [#8333] fixes for tags & branches with unicode chars
Posted by ke...@apache.org.
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 c33458d792c50d20a4175c0983fbf9a6d748809b
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Tue Sep 17 15:18:49 2019 -0400
[#8333] fixes for tags & branches with unicode chars
---
Allura/allura/controllers/repository.py | 1 +
Allura/allura/lib/repository.py | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 9fdcc9b..6d940d6 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -611,6 +611,7 @@ class CommitsController(object):
@expose()
def _lookup(self, ci, *remainder):
+ ci = unquote(ci)
EOR = c.app.END_OF_REF_ESCAPE
if EOR in remainder:
i = remainder.index(EOR)
diff --git a/Allura/allura/lib/repository.py b/Allura/allura/lib/repository.py
index 1de7045..538028f 100644
--- a/Allura/allura/lib/repository.py
+++ b/Allura/allura/lib/repository.py
@@ -191,7 +191,7 @@ class RepositoryApp(Application):
for branch in branches[:max_branches]:
links.append(SitemapEntry(
branch.name,
- quote(self.repo.url_for_commit(branch.name) + 'tree/')))
+ h.urlquote(self.repo.url_for_commit(branch.name) + 'tree/')))
if len(branches) > max_branches:
links.append(
SitemapEntry(
@@ -211,7 +211,7 @@ class RepositoryApp(Application):
for b in tags[:max_tags]:
links.append(SitemapEntry(
b.name,
- quote(self.repo.url_for_commit(b.name) + 'tree/')))
+ h.urlquote(self.repo.url_for_commit(b.name) + 'tree/')))
if len(tags) > max_tags:
links.append(
SitemapEntry(
[allura] 02/08: [#8333] never give option to merge *into* a tag;
give ForgeHg a hook to customize tags you can merge *from*
Posted by ke...@apache.org.
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 dc0e1dda6c8dffa35e1bcb66a4063594d92e1537
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Sep 16 16:17:39 2019 -0400
[#8333] never give option to merge *into* a tag; give ForgeHg a hook to customize tags you can merge *from*
---
Allura/allura/controllers/repository.py | 12 ++++--------
Allura/allura/model/repository.py | 2 +-
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 46705b0..9fdcc9b 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -161,11 +161,9 @@ class RepoRootController(BaseController, FeedController):
def mr_widget(self):
source_branches = [
b.name
- for b in c.app.repo.get_branches() + c.app.repo.get_tags()]
+ for b in c.app.repo.get_branches() + c.app.repo.get_tags(for_merge_request=True)]
with c.app.repo.push_upstream_context():
- target_branches = [
- b.name
- for b in c.app.repo.get_branches() + c.app.repo.get_tags()]
+ target_branches = [b.name for b in c.app.repo.get_branches()]
subscribed_to_upstream = M.Mailbox.subscribed()
return SCMMergeRequestWidget(
source_branches=source_branches,
@@ -438,11 +436,9 @@ class MergeRequestController(object):
def mr_widget_edit(self):
target_branches = [
b.name
- for b in c.app.repo.get_branches() + c.app.repo.get_tags()]
+ for b in c.app.repo.get_branches() + c.app.repo.get_tags(for_merge_request=True)]
with self.req.push_downstream_context():
- source_branches = [
- b.name
- for b in c.app.repo.get_branches() + c.app.repo.get_tags()]
+ source_branches = [b.name for b in c.app.repo.get_branches()]
return SCMMergeRequestWidget(
source_branches=source_branches,
target_branches=target_branches)
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index ece93d7..b5678bb 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -510,7 +510,7 @@ class Repository(Artifact, ActivityObject):
"""
return self._impl.branches
- def get_tags(self):
+ def get_tags(self, for_merge_request=False):
"""
Return list of tags for the repo.
[allura] 01/08: [#8333] updates to go along with ForgeHg's
mercurial updates
Posted by ke...@apache.org.
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[
[allura] 08/08: [#8333] Bump timermiddleware version
Posted by ke...@apache.org.
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 47c5a44dfac7cf56ca5d11262aa74f275f4509e9
Author: Kenton Taylor <kt...@slashdotmedia.com>
AuthorDate: Tue Jan 28 20:11:00 2020 +0000
[#8333] Bump timermiddleware version
---
requirements.in | 2 +-
requirements.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/requirements.in b/requirements.in
index 6454887..c4f8e22 100644
--- a/requirements.in
+++ b/requirements.in
@@ -41,7 +41,7 @@ requests-oauthlib
# for taskd proc name switching
setproctitle==1.1.9
six==1.12.0
-TimerMiddleware==0.5.0
+TimerMiddleware==0.5.1
TurboGears2==2.3.12
WebHelpers==1.3
WebOb==1.7.4
diff --git a/requirements.txt b/requirements.txt
index 92b4bea..3a5571b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -83,7 +83,7 @@ smmap2==2.0.4 # via gitdb2
soupsieve==1.9.3 # via beautifulsoup4
testfixtures==6.10.0
textile==3.0.4 # via pypeline
-timermiddleware==0.5.0
+timermiddleware==0.5.1
traitlets==4.3.2 # via ipython
translationstring==1.3 # via colander
turbogears2==2.3.12
[allura] 07/08: [#8333] add unicode test for GitLikeTree.__repr__
(related to timermiddleware fix; may be helpful during py3 upgrade changes)
Posted by ke...@apache.org.
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 4d3a8c64dc15cd72a1402d2346a5f7e528db3cf7
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Fri Sep 27 10:35:31 2019 -0400
[#8333] add unicode test for GitLikeTree.__repr__ (related to timermiddleware fix; may be helpful during py3 upgrade changes)
---
Allura/allura/tests/model/test_repo.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Allura/allura/tests/model/test_repo.py b/Allura/allura/tests/model/test_repo.py
index 4d77e67..f6f09bd 100644
--- a/Allura/allura/tests/model/test_repo.py
+++ b/Allura/allura/tests/model/test_repo.py
@@ -1,3 +1,4 @@
+# coding=utf-8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
@@ -61,6 +62,12 @@ class TestGitLikeTree(object):
hex2 = tree2.hex()
assert_equal(hex, hex2)
+ def test_hex_with_unicode(self):
+ tree = M.GitLikeTree()
+ tree.set_blob(u'/dir/f•º£', 'file-oid')
+ # the hex() value shouldn't change, it's an important key
+ assert_equal(tree.hex(), '51ce65bead2f6452da61d4f6f2e42f8648bf9e4b')
+
class RepoImplTestBase(object):
pass
[allura] 03/08: [#8333] fix logging statement
Posted by ke...@apache.org.
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 1bccf4eb3d3f8d8a282f53f0d199bc8ff8905dd0
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Sep 16 16:18:14 2019 -0400
[#8333] fix logging statement
---
Allura/allura/model/repository.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index b5678bb..be077d3 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -574,8 +574,8 @@ class Repository(Artifact, ActivityObject):
branch = self.app.default_branch_name
try:
return self.commit(branch)
- except: # pragma no cover
- log.exception('Cannot get latest commit for a branch', branch)
+ except Exception:
+ log.exception('Cannot get latest commit for a branch: %s', branch)
return None
def url(self):