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/07 05:49:31 UTC
[1/6] git commit: [#6056] Bump ForgePastebin version
Updated Branches:
refs/heads/master 435870162 -> 6901e8ae7
[#6056] Bump ForgePastebin version
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/6901e8ae
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/6901e8ae
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/6901e8ae
Branch: refs/heads/master
Commit: 6901e8ae77d01250faab1436fa9b1c062e5cbb68
Parents: 9f0c841
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Jul 3 14:36:32 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Sun Jul 7 03:48:41 2013 +0000
----------------------------------------------------------------------
requirements-sf.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6901e8ae/requirements-sf.txt
----------------------------------------------------------------------
diff --git a/requirements-sf.txt b/requirements-sf.txt
index 6c052c6..c151bbf 100644
--- a/requirements-sf.txt
+++ b/requirements-sf.txt
@@ -5,7 +5,7 @@ amqplib==0.6.1
kombu==1.0.4
coverage==3.5a1-20110413
ForgeHg==0.1.13
-ForgePastebin==0.2.6
+ForgePastebin==0.2.7
mechanize==0.2.4
mercurial==1.4.3
MySQL-python==1.2.3c1
[6/6] git commit: [#6056] Fixed "unexpected keyword arguments" from
repo controllers
Posted by tv...@apache.org.
[#6056] Fixed "unexpected keyword arguments" from repo controllers
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/8516efb1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/8516efb1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/8516efb1
Branch: refs/heads/master
Commit: 8516efb1d9392f92e17c947251f9898051962aa9
Parents: 96df73a
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Jul 2 00:13:07 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Sun Jul 7 03:48:41 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/repository.py | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8516efb1/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index c8d852b..d9331c7 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -86,7 +86,7 @@ class RepoRootController(BaseController, FeedController):
@with_trailing_slash
@expose('jinja:allura:templates/repo/forks.html')
- def forks(self):
+ def forks(self, **kw):
links = []
if c.app.repo.forks:
@@ -99,7 +99,7 @@ class RepoRootController(BaseController, FeedController):
return dict(links=links)
@expose()
- def refresh(self):
+ def refresh(self, **kw):
allura.tasks.repo_tasks.refresh.post()
if request.referer:
flash('Repository is being refreshed')
@@ -109,7 +109,7 @@ class RepoRootController(BaseController, FeedController):
@with_trailing_slash
@expose('jinja:allura:templates/repo/fork.html')
- def fork(self, project_id=None, mount_point=None, mount_label=None):
+ def fork(self, project_id=None, mount_point=None, mount_label=None, **kw):
# this shows the form and handles the submission
security.require_authenticated()
if not c.app.forkable: raise exc.HTTPNotFound
@@ -159,7 +159,7 @@ class RepoRootController(BaseController, FeedController):
@without_trailing_slash
@expose('jinja:allura:templates/repo/request_merge.html')
- def request_merge(self, branch=None):
+ def request_merge(self, branch=None, **kw):
security.require(security.has_access(c.app.repo, 'admin'))
c.form = self.mr_widget
if branch is None:
@@ -193,7 +193,7 @@ class RepoRootController(BaseController, FeedController):
@without_trailing_slash
@expose('jinja:allura:templates/repo/commit_browser.html')
- def commit_browser(self):
+ def commit_browser(self, **kw):
if not c.app.repo or c.app.repo.status != 'ready':
return dict(status='not_ready')
# if c.app.repo.count() > 2000:
@@ -205,7 +205,7 @@ class RepoRootController(BaseController, FeedController):
@without_trailing_slash
@expose('json:')
- def commit_browser_data(self):
+ def commit_browser_data(self, **kw):
head_ids = [ head.object_id for head in c.app.repo.get_heads() ]
commit_ids = [c.app.repo.rev_to_commit_id(r) for r in c.app.repo.log(head_ids, id_only=True)]
log.info('Grab %d commit objects by ID', len(commit_ids))
@@ -307,7 +307,7 @@ class MergeRequestsController(object):
@expose('jinja:allura:templates/repo/merge_requests.html')
@validate(mr_filter)
- def index(self, status=None):
+ def index(self, status=None, **kw):
status = status or ['open']
requests = c.app.repo.merge_requests_by_statuses(*status)
c.mr_filter = self.mr_filter
@@ -333,7 +333,7 @@ class MergeRequestController(object):
if self.req is None: raise exc.HTTPNotFound
@expose('jinja:allura:templates/repo/merge_request.html')
- def index(self, page=0, limit=250):
+ def index(self, page=0, limit=250, **kw):
c.thread = self.thread_widget
c.log_widget = self.log_widget
c.mr_dispose_form = self.mr_dispose_form
@@ -349,7 +349,7 @@ class MergeRequestController(object):
@expose()
@require_post()
@validate(mr_dispose_form)
- def save(self, status=None):
+ def save(self, status=None, **kw):
security.require(
security.has_access(self.req, 'write'), 'Write access required')
self.req.status = status
@@ -423,7 +423,7 @@ class CommitBrowser(BaseController):
@expose('jinja:allura:templates/repo/commit.html')
@validate(dict(page=validators.Int(if_empty=0),
limit=validators.Int(if_empty=DEFAULT_PAGE_LIMIT)))
- def index(self, page=0, limit=DEFAULT_PAGE_LIMIT):
+ def index(self, page=0, limit=DEFAULT_PAGE_LIMIT, **kw):
c.revision_widget = self.revision_widget
c.page_list = self.page_list
result = dict(commit=self._commit)
@@ -442,7 +442,7 @@ class CommitBrowser(BaseController):
return result
@expose('jinja:allura:templates/repo/commit_basic.html')
- def basic(self):
+ def basic(self, **kw):
c.revision_widget = self.revision_widget
result = dict(commit=self._commit)
if self._commit:
@@ -560,7 +560,7 @@ class TreeBrowser(BaseController, DispatchIndex):
@expose()
@validate(subscribe_form)
- def subscribe(self, subscribe=None, unsubscribe=None):
+ def subscribe(self, subscribe=None, unsubscribe=None, **kw):
if subscribe:
M.Mailbox.subscribe()
elif unsubscribe:
@@ -599,7 +599,7 @@ class FileBrowser(BaseController):
)
@expose()
- def raw(self):
+ def raw(self, **kw):
content_type = self._blob.content_type.encode('utf-8')
filename = self._blob.name.encode('utf-8')
response.headers['Content-Type'] = ''
@@ -612,7 +612,7 @@ class FileBrowser(BaseController):
'Content-Disposition', 'attachment;filename=' + filename)
return iter(self._blob)
- def diff(self, commit, fmt=None):
+ def diff(self, commit, fmt=None, **kw):
try:
path, filename = os.path.split(self._blob.path())
a_ci = c.app.repo.commit(commit)
[4/6] git commit: [#6056] Fixed KeyError when browsing invalid trees
in SCM
Posted by tv...@apache.org.
[#6056] Fixed KeyError when browsing invalid trees in SCM
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/96df73a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/96df73a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/96df73a1
Branch: refs/heads/master
Commit: 96df73a1789843cb8dbdffcec050beaa985cb71b
Parents: 8e1581e
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Jul 1 21:49:25 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Sun Jul 7 03:48:41 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/repository.py | 5 +++--
ForgeGit/forgegit/tests/functional/test_controllers.py | 7 +++++++
2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/96df73a1/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 4f6122d..c8d852b 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -548,8 +548,9 @@ class TreeBrowser(BaseController, DispatchIndex):
filename), rest
elif rest == ('index', ):
rest = (request.environ['PATH_INFO'].rsplit('/')[-1],)
- tree = self._tree[next]
- if tree is None:
+ try:
+ tree = self._tree[next]
+ except KeyError:
raise exc.HTTPNotFound
return self.__class__(
self._commit,
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/96df73a1/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index c4ac325..3304625 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -205,6 +205,13 @@ class TestRootController(_TestCase):
resp = self.app.get(ci + 'tree/?format=raw')
assert 'README' in resp, resp.showbrowser()
+ def test_tree_invalid(self):
+ ci = self._get_ci()
+ resp = self.app.get(ci + 'tree/foo', status=404)
+ assert_equal(resp.status_int, 404)
+ resp = self.app.get(ci + 'tree/foo/bar', status=404)
+ assert_equal(resp.status_int, 404)
+
def test_file(self):
ci = self._get_ci()
resp = self.app.get(ci + 'tree/README')
[2/6] git commit: [#6056] Catch IndexError on invalid wiki page
version
Posted by tv...@apache.org.
[#6056] Catch IndexError on invalid wiki page version
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/fe6f4b26
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/fe6f4b26
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/fe6f4b26
Branch: refs/heads/master
Commit: fe6f4b26fe5b35f4daf0aba6a293e1a81d0445eb
Parents: 8516efb
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Jul 2 00:49:06 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Sun Jul 7 03:48:41 2013 +0000
----------------------------------------------------------------------
ForgeWiki/forgewiki/wiki_main.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fe6f4b26/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index 650d271..9cc0ffc 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -439,7 +439,7 @@ class PageController(BaseController, FeedController):
if not version: return self.page
try:
return self.page.get_version(version)
- except ValueError:
+ except (ValueError, IndexError):
return None
@expose()
[3/6] git commit: [#6056] Fixed _lookup error in ForgeBlog
Posted by tv...@apache.org.
[#6056] Fixed _lookup error in ForgeBlog
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/8e1581e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/8e1581e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/8e1581e5
Branch: refs/heads/master
Commit: 8e1581e5ab3a696bb81560f8fb994891c0a3b36f
Parents: 4358701
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Jul 1 21:41:13 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Sun Jul 7 03:48:41 2013 +0000
----------------------------------------------------------------------
ForgeBlog/forgeblog/main.py | 4 +++-
ForgeBlog/forgeblog/tests/functional/test_root.py | 6 +++++-
2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8e1581e5/ForgeBlog/forgeblog/main.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/main.py b/ForgeBlog/forgeblog/main.py
index 24b0bf2..0b9ff70 100644
--- a/ForgeBlog/forgeblog/main.py
+++ b/ForgeBlog/forgeblog/main.py
@@ -261,7 +261,9 @@ class RootController(BaseController, FeedController):
return dict()
@expose()
- def _lookup(self, year, month, name, *rest):
+ def _lookup(self, year=None, month=None, name=None, *rest):
+ if year is None or month is None or name is None:
+ raise exc.HTTPNotFound()
slug = '/'.join((year, month, urllib2.unquote(name).decode('utf-8')))
post = BM.BlogPost.query.get(slug=slug, app_config_id=c.app.config._id)
if post is None:
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8e1581e5/ForgeBlog/forgeblog/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/tests/functional/test_root.py b/ForgeBlog/forgeblog/tests/functional/test_root.py
index 3c13a69..4409b33 100644
--- a/ForgeBlog/forgeblog/tests/functional/test_root.py
+++ b/ForgeBlog/forgeblog/tests/functional/test_root.py
@@ -17,6 +17,7 @@
import datetime
+from nose.tools import assert_equal
from ming.orm.ormsession import ThreadLocalORMSession
from mock import patch
@@ -203,7 +204,6 @@ class TestRootController(TestController):
response = self.app.get('/blog/feed')
assert '<div class="markdown_content"><p><em>sometext</em></p></div>' in response
-
def test_related_artifacts(self):
self._post(title='one')
d = self._blog_date()
@@ -213,3 +213,7 @@ class TestRootController(TestController):
r= self.app.get('/blog/%s/one/' % d)
assert 'Related' in r
assert 'Blog Post: %s/two' % d in r
+
+ def test_invalid_lookup(self):
+ r = self.app.get('/blog/favicon.ico', status=404)
+ assert_equal(r.status_int, 404)
[5/6] git commit: [#6056] Improved loading of discussion post by slug
Posted by tv...@apache.org.
[#6056] Improved loading of discussion post by slug
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/9f0c8412
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/9f0c8412
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/9f0c8412
Branch: refs/heads/master
Commit: 9f0c841263e319cec004becc687b16703cb16951
Parents: fe6f4b2
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Jul 2 02:02:54 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Sun Jul 7 03:48:41 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/discuss.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9f0c8412/Allura/allura/controllers/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
index 4fa05c8..9ff5e6c 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -256,11 +256,12 @@ class PostController(BaseController):
@LazyProperty
def post(self):
- result = self.M.Post.query.find(dict(slug=self._post_slug)).all()
- for p in result:
- if p.thread_id == self.thread._id: return p
- if result:
- redirect(result[0].url())
+ post = self.M.Post.query.get(slug=self._post_slug, thread_id=self.thread._id)
+ if post:
+ return post
+ post = self.M.Post.query.get(slug=self._post_slug)
+ if post:
+ return post
else:
redirect('..')