You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/08/13 20:06:28 UTC
[01/50] allura git commit: [#7947] remove unnecessary line breakage
Repository: allura
Updated Branches:
refs/heads/ib/7922 3c0d5bfcd -> f3e16b3a6 (forced update)
[#7947] remove unnecessary line breakage
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/556a99e9
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/556a99e9
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/556a99e9
Branch: refs/heads/ib/7922
Commit: 556a99e9d986a9ebff4b84c36bf64886da02e4fd
Parents: 7075554
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Aug 3 18:10:54 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Aug 3 18:10:54 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/markdown_extensions.py | 36 +++++++++------------------
Allura/allura/model/project.py | 3 +--
2 files changed, 13 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/556a99e9/Allura/allura/lib/markdown_extensions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/markdown_extensions.py b/Allura/allura/lib/markdown_extensions.py
index 9a68e1a..83e8069 100644
--- a/Allura/allura/lib/markdown_extensions.py
+++ b/Allura/allura/lib/markdown_extensions.py
@@ -74,18 +74,14 @@ class CommitMessageExtension(markdown.Extension):
md.registerExtension(self)
# remove default preprocessors and add our own
md.preprocessors.clear()
- md.preprocessors['trac_refs'] = PatternReplacingProcessor(
- TracRef1(), TracRef2(), TracRef3(self.app))
+ md.preprocessors['trac_refs'] = PatternReplacingProcessor(TracRef1(), TracRef2(), TracRef3(self.app))
# remove all inlinepattern processors except short refs and links
md.inlinePatterns.clear()
- md.inlinePatterns["link"] = markdown.inlinepatterns.LinkPattern(
- markdown.inlinepatterns.LINK_RE, md)
- md.inlinePatterns['short_reference'] = ForgeLinkPattern(
- markdown.inlinepatterns.SHORT_REF_RE, md, ext=self)
+ md.inlinePatterns["link"] = markdown.inlinepatterns.LinkPattern(markdown.inlinepatterns.LINK_RE, md)
+ md.inlinePatterns['short_reference'] = ForgeLinkPattern(markdown.inlinepatterns.SHORT_REF_RE, md, ext=self)
# remove all default block processors except for paragraph
md.parser.blockprocessors.clear()
- md.parser.blockprocessors['paragraph'] = \
- markdown.blockprocessors.ParagraphProcessor(md.parser)
+ md.parser.blockprocessors['paragraph'] = markdown.blockprocessors.ParagraphProcessor(md.parser)
# wrap artifact link text in square brackets
self.forge_link_tree_processor = ForgeLinkTreeProcessor(md)
md.treeprocessors['links'] = self.forge_link_tree_processor
@@ -253,31 +249,23 @@ class ForgeExtension(markdown.Extension):
# https://github.com/waylan/Python-Markdown/issues/52
md.preprocessors['html_block'].markdown_in_raw = True
md.preprocessors['fenced-code'] = FencedCodeProcessor()
- md.preprocessors.add('plain_text_block',
- PlainTextPreprocessor(md), "_begin")
- md.preprocessors.add(
- 'macro_include', ForgeMacroIncludePreprocessor(md), '_end')
+ md.preprocessors.add('plain_text_block', PlainTextPreprocessor(md), "_begin")
+ md.preprocessors.add('macro_include', ForgeMacroIncludePreprocessor(md), '_end')
# this has to be before the 'escape' processor, otherwise weird
# placeholders are inserted for escaped chars within urls, and then the
# autolink can't match the whole url
- md.inlinePatterns.add('autolink_without_brackets', AutolinkPattern(
- r'(http(?:s?)://[a-zA-Z0-9./\-\\_%?&=+#;~:!]+)', md), '<escape')
+ md.inlinePatterns.add('autolink_without_brackets', AutolinkPattern(r'(http(?:s?)://[a-zA-Z0-9./\-\\_%?&=+#;~:!]+)', md), '<escape')
# replace the link pattern with our extended version
- md.inlinePatterns['link'] = ForgeLinkPattern(
- markdown.inlinepatterns.LINK_RE, md, ext=self)
- md.inlinePatterns['short_reference'] = ForgeLinkPattern(
- markdown.inlinepatterns.SHORT_REF_RE, md, ext=self)
+ md.inlinePatterns['link'] = ForgeLinkPattern(markdown.inlinepatterns.LINK_RE, md, ext=self)
+ md.inlinePatterns['short_reference'] = ForgeLinkPattern(markdown.inlinepatterns.SHORT_REF_RE, md, ext=self)
# macro must be processed before links
- md.inlinePatterns.add(
- 'macro', ForgeMacroPattern(MACRO_PATTERN, md, ext=self), '<link')
+ md.inlinePatterns.add('macro', ForgeMacroPattern(MACRO_PATTERN, md, ext=self), '<link')
self.forge_link_tree_processor = ForgeLinkTreeProcessor(md)
md.treeprocessors['links'] = self.forge_link_tree_processor
# Sanitize HTML
md.postprocessors['sanitize_html'] = HTMLSanitizer()
- # Rewrite all relative links that don't start with . to have a '../'
- # prefix
- md.postprocessors['rewrite_relative_links'] = RelativeLinkRewriter(
- make_absolute=self._is_email)
+ # Rewrite all relative links that don't start with . to have a '../' prefix
+ md.postprocessors['rewrite_relative_links'] = RelativeLinkRewriter(make_absolute=self._is_email)
# Put a class around markdown content for custom css
md.postprocessors['add_custom_class'] = AddCustomClass()
md.postprocessors['mark_safe'] = MarkAsSafe()
http://git-wip-us.apache.org/repos/asf/allura/blob/556a99e9/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index b45af77..cef25bc 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -859,8 +859,7 @@ class Project(SearchIndexable, MappedClass, ActivityNode, ActivityObject):
named_roles = security.RoleCache(
g.credentials,
g.credentials.project_roles(project_id=self.root_project._id).named)
- uids = [
- uid for uid in named_roles.userids_that_reach if uid is not None]
+ uids = [uid for uid in named_roles.userids_that_reach if uid is not None]
return list(User.query.find({'_id': {'$in': uids}, 'disabled': False, 'pending': False}))
def users_with_role(self, *role_names):
[17/50] allura git commit: [#7925] Update tests to work with new diff
processing
Posted by je...@apache.org.
[#7925] Update tests to work with new diff processing
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/04b87c66
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/04b87c66
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/04b87c66
Branch: refs/heads/ib/7922
Commit: 04b87c6612c2c1ae4b1dd933e7a7f3734d251228
Parents: 7f738bd
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Jul 27 16:08:05 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:35 2015 -0400
----------------------------------------------------------------------
Allura/allura/tests/model/test_repo.py | 2 +
.../forgegit/tests/model/test_repository.py | 10 ++++
.../forgesvn/tests/model/test_repository.py | 59 +++++++++++++-------
3 files changed, 52 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/04b87c66/Allura/allura/tests/model/test_repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_repo.py b/Allura/allura/tests/model/test_repo.py
index 1f6ec3c..c0a6bc8 100644
--- a/Allura/allura/tests/model/test_repo.py
+++ b/Allura/allura/tests/model/test_repo.py
@@ -143,6 +143,8 @@ class TestLastCommit(unittest.TestCase):
self.repo.paged_diffs.return_value = {
'added': [],
'removed': [],
+ 'copied': [],
+ 'renamed': [],
'changed': [],
'total': 0,
}
http://git-wip-us.apache.org/repos/asf/allura/blob/04b87c66/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 9f007e6..948f228 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -670,6 +670,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'added': [u'with space.txt', u'привіт.txt'],
'removed': [],
'changed': [],
+ 'copied': [],
+ 'renamed': [],
'total': 2,
}
assert_equals(diffs, expected)
@@ -678,6 +680,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
expected = {
'added': [],
'removed': [],
+ 'copied': [],
+ 'renamed': [],
'changed': [u'привіт.txt'],
'total': 1,
}
@@ -689,6 +693,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'added': [u'README.md'],
'removed': [],
'changed': [],
+ 'copied': [],
+ 'renamed': [],
'total': 1,
}
assert_equals(diffs, expected)
@@ -698,6 +704,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
expected = {
'added': [u'with space.txt'],
'removed': [],
+ 'copied': [],
+ 'renamed': [],
'changed': [],
'total': 2,
}
@@ -706,6 +714,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
expected = {
'added': [u'привіт.txt'],
'removed': [],
+ 'copied': [],
+ 'renamed': [],
'changed': [],
'total': 2,
}
http://git-wip-us.apache.org/repos/asf/allura/blob/04b87c66/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 79beb52..9889a60 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -363,7 +363,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
self.assertEqual(entry.diffs, entry.paged_diffs(start=0))
added_expected = entry.diffs.added[1:3]
expected = dict(
- copied=[], changed=[], removed=[],
+ copied=[], changed=[], removed=[], renamed=[],
added=added_expected, total=4)
actual = entry.paged_diffs(start=1, end=3)
self.assertEqual(expected, actual)
@@ -376,7 +376,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
entry = self.repo.commit(self.repo.log(1, id_only=True).next())
self.assertEqual(
entry.diffs, dict(
- copied=[], changed=[],
+ copied=[], changed=[], renamed=[],
removed=[], added=['/README'], total=1))
def test_diff_create_path(self):
@@ -385,7 +385,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
actual.added = sorted(actual.added)
self.assertEqual(
entry.diffs, dict(
- copied=[], changed=[], removed=[],
+ copied=[], changed=[], removed=[], renamed=[],
added=sorted([
'/a', '/a/b', '/a/b/c',
'/a/b/c/hello.txt']), total=4))
@@ -394,20 +394,20 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
entry = self.repo.commit(self.repo.log(3, id_only=True).next())
self.assertEqual(
entry.diffs, dict(
- copied=[], changed=['/README'],
+ copied=[], changed=['/README'], renamed=[],
removed=[], added=[], total=1))
def test_diff_delete(self):
entry = self.repo.commit(self.repo.log(4, id_only=True).next())
self.assertEqual(
entry.diffs, dict(
- copied=[], changed=[],
+ copied=[], changed=[], renamed=[],
removed=['/a/b/c/hello.txt'], added=[], total=1))
def test_diff_copy(self):
entry = self.repo.commit(self.repo.log(5, id_only=True).next())
assert_equals(dict(entry.diffs), dict(
- copied=[{'new': u'/b', 'old': u'/a', 'diff': '', 'ratio': 1}],
+ copied=[{'new': u'/b', 'old': u'/a', 'diff': '', 'ratio': 1}], renamed=[],
changed=[], removed=[], added=[], total=1))
def test_commit(self):
@@ -1002,6 +1002,8 @@ class TestCommit(_TestWithRepo):
self.repo._impl.paged_diffs.return_value = {
'added': ['a', 'a/a', 'a/a/a', 'a/a/b', 'a/b'],
'changed': [],
+ 'copied': [],
+ 'renamed': [],
'removed': [],
'total': 5,
}
@@ -1024,6 +1026,8 @@ class TestCommit(_TestWithRepo):
self._make_log(ci)
self.repo._impl.paged_diffs.return_value = {
'added': ['b', 'b/a', 'b/a/a', 'b/a/b', 'b/b'],
+ 'renamed': [],
+ 'copied': [],
'changed': [],
'removed': ['a', 'a/a', 'a/a/a', 'a/a/b', 'a/b'],
'total': 10,
@@ -1044,25 +1048,38 @@ class TestCommit(_TestWithRepo):
ci.parent_ids = ['bar']
self._make_log(ci)
self.repo._impl.paged_diffs.return_value = {
- 'added': ['b/c', 'b/a/z'],
+ 'added': [u'b/c', u'b/a/z'],
+ 'removed': [u'/b/a/b', u'b/b'],
'changed': [],
- 'removed': ['b/a/b', 'b/b', 'b/a/a'],
- 'total': 10,
+ 'copied': [
+ {
+ 'new': u'b/c',
+ 'old': u'b/a/b',
+ 'ratio': 1,
+ 'diff': '',
+ },
+ {
+ 'new': u'b/a/z',
+ 'old': u'b/b',
+ 'ratio': 1,
+ 'diff': '',
+ },
+ ],
+ 'renamed': [],
+ 'total': 2
}
M.repo_refresh.refresh_commit_trees(ci, {})
- assert_equal(ci.diffs.added, [])
+ assert_equal(ci.diffs.added, [u'b/a/z', u'b/c'])
assert_equal(ci.diffs.changed, [])
- assert_equal(ci.diffs.removed, ['b/a/a'])
+ assert_equal(ci.diffs.removed, [u'/b/a/b', u'b/b'])
# see mock for open_blob
assert_equal(len(ci.diffs.copied), 2)
- assert_equal(ci.diffs.copied[0]['old'], 'b/a/b')
- assert_equal(ci.diffs.copied[0]['new'], 'b/c')
- assert_equal(ci.diffs.copied[0]['ratio'], 1)
- assert_equal(ci.diffs.copied[0]['diff'], '')
- assert_equal(ci.diffs.copied[1]['old'], 'b/b')
- assert_equal(ci.diffs.copied[1]['new'], 'b/a/z')
- assert ci.diffs.copied[1]['ratio'] < 1, ci.diffs.copied[1]['ratio']
- assert '+++' in ci.diffs.copied[1]['diff'], ci.diffs.copied[1]['diff']
+ assert_equal(ci.diffs.copied[1]['old'], 'b/a/b')
+ assert_equal(ci.diffs.copied[1]['new'], 'b/c')
+ assert_equal(ci.diffs.copied[1]['ratio'], 1)
+ assert_equal(ci.diffs.copied[1]['diff'], '')
+ assert_equal(ci.diffs.copied[0]['old'], 'b/b')
+ assert_equal(ci.diffs.copied[0]['new'], 'b/a/z')
def test_context(self):
self.ci.context()
@@ -1132,6 +1149,7 @@ class TestDirectRepoAccess(object):
'removed': [],
'changed': [],
'copied': [],
+ 'renamed': [],
'total': 1,
}
assert_equals(diffs, expected)
@@ -1142,6 +1160,7 @@ class TestDirectRepoAccess(object):
'added': [u'/a', u'/a/b', u'/a/b/c', u'/a/b/c/hello.txt'],
'removed': [],
'changed': [],
+ 'renamed': [],
'copied': [],
'total': 4,
}
@@ -1152,6 +1171,7 @@ class TestDirectRepoAccess(object):
expected = {
'added': [],
'removed': [],
+ 'renamed': [],
'changed': [u'/README'],
'copied': [],
'total': 1,
@@ -1164,6 +1184,7 @@ class TestDirectRepoAccess(object):
'added': [],
'removed': ['/a/b/c/hello.txt'],
'changed': [],
+ 'renamed': [],
'copied': [],
'total': 1,
}
[33/50] allura git commit: [#7925] add test for commit view of a
rename
Posted by je...@apache.org.
[#7925] add test for commit view of a rename
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/46baba14
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/46baba14
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/46baba14
Branch: refs/heads/ib/7922
Commit: 46baba14d7286953d72ac10cfa3385746a7b5444
Parents: 5ac9651
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Aug 5 15:30:11 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:38 2015 -0400
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 1 -
.../tests/functional/test_controllers.py | 29 ++++++++++++++------
2 files changed, 21 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/46baba14/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 8849a40..318f81f 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -675,7 +675,6 @@ class GitImplementation(M.RepositoryImplementation):
while x < len(cmd_output):
status = cmd_output[x][0]
if status in ('R', 'C'):
- # TODO: make sure we have a test for this
ratio = float(cmd_output[x][1:4]) / 100.0
files.append((status, {
'new': h.really_unicode(cmd_output[x + 2]),
http://git-wip-us.apache.org/repos/asf/allura/blob/46baba14/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 48969fc..4c363d2 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -820,8 +820,7 @@ class TestGitRename(TestController):
@with_git
def setup_with_tools(self):
h.set_context('test', 'src-git', neighborhood='Projects')
- repo_dir = pkg_resources.resource_filename(
- 'forgegit', 'tests/data')
+ repo_dir = pkg_resources.resource_filename('forgegit', 'tests/data')
c.app.repo.fs_path = repo_dir
c.app.repo.status = 'ready'
c.app.repo.name = 'testrename.git'
@@ -831,22 +830,36 @@ class TestGitRename(TestController):
ThreadLocalORMSession.flush_all()
def test_log(self):
- resp = self.app.get(
- '/src-git/ci/259c77dd6ee0e6091d11e429b56c44ccbf1e64a3/log/?path=/f2.txt')
+ # commit after the rename
+ resp = self.app.get('/src-git/ci/259c77dd6ee0e6091d11e429b56c44ccbf1e64a3/log/?path=/f2.txt')
assert '<b>renamed from</b>' in resp
assert '/f.txt' in resp
assert '(27 Bytes)' in resp
assert '(19 Bytes)' in resp
- resp = self.app.get(
- '/src-git/ci/fbb0644603bb6ecee3ebb62efe8c86efc9b84ee6/log/?path=/f.txt')
+ # commit before the rename
+ resp = self.app.get('/src-git/ci/fbb0644603bb6ecee3ebb62efe8c86efc9b84ee6/log/?path=/f.txt')
assert '(19 Bytes)' in resp
assert '(10 Bytes)' in resp
- resp = self.app.get(
- '/src-git/ci/7c09182e61af959e4f1fb0e354bab49f14ef810d/tree/f.txt')
+ # first commit, adding the file
+ resp = self.app.get('/src-git/ci/7c09182e61af959e4f1fb0e354bab49f14ef810d/tree/f.txt')
assert "2 lines (1 with data), 10 Bytes" in resp
+ def test_commit(self):
+ # get the rename commit itself
+ resp = self.app.get('/src-git/ci/b120505a61225e6c14bee3e5b5862db81628c35c/')
+
+ # the top portion of the output
+ assert "<td>renamed" in resp
+ assert "f.txt -> f2.txt" in resp
+
+ # the diff portion of the output
+ resp_no_ws = re.sub(r'\s+', '', str(resp))
+ assert '<a href="/p/test/src-git/ci/fbb0644603bb6ecee3ebb62efe8c86efc9b84ee6/tree/f.txt">f.txt</a>to<a href="/p/test/src-git/ci/b120505a61225e6c14bee3e5b5862db81628c35c/tree/f2.txt">f2.txt</a>'.replace(' ','') \
+ in resp_no_ws
+ assert '<span class="empty-diff">File was renamed.</span>' in resp
+
class TestGitBranch(TestController):
def setUp(self):
[45/50] allura git commit: [#7922] ticket:834 Change menu header to
h3/link
Posted by je...@apache.org.
[#7922] ticket:834 Change menu header to h3/link
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/d8de1714
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d8de1714
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d8de1714
Branch: refs/heads/ib/7922
Commit: d8de17143566ebf3b7a97359c3428d04d2f8c03d
Parents: e7a08f8
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Aug 13 18:37:58 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 18:37:58 2015 +0300
----------------------------------------------------------------------
Allura/allura/app.py | 1 -
Allura/allura/nf/allura/css/allura.css | 4 ++-
.../templates/jinja_master/sidebar_menu.html | 35 ++++++--------------
3 files changed, 14 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/d8de1714/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index f060204..28ff19e 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -632,7 +632,6 @@ class Application(object):
"""Returns button for showing/hiding admin sidebar menu"""
return SitemapEntry(
label='Admin',
- url='#',
extra_html_attrs={
'id': 'sidebar-admin-menu-trigger',
})
http://git-wip-us.apache.org/repos/asf/allura/blob/d8de1714/Allura/allura/nf/allura/css/allura.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/allura.css b/Allura/allura/nf/allura/css/allura.css
index 17ee342..2fb97ed 100644
--- a/Allura/allura/nf/allura/css/allura.css
+++ b/Allura/allura/nf/allura/css/allura.css
@@ -86,4 +86,6 @@ tr.rev div.markdown_content p {
#phone_verification_overlay iframe {
height: 320px;
-}
\ No newline at end of file
+}
+
+#sidebar-admin-header { cursor: pointer; }
http://git-wip-us.apache.org/repos/asf/allura/blob/d8de1714/Allura/allura/templates/jinja_master/sidebar_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/sidebar_menu.html b/Allura/allura/templates/jinja_master/sidebar_menu.html
index 752440c..4505804 100644
--- a/Allura/allura/templates/jinja_master/sidebar_menu.html
+++ b/Allura/allura/templates/jinja_master/sidebar_menu.html
@@ -55,35 +55,22 @@
{% endif %}
{% if c.app %}
{% if h.has_access(c.app, 'admin')() %}
- <style>
- #sidebar-admin-menu.hide ul li:not(:first-child) {
- display: none;
- }
- #sidebar-admin-menu.hide ul li:first-child {
- border-bottom: medium none;
- }
- </style>
- <div id='sidebar-admin-menu' class='hide'>
- {% for s in c.app.admin_menu() %}
- {% if loop.first %}
+ {% if c.app.admin_menu() %}
+ <a id='sidebar-admin-header' onclick='$("#sidebar-admin-menu").toggleClass("hidden");'>
{{sidebar_item(c.app.admin_menu_collapse_button)}}
- <script>
- $('#sidebar-admin-menu-trigger').click(function(e) {
- e.preventDefault();
- $(this).parents('li').toggleClass('active');
- $('#sidebar-admin-menu').toggleClass('hide');
- });
- </script>
- {% endif %}
- {{sidebar_item(s)}}
- {% endfor %}
- {{sidebar_item(c.app.admin_menu_delete_button)}}
- {{sidebar_item(None)}}
+ </a>
+ <div id='sidebar-admin-menu' class='hidden'>
+ {% for s in c.app.admin_menu() %}
+ {{sidebar_item(s)}}
+ {% endfor %}
+ {{sidebar_item(c.app.admin_menu_delete_button)}}
+ {{sidebar_item(None)}}
+ </div>
+ {% endif %}
{{c.app.admin_modal.display()}}
{% if c.app.admin_menu_delete_button %}
{{c.app.admin_tool_delete_modal.display()}}
{% endif %}
- </div>
{% endif %}
{% for s in c.app.sidebar_menu() %}
{{sidebar_item(s)}}
[48/50] allura git commit: [#7922] ticket:834 Fix admin/tools menu
display when wiki left bar is hidden
Posted by je...@apache.org.
[#7922] ticket:834 Fix admin/tools menu display when wiki left bar is hidden
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/2e970fac
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/2e970fac
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/2e970fac
Branch: refs/heads/ib/7922
Commit: 2e970fac13e9c2278d743529cdaf8a9608bd62c5
Parents: 858c38f
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Aug 13 19:13:46 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 19:13:46 2015 +0300
----------------------------------------------------------------------
ForgeWiki/forgewiki/wiki_main.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/2e970fac/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index ce99198..6542215 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -232,7 +232,7 @@ The wiki uses [Markdown](%s) syntax.
SitemapEntry('Wiki Home', self.url, className='wiki_home')]
links += [SitemapEntry('Browse Pages', self.url + 'browse_pages/'),
SitemapEntry('Browse Labels', self.url + 'browse_tags/')]
- discussion = c.app.config.discussion
+ discussion = self.config.discussion
pending_mod_count = M.Post.query.find({
'discussion_id': discussion._id,
'status': 'pending',
@@ -250,8 +250,9 @@ The wiki uses [Markdown](%s) syntax.
subscribe_action.capitalize(),
'' if subscribed else ' to wiki')
subscribe_url = '{}#toggle-subscribe'.format(self.url)
- links += [SitemapEntry(''),
- SitemapEntry(subscribe_title, subscribe_url, ui_icon=g.icons['mail'])]
+ if not admin_menu:
+ links.append(SitemapEntry(None))
+ links.append(SitemapEntry(subscribe_title, subscribe_url, ui_icon=g.icons['mail']))
if not admin_menu:
links += [SitemapEntry(''),
SitemapEntry('Formatting Help', self.url + 'markdown_syntax/')]
[14/50] allura git commit: [#7950] set a max height to the markdown
editor
Posted by je...@apache.org.
[#7950] set a max height to the markdown editor
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/d884945e
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d884945e
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d884945e
Branch: refs/heads/ib/7922
Commit: d884945e3d68596f0e28c1a0502273461e956046
Parents: dc857c5
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Thu Aug 6 17:14:34 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Aug 6 17:14:34 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/widgets/resources/css/markitup_sf.css | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/d884945e/Allura/allura/lib/widgets/resources/css/markitup_sf.css
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/css/markitup_sf.css b/Allura/allura/lib/widgets/resources/css/markitup_sf.css
index 9712461..03822f4 100644
--- a/Allura/allura/lib/widgets/resources/css/markitup_sf.css
+++ b/Allura/allura/lib/widgets/resources/css/markitup_sf.css
@@ -24,12 +24,14 @@
}
.markdown_edit .CodeMirror {
min-height: 60px;
+ height: auto;
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.markdown_edit .CodeMirror-scroll {
min-height: 60px;
+ max-height: 500px;
}
.markdown_edit .editor-statusbar {
border: 1px solid #ddd;
[30/50] allura git commit: [#7925] show diffs of renames & copies (if
they had changes)
Posted by je...@apache.org.
[#7925] show diffs of renames & copies (if they had changes)
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/b950a1fd
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/b950a1fd
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/b950a1fd
Branch: refs/heads/ib/7922
Commit: b950a1fd6eeff1e3c7e0d7dc58b3387af70f70d3
Parents: 95f5648
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Jul 31 22:32:35 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:37 2015 -0400
----------------------------------------------------------------------
Allura/allura/controllers/repository.py | 17 ++++++++++++-----
Allura/allura/templates/repo/commit.html | 12 +++++++++++-
ForgeGit/forgegit/model/git_repo.py | 1 -
ForgeSVN/forgesvn/model/svn.py | 1 -
ForgeSVN/forgesvn/tests/model/test_repository.py | 4 ++--
5 files changed, 25 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/b950a1fd/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index c17f06a..699931b 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -724,11 +724,11 @@ class FileBrowser(BaseController):
elif 'diff' in kw:
tg.decorators.override_template(
self.index, 'jinja:allura:templates/repo/diff.html')
- return self.diff(kw['diff'], kw.pop('diformat', None))
+ return self.diff(kw['diff'], kw.pop('diformat', None), kw.pop('prev_file', None))
elif 'barediff' in kw:
tg.decorators.override_template(
self.index, 'jinja:allura:templates/repo/barediff.html')
- return self.diff(kw['barediff'], kw.pop('diformat', None))
+ return self.diff(kw['barediff'], kw.pop('diformat', None), kw.pop('prev_file', None))
else:
force_display = 'force' in kw
stats = utils.generate_code_stats(self._blob)
@@ -753,13 +753,20 @@ class FileBrowser(BaseController):
'attachment;filename="%s"' % filename)
return iter(self._blob)
- def diff(self, commit, fmt=None, **kw):
+ def diff(self, prev_commit, fmt=None, prev_file=None, **kw):
+ '''
+ :param prev_commit: previous commit to compare against
+ :param fmt: "sidebyside", or anything else for "unified"
+ :param prev_file: previous filename, if different
+ :return:
+ '''
try:
path, filename = os.path.split(self._blob.path())
- a_ci = c.app.repo.commit(commit)
- a = a_ci.get_path(self._blob.path())
+ a_ci = c.app.repo.commit(prev_commit)
+ a = a_ci.get_path(prev_file or self._blob.path())
apath = a.path()
except:
+ # prev commit doesn't have the file
a = []
apath = ''
b = self._blob
http://git-wip-us.apache.org/repos/asf/allura/blob/b950a1fd/Allura/allura/templates/repo/commit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/commit.html b/Allura/allura/templates/repo/commit.html
index b0adabc..06da620 100644
--- a/Allura/allura/templates/repo/commit.html
+++ b/Allura/allura/templates/repo/commit.html
@@ -148,6 +148,10 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
<a href="{{prev[0].url()}}tree/{{h.urlquote(h.really_unicode(file.old))}}">{{h.really_unicode(file.old)}}</a>
to
<a href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file.new))}}">{{h.really_unicode(file.new)}}</a>
+ {% if file.ratio != 1 %}
+ <a class="commit-diff-link" href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file['new']))}}?diff={{prev[0]._id if prev else ''}}&prev_file={{h.urlquote(h.really_unicode(file['old']))}}">Diff</a>
+ <a class="commit-diff-link switch-diff-format-link" data-diformat="{{session.diformat}}" data-diffid="diff-{{loop.index}}" href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file['new']))}}?barediff={{prev[0]._id if prev else ''}}&prev_file={{h.urlquote(h.really_unicode(file['old']))}}">Switch to {{'unified' if session.diformat == 'sidebyside' else 'side-by-side'}} view</a>
+ {% endif %}
{% endif %}
</h6>
<div id="diff-{{loop.index}}" class="inline-diff-body">
@@ -157,7 +161,13 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
{% if file.ratio == 1 %}
<span class="empty-diff">File was {{ type }}.</span>
{% else %}
- {{g.highlight(file.diff, lexer='diff')}}
+ <img src="{{g.forge_static('images/spinner.gif')}}" class="loading_icon" alt="Loading..."/>
+ <script type="text/javascript">
+ diff_queue.push({
+ selector: '#diff-{{loop.index}}',
+ url: '{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file['new']))}}?barediff={{prev[0]._id if prev else ''}}&prev_file={{h.urlquote(h.really_unicode(file['old']))}}'
+ });
+ </script>
{% endif %}
{% elif obj_type == 'tree' %}
<span class="empty-diff">Directory.</span>
http://git-wip-us.apache.org/repos/asf/allura/blob/b950a1fd/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 9462087..8849a40 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -681,7 +681,6 @@ class GitImplementation(M.RepositoryImplementation):
'new': h.really_unicode(cmd_output[x + 2]),
'old': h.really_unicode(cmd_output[x + 1]),
'ratio': ratio,
- 'diff': '',
}))
x += 3
else:
http://git-wip-us.apache.org/repos/asf/allura/blob/b950a1fd/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index b9d986e..8db0943 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -803,7 +803,6 @@ class SVNImplementation(M.RepositoryImplementation):
'new': h.really_unicode(p.path),
'old': h.really_unicode(p.copyfrom_path),
'ratio': 1,
- 'diff': '',
})
elif p['action'] == 'A':
result['added'].append(h.really_unicode(p.path))
http://git-wip-us.apache.org/repos/asf/allura/blob/b950a1fd/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 1c997b7..f5ce1df 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -407,7 +407,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
def test_diff_copy(self):
entry = self.repo.commit(self.repo.log(5, id_only=True).next())
assert_equals(dict(entry.diffs), dict(
- copied=[{'new': u'/b', 'old': u'/a', 'diff': '', 'ratio': 1}], renamed=[],
+ copied=[{'new': u'/b', 'old': u'/a', 'ratio': 1}], renamed=[],
changed=[], removed=[], added=[], total=1))
def test_commit(self):
@@ -612,7 +612,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
'removed': [],
'modified': [],
'copied': [
- {'new': u'/b', 'old': u'/a', 'diff': '', 'ratio': 1},
+ {'new': u'/b', 'old': u'/a', 'ratio': 1},
],
'renamed': [],
}],
[07/50] allura git commit: [#7930] ticket:829 Don't update project's
last_updated on thread view
Posted by je...@apache.org.
[#7930] ticket:829 Don't update project's last_updated on thread view
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/26d0e066
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/26d0e066
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/26d0e066
Branch: refs/heads/ib/7922
Commit: 26d0e066e2e886ad5d4c4df7d9fb2f4e139208ce
Parents: 0015f47
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Aug 3 17:24:53 2015 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 5 19:00:35 2015 +0000
----------------------------------------------------------------------
Allura/allura/controllers/discuss.py | 2 ++
.../forgediscussion/tests/functional/test_forum.py | 13 +++++++++++++
2 files changed, 15 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/26d0e066/Allura/allura/controllers/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
index b329b01..df8076d 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -110,6 +110,7 @@ class DiscussionController(BaseController, FeedController):
else:
thread['subscription'] = False
M.session.artifact_orm_session._get().skip_mod_date = True
+ M.session.artifact_orm_session._get().skip_last_updated = True
redirect(request.referer)
def get_feed(self, project, app, user):
@@ -193,6 +194,7 @@ class ThreadController(BaseController, FeedController):
self.thread.num_views += 1
# the update to num_views shouldn't affect it
M.session.artifact_orm_session._get().skip_mod_date = True
+ M.session.artifact_orm_session._get().skip_last_updated = True
count = self.thread.query_posts(page=page, limit=int(limit)).count()
return dict(discussion=self.thread.discussion,
thread=self.thread,
http://git-wip-us.apache.org/repos/asf/allura/blob/26d0e066/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py b/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
index ae91bf0..23ec71f 100644
--- a/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
+++ b/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
@@ -831,6 +831,19 @@ class TestForum(TestController):
r = self.app.get(u'/p/test/discussion/create_topic/téstforum/'.encode('utf-8'))
assert u'<option value="téstforum" selected>Tést Forum</option>' in r
+ def test_viewing_a_thread_does_not_update_project_last_updated(self):
+ # Create new topic/thread
+ r = self.app.get('/discussion/create_topic/')
+ url = self.fill_new_topic_form(r).submit().follow().request.url
+
+ # Remember project's last_updated
+ timestamp_before = M.Project.query.get(shortname='test').last_updated
+
+ # View the thread and make sure project last_updated is not updated
+ thread = self.app.get(url)
+ timestamp_after = M.Project.query.get(shortname='test').last_updated
+ assert_equal(timestamp_before, timestamp_after)
+
class TestForumStats(TestController):
def test_stats(self):
[47/50] allura git commit: [#7922] ticket:834 Don't show admin
options twice on sidebar when left bar is hidden
Posted by je...@apache.org.
[#7922] ticket:834 Don't show admin options twice on sidebar when left bar is hidden
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/858c38f6
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/858c38f6
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/858c38f6
Branch: refs/heads/ib/7922
Commit: 858c38f6d66e2d51dbdb855df2799516b46b725c
Parents: e4b92c7
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Aug 13 19:12:47 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 19:12:47 2015 +0300
----------------------------------------------------------------------
.../templates/jinja_master/sidebar_menu.html | 17 +++++++++++------
ForgeWiki/forgewiki/wiki_main.py | 4 ++--
2 files changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/858c38f6/Allura/allura/templates/jinja_master/sidebar_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/sidebar_menu.html b/Allura/allura/templates/jinja_master/sidebar_menu.html
index 4505804..64102fc 100644
--- a/Allura/allura/templates/jinja_master/sidebar_menu.html
+++ b/Allura/allura/templates/jinja_master/sidebar_menu.html
@@ -55,21 +55,26 @@
{% endif %}
{% if c.app %}
{% if h.has_access(c.app, 'admin')() %}
- {% if c.app.admin_menu() %}
+ {% if c.app.tool_label.lower() == 'wiki' %}
+ {% set admin_menu = c.app.admin_menu(skip_common_menu=True) %}
+ {% else %}
+ {% set admin_menu = c.app.admin_menu() %}
+ {% endif %}
+ {% if admin_menu %}
<a id='sidebar-admin-header' onclick='$("#sidebar-admin-menu").toggleClass("hidden");'>
{{sidebar_item(c.app.admin_menu_collapse_button)}}
</a>
<div id='sidebar-admin-menu' class='hidden'>
- {% for s in c.app.admin_menu() %}
+ {% for s in admin_menu %}
{{sidebar_item(s)}}
{% endfor %}
{{sidebar_item(c.app.admin_menu_delete_button)}}
{{sidebar_item(None)}}
</div>
- {% endif %}
- {{c.app.admin_modal.display()}}
- {% if c.app.admin_menu_delete_button %}
- {{c.app.admin_tool_delete_modal.display()}}
+ {{c.app.admin_modal.display()}}
+ {% if c.app.admin_menu_delete_button %}
+ {{c.app.admin_tool_delete_modal.display()}}
+ {% endif %}
{% endif %}
{% endif %}
{% for s in c.app.sidebar_menu() %}
http://git-wip-us.apache.org/repos/asf/allura/blob/858c38f6/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index 513b1e2..ce99198 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -257,7 +257,7 @@ The wiki uses [Markdown](%s) syntax.
SitemapEntry('Formatting Help', self.url + 'markdown_syntax/')]
return links
- def admin_menu(self):
+ def admin_menu(self, skip_common_menu=False):
admin_url = c.project.url() + \
'admin/' + \
self.config.options.mount_point + '/'
@@ -265,7 +265,7 @@ The wiki uses [Markdown](%s) syntax.
admin_url + 'home',
className='admin_modal')]
- if not self.show_left_bar:
+ if not self.show_left_bar and not skip_common_menu:
links += self.create_common_wiki_menu(True,
admin_url +
'create_wiki_page',
[20/50] allura git commit: [#7925] Speed up diff processing on commit
browser page
Posted by je...@apache.org.
[#7925] Speed up diff processing on commit browser page
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e252f5e1
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e252f5e1
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e252f5e1
Branch: refs/heads/ib/7922
Commit: e252f5e1bf907e8fa886bb8fdffb0f05bc291df0
Parents: 032c2ed
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Thu Jul 16 15:02:55 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:35 2015 -0400
----------------------------------------------------------------------
Allura/allura/controllers/repository.py | 3 ++-
Allura/allura/model/repository.py | 6 ++++++
Allura/allura/templates/repo/commit.html | 14 ++++++++------
3 files changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/e252f5e1/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 2b9ae89..5d03f64 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -564,7 +564,8 @@ class CommitBrowser(BaseController):
default=self.DEFAULT_PAGE_LIMIT)
diffs = self._commit.paged_diffs(start=start, end=start + limit)
result['artifacts'] = [
- (t, f, 'blob' if tree.get_blob_by_path(f) else 'tree')
+ (t, f, 'blob' if tree.get_blob_by_path(f) else 'tree',
+ tree.get_blob_by_path(f) and tree.get_blob_by_path(f).is_text)
for t in ('added', 'removed', 'changed', 'copied')
for f in diffs[t]]
count = diffs['total']
http://git-wip-us.apache.org/repos/asf/allura/blob/e252f5e1/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index b3c60b7..7bc36c1 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -1520,6 +1520,12 @@ class Blob(object):
return self._content_type_encoding[0]
@LazyProperty
+ def is_text(self):
+ """Return true if this blob is text."""
+
+ return self.content_type.startswith("text")
+
+ @LazyProperty
def content_encoding(self):
return self._content_type_encoding[1]
http://git-wip-us.apache.org/repos/asf/allura/blob/e252f5e1/Allura/allura/templates/repo/commit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/commit.html b/Allura/allura/templates/repo/commit.html
index 4870332..f029f52 100644
--- a/Allura/allura/templates/repo/commit.html
+++ b/Allura/allura/templates/repo/commit.html
@@ -113,7 +113,7 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
{{c.page_list.display(page=page, limit=limit, count=count)}}
<table>
<tbody>
- {% for type, file, _ in artifacts %}
+ {% for type, file, _, _ in artifacts %}
<tr>
<td>{{ type }}</td>
<td><a href="#diff-{{loop.index}}">
@@ -128,9 +128,10 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
</tbody>
</table>
-{% for type, file, obj_type in artifacts %}
- <div class="inline-diff">
- <h6>
+ {% for type, file, obj_type, is_text in artifacts %}
+ {% if is_text %}
+ <div class="inline-diff">
+ <h6>
{% if type in ('added', 'changed') %}
{% if obj_type == 'tree' %}
<a href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file))}}">{{h.really_unicode(file)}}</a>
@@ -169,6 +170,7 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
{% endif %}
</div>
</div>
-{% endfor %}
-{{c.page_list.display(page=page, limit=limit, count=count)}}
+ {% endif %}
+ {% endfor %}
+ {{ c.page_list.display(page=page, limit=limit, count=count) }}
{% endblock %}
[08/50] allura git commit: [#7915] ticket:831 Move installation
instructions into the docs
Posted by je...@apache.org.
[#7915] ticket:831 Move installation instructions into the docs
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/a8ace0d5
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/a8ace0d5
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/a8ace0d5
Branch: refs/heads/ib/7922
Commit: a8ace0d5e30c52d4a90fdcdb1f235b4f7861b1af
Parents: 26d0e06
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Aug 3 21:08:06 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Wed Aug 5 17:53:22 2015 -0400
----------------------------------------------------------------------
Allura/docs/development/contributing.rst | 4 +-
Allura/docs/getting_started/installation.rst | 340 +++++++++++++++++++++-
INSTALL-docker.markdown | 117 --------
INSTALL.markdown | 154 +---------
NOTICE | 2 +-
README.markdown | 2 +-
6 files changed, 342 insertions(+), 277 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/a8ace0d5/Allura/docs/development/contributing.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/development/contributing.rst b/Allura/docs/development/contributing.rst
index 3e6c8d9..2dff6ad 100644
--- a/Allura/docs/development/contributing.rst
+++ b/Allura/docs/development/contributing.rst
@@ -39,8 +39,8 @@ so you can see and test the changes you make. You can install Allura from
scratch, or by using our pre-built Vagrant image. Instructions for these
approaches can be found here:
-* `Install from scratch <https://forge-allura.apache.org/p/allura/git/ci/master/tree/INSTALL.markdown>`_
-* `Install from Vagrant image <https://forge-allura.apache.org/p/allura/wiki/Install%20and%20Run%20Allura%20-%20Vagrant/>`_
+* :ref:`Install from scratch <step-by-step-install>`
+* :ref:`Install using Docker <docker-install>`
Managing Services
-----------------
http://git-wip-us.apache.org/repos/asf/allura/blob/a8ace0d5/Allura/docs/getting_started/installation.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/installation.rst b/Allura/docs/getting_started/installation.rst
index 30425b4..90fbeee 100644
--- a/Allura/docs/getting_started/installation.rst
+++ b/Allura/docs/getting_started/installation.rst
@@ -19,12 +19,346 @@
Installation
************
+.. contents::
+ :local:
-Our step-by-step setup instructions are in our INSTALL.markdown file. You can read it online at https://forge-allura.apache.org/p/allura/git/ci/master/tree/INSTALL.markdown You should be able to get Allura up and running in well under an hour by following those instructions.
+.. _step-by-step-install:
-For a faster and easier setup, see our `Vagrant/VirtualBox installation guide <https://forge-allura.apache.org/p/allura/wiki/Install%20and%20Run%20Allura%20-%20Vagrant/>`_
+Step-by-Step Installation
+-------------------------
+
+For a simpler setup using Docker images, see :ref:`docker-install` instead.
+
+In these instructions, we'll use `VirtualBox <http://www.virtualbox.org>`_ and `Ubuntu 14.04 <http://ubuntu.com>`_ (12.04 works too) to create a disposable sandbox for Allura development/testing. Allura should work on other Linux systems (including OSX), but setting up all the dependencies will be different.
+
+* Download and install `VirtualBox <http://www.virtualbox.org/wiki/Downloads>`_ for your platform.
+
+* Download a minimal `Ubuntu 14.04 64-bit ISO <https://help.ubuntu.com/community/Installation/MinimalCD>`_.
+
+* Create a new virtual machine in Virtual Box, selecting Ubuntu (64 bit) as the OS type. The rest of the wizards' defaults are fine.
+
+* When you launch the virtual machine for the first time, you will be prompted to attach your installation media. Browse to the :file:`mini.iso` that you downloaded earlier.
+
+* After a text-only installation, you may end up with a blank screen and blinking cursor. Press :code:`Alt-F1` to switch to the first console.
+
+* Consult `available documentation <https://help.ubuntu.com/>`_ for help installing Ubuntu.
+
+
+Installation
+^^^^^^^^^^^^
+
+Before we begin, you'll need to install some system packages.
+
+.. code-block:: bash
+
+ ~$ sudo aptitude install git-core default-jre-headless python-dev libssl-dev libldap2-dev libsasl2-dev libjpeg8-dev zlib1g-dev
+
+To install MongoDB, follow the instructions `here <http://docs.mongodb.org/v2.6/tutorial/install-mongodb-on-ubuntu/>`_.
+
+Optional, for SVN support:
+
+.. code-block:: bash
+
+ ~$ sudo aptitude install subversion python-svn
+
+Setting up a virtual python environment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The first step to installing the Allura platform is installing a virtual environment via `virtualenv <https://virtualenv.pypa.io/en/latest/>`_. This helps keep our distribution python installation clean.
+
+.. code-block:: bash
+
+ ~$ sudo aptitude install python-pip
+ ~$ sudo pip install virtualenv
+
+Once you have virtualenv installed, you need to create a virtual environment. We'll call our Allura environment 'env-allura'.
+
+.. code-block:: bash
+
+ ~$ virtualenv env-allura
+
+This gives us a nice, clean environment into which we can install all the allura dependencies.
+In order to use the virtual environment, you'll need to activate it:
+
+.. code-block:: bash
+
+ ~$ . env-allura/bin/activate
+
+You'll need to do this whenever you're working on the Allura codebase so you may want to consider adding it to your :file:`~/.bashrc` file.
+
+Creating the log directory
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: bash
+
+ (env-allura)~$ sudo mkdir -p /var/log/allura
+ (env-allura)~$ sudo chown $(whoami) /var/log/allura
+
+Installing the Allura code and dependencies
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Now we can get down to actually getting the Allura code and dependencies downloaded and ready to go. If you don't have the source code yet, run:
+
+.. code-block:: bash
+
+ (env-allura)~$ mkdir src
+ (env-allura)~$ cd src
+ (env-allura)~/src$ git clone https://git-wip-us.apache.org/repos/asf/allura.git allura
+
+If you already reading this file from an Allura release or checkout, you're ready to continue.
+
+Although the application :file:`setup.py` files define a number of dependencies, the :file:`requirements.txt` files are currently the authoritative source, so we'll use those with `pip <https://pip.pypa.io/en/stable/>`_ to make sure the correct versions are installed.
+
+.. code-block:: bash
+
+ (env-allura)~/src$ cd allura
+ (env-allura)~/src/allura$ pip install -r requirements.txt
+
+This will take a while. If you get an error from pip, it is typically a temporary download error. Just run the command again and it will quickly pass through the packages it already downloaded and then continue.
+
+Optional, for SVN support: symlink the system pysvn package into our virtual environment
+
+.. code-block:: bash
+
+ (env-allura)~/src/allura$ ln -s /usr/lib/python2.7/dist-packages/pysvn ~/env-allura/lib/python2.7/site-packages/
+
+Next, run :code:`./rebuild-all.bash` to setup all the Allura applications. If you only want to use a few tools, run:
+
+.. code-block:: bash
+
+ (env-allura)~/src/allura$ cd Allura
+ (env-allura)~/src/allura/Allura$ python setup.py develop
+ (env-allura)~/src/allura/Allura$ cd ../ForgeWiki # required tool
+ (env-allura)~/src/allura/ForgeWiki$ python setup.py develop
+ # repeat for any other tools you want to use
+
+Initializing the environment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The Allura forge consists of several components, all of which need to be running to have full functionality.
+
+SOLR search and indexing server
+*******************************
+
+We have a custom config ready for use.
+
+.. code-block:: bash
+
+ (env-allura)~$ cd ~/src
+ (env-allura)~/src$ wget -nv http://archive.apache.org/dist/lucene/solr/4.2.1/solr-4.2.1.tgz
+ (env-allura)~/src$ tar xf solr-4.2.1.tgz && rm -f solr-4.2.1.tgz
+ (env-allura)~/src$ cp -f allura/solr_config/schema.xml solr-4.2.1/example/solr/collection1/conf
+
+ (env-allura)~/src$ cd solr-4.2.1/example/
+ (env-allura)~/src/apache-solr-4.2.1/example/$ nohup java -jar start.jar > /var/log/allura/solr.log &
+
+
+Create code repo directories
+****************************
+
+The default configuration stores repos in :file:`/srv`, so we need to create those directories:
+
+.. code-block:: bash
+
+ ~$ sudo mkdir /srv/{git,svn,hg}
+ ~$ sudo chown $USER /srv/{git,svn,hg}
+ ~$ sudo chmod 775 /srv/{git,svn,hg}
+
+If you don't have :code:`sudo` permission or just want to store them somewhere else, change the :file:`/srv` paths in :file:`development.ini`
+
+If you want to set up remote access to the repositories, see :ref:`scm_hosting`
+
+Allura task processing
+**********************
+
+Allura uses a background task service called "taskd" to do async tasks like sending emails, and indexing data into solr, etc. Let's get it running
+
+.. code-block:: bash
+
+ (env-allura)~$ cd ~/src/allura/Allura
+ (env-allura)~/src/allura/Allura$ nohup paster taskd development.ini > /var/log/allura/taskd.log 2>&1 &
+
+The application server
+**********************
+
+In order to initialize the Allura database, you'll need to run the following:
+
+For development setup:
+
+.. code-block:: bash
+
+ (env-allura)~/src/allura/Allura$ paster setup-app development.ini
+
+For production setup:
+
+.. code-block:: bash
+
+ (env-allura)~/src/allura/Allura$ ALLURA_TEST_DATA=False paster setup-app development.ini
+
+This shouldn't take too long, but it will start the taskd server doing tons of stuff in the background. Once this is done, you can start the application server:
+
+.. code-block:: bash
+
+ (env-allura)~/src/allura/Allura$ nohup paster serve --reload development.ini > /var/log/allura/allura.log 2>&1 &
+
+Next Steps
+~~~~~~~~~~
+
+Go to the Allura webapp running on your `local machine <http://localhost:8080/>`_ port 8080.
+(If you're running this inside a VM, you'll probably have to configure the port forwarding settings)
+
+You can log in with username `admin1`, `test-user` or `root`. They all have password "foo". (For more details
+on the default data, see :file:`bootstrap.py`)
+
+There are a few default projects (like "test") and neighborhoods. Feel free to experiment with them. If you want to
+register a new project in your own forge, visit `/p/add_project`.
+
+Extra
+~~~~~
+
+* Read :ref:`post-setup-instructions`
+* Ask questions and discuss Allura on the `allura-dev mailing list <http://mail-archives.apache.org/mod_mbox/allura-dev/>`_
+* Run the test suite (slow): :code:`$ ALLURA_VALIDATION=none ./run_tests`
+* File bug reports at https://forge-allura.apache.org/p/allura/tickets/new/ (login required)
+* Contribute code according to `this guide <https://forge-allura.apache.org/p/allura/wiki/Contributing%20Code/>`_
+
+.. _docker-install:
+
+Using Docker
+------------
+
+General info
+^^^^^^^^^^^^
+
+Allura runs on the following docker containers:
+
+- web
+- mongo
+- taskd
+- solr
+- inmail
+- outmail
+
+Host-mounted volumes
+~~~~~~~~~~~~~~~~~~~~
+
+These are created on first run.
+
+Current directory mounted as :file:`/allura` inside containers.
+
+Python environment:
+
+- :file:`env-docker/python`
+- :file:`env-docker/bin`
+
+Services data:
+
+- :file:`/allura-data/mongo` - mongo data
+- :file:`/allura-data/solr` - SOLR index
+- :code:`/allura-data/scm/{git,hg,svn}` - code repositories
+- :file:`/allura-data/scm/snapshots` - generated code snapshots
+
+Ports, exposed to host system
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- 8080 - webapp
+- 8983 - SOLR admin panel (http://localhost:8983/solr/)
+- 8825 - incoming mail listener
+
+
+First run
+^^^^^^^^^
+
+`Download the latest release <http://www.apache.org/dyn/closer.cgi/allura/>`_ of Allura, or `clone from git <https://forge-allura.apache.org/p/allura/git/ci/master/tree/>`_ for the bleeding edge.
+
+Install `Docker <http://docs.docker.com/installation/>`_ and `Docker Compose <https://docs.docker.com/compose/install/>`_.
+
+Build/fetch all required images (run these in allura source directory):
+
+.. code-block:: bash
+
+ ~$ docker-compose build
+
+Install requirements:
+
+.. code-block:: bash
+
+ ~$ docker-compose run web pip install -r requirements.txt
+
+Install Allura packages:
+
+.. code-block:: bash
+
+ ~$ docker-compose run web ./rebuild-all.bash
+
+Initialize database with test data:
+
+.. code-block:: bash
+
+ ~$ docker-compose run web bash -c 'cd Allura && paster setup-app docker-dev.ini'
+
+If you want to skip test data creation you can instead run:
+
+.. code-block:: bash
+
+ ~$ docker-compose run web bash -c 'cd Allura && ALLURA_TEST_DATA=False paster setup-app docker-dev.ini'
+
+Start containers in the background:
+
+.. code-block:: bash
+
+ ~$ docker-compose up -d
+
+Useful commands
+^^^^^^^^^^^^^^^
+
+Restarting all containers:
+
+.. code-block:: bash
+
+ ~$ docker-compose up -d
+
+View logs from all services:
+
+.. code-block:: bash
+
+ ~$ docker-compose logs
+
+You can specify one or more services to view logs only from them, e.g. to see
+outgoing mail:
+
+.. code-block:: bash
+
+ ~$ docker-compose logs outmail
+
+Update requirements and reinstall apps:
+
+.. code-block:: bash
+
+ ~$ docker-compose run web pip install -r requirements.txt
+ ~$ docker-compose run web ./rebuild-all.bash
+
+You may want to restart at least "taskd" container after that in order for it to
+pick up changes.
+
+Running all tests:
+
+.. code-block:: bash
+
+ ~$ docker-compose run web ./run_tests
+
+Running subset of tests:
+
+.. code-block:: bash
+
+ ~$ docker-compose run web bash -c 'cd ForgeGit && nosetests forgegit.tests.functional.test_controllers:TestFork'
+
+Connecting to mongo directly:
+
+.. code-block:: bash
+
+ ~$ docker-compose run mongo mongo --host mongo
-That's all for the development setup. For the production setup see :ref:`next section <post-setup-instructions>`.
.. _post-setup-instructions:
http://git-wip-us.apache.org/repos/asf/allura/blob/a8ace0d5/INSTALL-docker.markdown
----------------------------------------------------------------------
diff --git a/INSTALL-docker.markdown b/INSTALL-docker.markdown
deleted file mode 100644
index c4fb810..0000000
--- a/INSTALL-docker.markdown
+++ /dev/null
@@ -1,117 +0,0 @@
-<!--
- 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
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-
-# General info
-
-## Allura runs on following docker containers:
-
-- web
-- mongo
-- taskd
-- solr
-- inmail
-- outmail
-
-## Host-mounted volumes (created on first run)
-
-Current directory mounted as `/allura` inside containers.
-
-Python environment:
-
-- `env-docker/python`
-- `env-docker/bin`
-
-Services data:
-
-- `/allura-data/mongo` - mongo data
-- `/allura-data/solr` - SOLR index
-- `/allura-data/scm/{git,hg,svn}` - code repositories
-- `/allura-data/scm/snapshots` - generated code snapshots
-
-## Ports, exposed to host system:
-
-- 8080 - webapp
-- 8983 - SOLR admin panel (http://localhost:8983/solr/)
-- 8825 - incoming mail listener
-
-
-# First run
-
-[Download the latest release](http://www.apache.org/dyn/closer.cgi/allura/) of Allura, or [clone from git](https://forge-allura.apache.org/p/allura/git/ci/master/tree/) for the bleeding edge.
-
-Install [Docker](http://docs.docker.com/installation/) and [Docker Compose](https://docs.docker.com/compose/install/).
-
-Build/fetch all required images (run these in your allura directory):
-
- ~$ docker-compose build
-
-Install requirements:
-
- ~$ docker-compose run web pip install -r requirements.txt
-
-Install Allura packages:
-
- ~$ docker-compose run web ./rebuild-all.bash
-
-Initialize database with test data:
-
- ~$ docker-compose run web bash -c 'cd Allura && paster setup-app docker-dev.ini'
-
-If you want to skip test data creation you can instead run:
-
- ~$ docker-compose run web bash -c 'cd Allura && ALLURA_TEST_DATA=False paster setup-app docker-dev.ini'
-
-Start containers in background:
-
- ~$ docker-compose up -d
-
-# Useful commands
-
-Restarting all containers:
-
- ~$ docker-compose up -d
-
-View logs from all services:
-
- ~$ docker-compose logs
-
-You can specify one or more services to view logs only from them, e.g. to see
-outgoing mail:
-
- ~$ docker-compose logs outmail
-
-Update requirements and reinstall apps:
-
- ~$ docker-compose run web pip install -r requirements.txt
- ~$ docker-compose run web ./rebuild-all.bash
-
-You may want to restart at least taskd container after that in order for it to
-pick up changes.
-
-Running all tests:
-
- ~$ docker-compose run web ./run_tests
-
-Running subset of tests:
-
- ~$ docker-compose run web bash -c 'cd ForgeGit && nosetests forgegit.tests.functional.test_controllers:TestFork'
-
-Connecting to mongo directly:
-
- ~$ docker-compose run mongo mongo --host mongo
http://git-wip-us.apache.org/repos/asf/allura/blob/a8ace0d5/INSTALL.markdown
----------------------------------------------------------------------
diff --git a/INSTALL.markdown b/INSTALL.markdown
index eab7dfd..57c0b89 100644
--- a/INSTALL.markdown
+++ b/INSTALL.markdown
@@ -17,156 +17,4 @@
under the License.
-->
-# Step-by-Step Installation
-
-For a simpler setup using Docker images, see INSTALL-docker.markdown instead.
-
-In these instructions, we'll use [VirtualBox](http://www.virtualbox.org) and [Ubuntu 14.04](http://ubuntu.com) (12.04 works too) to create a disposable sandbox for Allura development/testing. Allura should work on other Linux systems (including OSX), but setting up all the dependencies will be different.
-
-* Download and install [VirtualBox](http://www.virtualbox.org/wiki/Downloads) for your platform.
-
-* Download a minimal [Ubuntu 14.04 64-bit ISO](https://help.ubuntu.com/community/Installation/MinimalCD).
-
-* Create a new virtual machine in Virtual Box, selecting Ubuntu (64 bit) as the OS type. The rest of the wizards' defaults are fine.
-
-* When you launch the virtual machine for the first time, you will be prompted to attach your installation media. Browse to the `mini.iso` that you downloaded earlier.
-
-* After a text-only installation, you may end up with a blank screen and blinking cursor. Press Alt-F1 to switch to the first console.
-
-* Consult [available documentation](https://help.ubuntu.com/) for help installing Ubuntu.
-
-
-# Installation
-
-Before we begin, you'll need to install some system packages.
-
- ~$ sudo aptitude install git-core default-jre-headless python-dev libssl-dev libldap2-dev libsasl2-dev libjpeg8-dev zlib1g-dev
-
-To install MongoDB, follow the instructions here: <http://docs.mongodb.org/v2.6/tutorial/install-mongodb-on-ubuntu/>
-
-Optional, for SVN support:
-
- ~$ sudo aptitude install subversion python-svn
-
-## Setting up a virtual python environment
-
-The first step to installing the Allura platform is installing a virtual environment via `virtualenv`. This helps keep our distribution python installation clean.
-
- ~$ sudo aptitude install python-pip
- ~$ sudo pip install virtualenv
-
-Once you have virtualenv installed, you need to create a virtual environment. We'll call our Allura environment 'env-allura'.
-
- ~$ virtualenv env-allura
-
-This gives us a nice, clean environment into which we can install all the allura dependencies.
-In order to use the virtual environment, you'll need to activate it:
-
- ~$ . env-allura/bin/activate
-
-You'll need to do this whenever you're working on the Allura codebase so you may want to consider adding it to your `~/.bashrc` file.
-
-## Creating the log directory
- (env-allura)~$ sudo mkdir -p /var/log/allura
- (env-allura)~$ sudo chown $(whoami) /var/log/allura
-
-## Installing the Allura code and dependencies
-
-Now we can get down to actually getting the Allura code and dependencies downloaded and ready to go. If you don't have the source code yet, run:
-
- (env-allura)~$ mkdir src
- (env-allura)~$ cd src
- (env-allura)~/src$ git clone https://git-wip-us.apache.org/repos/asf/allura.git allura
-
-If you already reading this file from an Allura release or checkout, you're ready to continue.
-
-Although the application setup.py files define a number of dependencies, the `requirements.txt` files are currently the authoritative source, so we'll use those with `pip` to make sure the correct versions are installed.
-
- (env-allura)~/src$ cd allura
- (env-allura)~/src/allura$ pip install -r requirements.txt
-
-This will take a while. If you get an error from pip, it is typically a temporary download error. Just run the command again and it will quickly pass through the packages it already downloaded and then continue.
-
-Optional, for SVN support: symlink the system pysvn package into our virtual environment
-
- (env-allura)~/src/allura$ ln -s /usr/lib/python2.7/dist-packages/pysvn ~/env-allura/lib/python2.7/site-packages/
-
-Next, run `./rebuild-all.bash` to setup all the Allura applications. If you only want to use a few tools, run:
-
- cd Allura
- python setup.py develop
- cd ../ForgeWiki # required tool
- python setup.py develop
- # repeat for any other tools you want to use
-
-## Initializing the environment
-
-The Allura forge consists of several components, all of which need to be running to have full functionality.
-
-### SOLR search and indexing server
-
-We have a custom config ready for use.
-
- (env-allura)~$ cd ~/src
- (env-allura)~/src$ wget -nv http://archive.apache.org/dist/lucene/solr/4.2.1/solr-4.2.1.tgz
- (env-allura)~/src$ tar xf solr-4.2.1.tgz && rm -f solr-4.2.1.tgz
- (env-allura)~/src$ cp -f allura/solr_config/schema.xml solr-4.2.1/example/solr/collection1/conf
-
- (env-allura)~/src$ cd solr-4.2.1/example/
- (env-allura)~/src/apache-solr-4.2.1/example/$ nohup java -jar start.jar > /var/log/allura/solr.log &
-
-
-### Create code repo directories
-
-The default configuration stores repos in `/srv`, so we need to create those directories:
-
- sudo mkdir /srv/{git,svn,hg}
- sudo chown $USER /srv/{git,svn,hg}
- sudo chmod 775 /srv/{git,svn,hg}
-
-If you don't have `sudo` permission or just want to store them somewhere else, change the `/srv` paths in `development.ini`
-
-If you want to set up remote access to the repositories, see <http://forge-allura.apache.org/docs/getting_started/scm_host.html>
-
-### Allura task processing
-
-Allura uses a background task service called "taskd" to do async tasks like sending emails, and indexing data into solr, etc. Let's get it running
-
- (env-allura)~$ cd ~/src/allura/Allura
- (env-allura)~/src/allura/Allura$ nohup paster taskd development.ini > /var/log/allura/taskd.log 2>&1 &
-
-### The application server
-
-In order to initialize the Allura database, you'll need to run the following:
-
-For development setup:
-
- (env-allura)~/src/allura/Allura$ paster setup-app development.ini
-
-For production setup:
-
- (env-allura)~/src/allura/Allura$ ALLURA_TEST_DATA=False paster setup-app development.ini
-
-This shouldn't take too long, but it will start the taskd server doing tons of stuff in the background. Once this is done, you can start the application server:
-
- (env-allura)~/src/allura/Allura$ nohup paster serve --reload development.ini > /var/log/allura/allura.log 2>&1 &
-
-## Next Steps
-
-Go to the Allura webapp running on your [local machine](http://localhost:8080/) port 8080.
-(If you're running this inside a VM, you'll probably have to configure the port forwarding settings)
-
-You can log in with username admin1, test-user or root. They all have password "foo". (For more details
-on the default data, see bootstrap.py)
-
-There are a few default projects (like "test") and neighborhoods. Feel free to experiment with them. If you want to
-register a new project in your own forge, visit /p/add_project
-
-## Extra
-
-* Read more documentation: <http://forge-allura.apache.org/docs/>
- * Including how to enable extra features: <http://forge-allura.apache.org/docs/getting_started/installation.html>
-* Ask questions and discuss Allura on the <http://mail-archives.apache.org/mod_mbox/allura-dev/>
-* Run the test suite (slow): `$ ALLURA_VALIDATION=none ./run_tests`
-* File bug reports at <https://forge-allura.apache.org/p/allura/tickets/new/> (login required)
-* Contribute code according to this guide: <https://forge-allura.apache.org/p/allura/wiki/Contributing%20Code/>
+See `Allura/docs`.
http://git-wip-us.apache.org/repos/asf/allura/blob/a8ace0d5/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 69af9fe..fb04ff5 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
Apache Allura
-Copyright 2012-2014 The Apache Software Foundation
+Copyright 2012-2015 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
http://git-wip-us.apache.org/repos/asf/allura/blob/a8ace0d5/README.markdown
----------------------------------------------------------------------
diff --git a/README.markdown b/README.markdown
index 5daeb0c..5eec88f 100644
--- a/README.markdown
+++ b/README.markdown
@@ -22,7 +22,7 @@ Apache Allura
Allura is an open source implementation of a software "forge", a web site that manages source code repositories, bug reports, discussions, mailing lists, wiki pages, blogs and more for any number of individual projects.
-To install Allura, see INSTALL.markdown
+To install Allura, see `Allura/docs`.
Website: <https://allura.apache.org/>
[31/50] allura git commit: [#7925] use some variables to clean up
some repetition in the commit template
Posted by je...@apache.org.
[#7925] use some variables to clean up some repetition in the commit template
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/1919ec09
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1919ec09
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1919ec09
Branch: refs/heads/ib/7922
Commit: 1919ec0959c6883d6239d060bf19d44e02b4df04
Parents: b950a1f
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Jul 31 22:42:54 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:37 2015 -0400
----------------------------------------------------------------------
Allura/allura/templates/repo/commit.html | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/1919ec09/Allura/allura/templates/repo/commit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/commit.html b/Allura/allura/templates/repo/commit.html
index 06da620..adf57b2 100644
--- a/Allura/allura/templates/repo/commit.html
+++ b/Allura/allura/templates/repo/commit.html
@@ -135,22 +135,25 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
<div class="inline-diff">
<h6>
{% if type in ('added', 'changed') %}
- {% if obj_type == 'tree' %}
- <a href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file))}}">{{h.really_unicode(file)}}</a>
- {% else %}
- <a href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file))}}">{{h.really_unicode(file)}}</a>
- <a class="commit-diff-link" href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file))}}?diff={{prev[0]._id if prev else ''}}">Diff</a>
- <a class="commit-diff-link switch-diff-format-link" data-diformat="{{session.diformat}}" data-diffid="diff-{{loop.index}}" href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file))}}?barediff={{prev[0]._id if prev else ''}}">Switch to {{'unified' if session.diformat == 'sidebyside' else 'side-by-side'}} view</a>
+ {% set file_url = commit.url() + 'tree/' + h.urlquote(h.really_unicode(file)) %}
+ <a href="{{ file_url }}">{{h.really_unicode(file)}}</a>
+ {% if obj_type != 'tree' %}
+ {% set diff_url = file_url + '?barediff=' + (prev[0]._id if prev else '') %}
+ <a class="commit-diff-link" href="{{ diff_url.replace('?barediff=', '?diff=') }}">Diff</a>
+ <a class="commit-diff-link switch-diff-format-link" data-diformat="{{session.diformat}}" data-diffid="diff-{{loop.index}}" href="{{ diff_url }}">Switch to {{'unified' if session.diformat == 'sidebyside' else 'side-by-side'}} view</a>
{% endif %}
{% elif type == 'removed' %}
- <a href="{{prev[0].url()}}tree/{{h.urlquote(h.really_unicode(file))}}">{{h.really_unicode(file)}}</a>
+ {% set file_url = prev[0].url() + 'tree/' + h.urlquote(h.really_unicode(file)) %}
+ <a href="{{ file_url }}">{{h.really_unicode(file)}}</a>
{% elif type in ('copied', 'renamed') %}
<a href="{{prev[0].url()}}tree/{{h.urlquote(h.really_unicode(file.old))}}">{{h.really_unicode(file.old)}}</a>
to
- <a href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file.new))}}">{{h.really_unicode(file.new)}}</a>
+ {% set new_file_url = commit.url() + 'tree/' + h.urlquote(h.really_unicode(file.new)) %}
+ <a href="{{ new_file_url }}">{{h.really_unicode(file.new)}}</a>
{% if file.ratio != 1 %}
- <a class="commit-diff-link" href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file['new']))}}?diff={{prev[0]._id if prev else ''}}&prev_file={{h.urlquote(h.really_unicode(file['old']))}}">Diff</a>
- <a class="commit-diff-link switch-diff-format-link" data-diformat="{{session.diformat}}" data-diffid="diff-{{loop.index}}" href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file['new']))}}?barediff={{prev[0]._id if prev else ''}}&prev_file={{h.urlquote(h.really_unicode(file['old']))}}">Switch to {{'unified' if session.diformat == 'sidebyside' else 'side-by-side'}} view</a>
+ {% set diff_url = new_file_url + '?barediff=' + (prev[0]._id if prev else '') + '&prev_file=' + h.urlquote(h.really_unicode(file['old'])) %}
+ <a class="commit-diff-link" href="{{ diff_url.replace('?barediff=', '?diff=') }}">Diff</a>
+ <a class="commit-diff-link switch-diff-format-link" data-diformat="{{session.diformat}}" data-diffid="diff-{{loop.index}}" href="{{diff_url}}">Switch to {{'unified' if session.diformat == 'sidebyside' else 'side-by-side'}} view</a>
{% endif %}
{% endif %}
</h6>
@@ -165,7 +168,7 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
<script type="text/javascript">
diff_queue.push({
selector: '#diff-{{loop.index}}',
- url: '{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file['new']))}}?barediff={{prev[0]._id if prev else ''}}&prev_file={{h.urlquote(h.really_unicode(file['old']))}}'
+ url: '{{diff_url}}'
});
</script>
{% endif %}
@@ -178,7 +181,7 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
<script type="text/javascript">
diff_queue.push({
selector: '#diff-{{loop.index}}',
- url: '{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file))}}?barediff={{prev[0]._id if prev else ''}}'
+ url: '{{diff_url}}'
});
</script>
{% endif %}
[04/50] allura git commit: [#7947] don't allow any cached markdown
from before this fix to be used
Posted by je...@apache.org.
[#7947] don't allow any cached markdown from before this fix to be used
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/ad029f87
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/ad029f87
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/ad029f87
Branch: refs/heads/ib/7922
Commit: ad029f8752e8529fd7c5fe0928592ab8ed4f8c3a
Parents: dd3ca5b
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Aug 3 18:49:21 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Aug 3 18:55:27 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/app_globals.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/ad029f87/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 2a7ee5c..5d262e8 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -103,11 +103,12 @@ class ForgeMarkdown(markdown.Markdown):
field_name, artifact.__class__.__name__)
return self.convert(source_text)
+ bugfix_rev = 2 # increment this if we need all caches to invalidated (e.g. xss in markdown rendering fixed)
md5 = None
# If a cached version exists and it is valid, return it.
if cache.md5 is not None:
md5 = hashlib.md5(source_text.encode('utf-8')).hexdigest()
- if cache.md5 == md5 and getattr(cache, 'fix7528', False):
+ if cache.md5 == md5 and getattr(cache, 'fix7528', False) == bugfix_rev:
return h.html.literal(cache.html)
# Convert the markdown and time the result.
@@ -128,7 +129,7 @@ class ForgeMarkdown(markdown.Markdown):
if md5 is None:
md5 = hashlib.md5(source_text.encode('utf-8')).hexdigest()
cache.md5, cache.html, cache.render_time = md5, html, render_time
- cache.fix7528 = True # flag to indicate good caches created after [#7528] was fixed
+ cache.fix7528 = bugfix_rev # flag to indicate good caches created after [#7528] and other critical bugs were fixed.
# Prevent cache creation from updating the mod_date timestamp.
_session = artifact_orm_session._get()
[05/50] allura git commit: [#7947] fix7528 was bool, now its int
Posted by je...@apache.org.
[#7947] fix7528 was bool, now its int
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/cc5f2ac6
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/cc5f2ac6
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/cc5f2ac6
Branch: refs/heads/ib/7922
Commit: cc5f2ac60499ea89633bff2dd2a08ddb06a9b74a
Parents: ad029f8
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Aug 3 20:25:24 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Aug 3 20:25:24 2015 +0000
----------------------------------------------------------------------
Allura/allura/model/types.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/cc5f2ac6/Allura/allura/model/types.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/types.py b/Allura/allura/model/types.py
index 6a8ff71..833e685 100644
--- a/Allura/allura/model/types.py
+++ b/Allura/allura/model/types.py
@@ -27,7 +27,7 @@ class MarkdownCache(S.Object):
super(MarkdownCache, self).__init__(
fields=dict(
md5=S.String(),
- fix7528=S.Bool,
+ fix7528=S.Anything,
html=S.String(),
render_time=S.Float()),
**kw)
[10/50] allura git commit: [#7915] remove an unnecessary heading
level;
avoid error about virtualbox links having same name (__ instead of _ makes it
an anonymous link)
Posted by je...@apache.org.
[#7915] remove an unnecessary heading level; avoid error about virtualbox links having same name (__ instead of _ makes it an anonymous link)
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/ff2fff44
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/ff2fff44
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/ff2fff44
Branch: refs/heads/ib/7922
Commit: ff2fff44e5bc8567b3440bc7ec5dbd9de0a5ee63
Parents: a8ace0d
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Aug 5 17:29:10 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Wed Aug 5 17:53:23 2015 -0400
----------------------------------------------------------------------
Allura/docs/getting_started/installation.rst | 28 +++++++++++------------
1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/ff2fff44/Allura/docs/getting_started/installation.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/installation.rst b/Allura/docs/getting_started/installation.rst
index 90fbeee..d43d52d 100644
--- a/Allura/docs/getting_started/installation.rst
+++ b/Allura/docs/getting_started/installation.rst
@@ -29,9 +29,9 @@ Step-by-Step Installation
For a simpler setup using Docker images, see :ref:`docker-install` instead.
-In these instructions, we'll use `VirtualBox <http://www.virtualbox.org>`_ and `Ubuntu 14.04 <http://ubuntu.com>`_ (12.04 works too) to create a disposable sandbox for Allura development/testing. Allura should work on other Linux systems (including OSX), but setting up all the dependencies will be different.
+In these instructions, we'll use `VirtualBox <http://www.virtualbox.org>`__ and `Ubuntu 14.04 <http://ubuntu.com>`_ (12.04 works too) to create a disposable sandbox for Allura development/testing. Allura should work on other Linux systems (including OSX), but setting up all the dependencies will be different.
-* Download and install `VirtualBox <http://www.virtualbox.org/wiki/Downloads>`_ for your platform.
+* Download and install `VirtualBox <http://www.virtualbox.org/wiki/Downloads>`__ for your platform.
* Download a minimal `Ubuntu 14.04 64-bit ISO <https://help.ubuntu.com/community/Installation/MinimalCD>`_.
@@ -44,8 +44,8 @@ In these instructions, we'll use `VirtualBox <http://www.virtualbox.org>`_ and `
* Consult `available documentation <https://help.ubuntu.com/>`_ for help installing Ubuntu.
-Installation
-^^^^^^^^^^^^
+System Packages
+^^^^^^^^^^^^^^^
Before we begin, you'll need to install some system packages.
@@ -62,7 +62,7 @@ Optional, for SVN support:
~$ sudo aptitude install subversion python-svn
Setting up a virtual python environment
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The first step to installing the Allura platform is installing a virtual environment via `virtualenv <https://virtualenv.pypa.io/en/latest/>`_. This helps keep our distribution python installation clean.
@@ -87,7 +87,7 @@ In order to use the virtual environment, you'll need to activate it:
You'll need to do this whenever you're working on the Allura codebase so you may want to consider adding it to your :file:`~/.bashrc` file.
Creating the log directory
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
@@ -95,7 +95,7 @@ Creating the log directory
(env-allura)~$ sudo chown $(whoami) /var/log/allura
Installing the Allura code and dependencies
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Now we can get down to actually getting the Allura code and dependencies downloaded and ready to go. If you don't have the source code yet, run:
@@ -133,12 +133,12 @@ Next, run :code:`./rebuild-all.bash` to setup all the Allura applications. If y
# repeat for any other tools you want to use
Initializing the environment
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The Allura forge consists of several components, all of which need to be running to have full functionality.
SOLR search and indexing server
-*******************************
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We have a custom config ready for use.
@@ -154,7 +154,7 @@ We have a custom config ready for use.
Create code repo directories
-****************************
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The default configuration stores repos in :file:`/srv`, so we need to create those directories:
@@ -169,7 +169,7 @@ If you don't have :code:`sudo` permission or just want to store them somewhere e
If you want to set up remote access to the repositories, see :ref:`scm_hosting`
Allura task processing
-**********************
+~~~~~~~~~~~~~~~~~~~~~~
Allura uses a background task service called "taskd" to do async tasks like sending emails, and indexing data into solr, etc. Let's get it running
@@ -179,7 +179,7 @@ Allura uses a background task service called "taskd" to do async tasks like send
(env-allura)~/src/allura/Allura$ nohup paster taskd development.ini > /var/log/allura/taskd.log 2>&1 &
The application server
-**********************
+~~~~~~~~~~~~~~~~~~~~~~
In order to initialize the Allura database, you'll need to run the following:
@@ -202,7 +202,7 @@ This shouldn't take too long, but it will start the taskd server doing tons of s
(env-allura)~/src/allura/Allura$ nohup paster serve --reload development.ini > /var/log/allura/allura.log 2>&1 &
Next Steps
-~~~~~~~~~~
+^^^^^^^^^^
Go to the Allura webapp running on your `local machine <http://localhost:8080/>`_ port 8080.
(If you're running this inside a VM, you'll probably have to configure the port forwarding settings)
@@ -214,7 +214,7 @@ There are a few default projects (like "test") and neighborhoods. Feel free to
register a new project in your own forge, visit `/p/add_project`.
Extra
-~~~~~
+^^^^^
* Read :ref:`post-setup-instructions`
* Ask questions and discuss Allura on the `allura-dev mailing list <http://mail-archives.apache.org/mod_mbox/allura-dev/>`_
[25/50] allura git commit: [#7925] fix template display: specify
copy/rename, say file was binary instead of skip entirely, etc
Posted by je...@apache.org.
[#7925] fix template display: specify copy/rename, say file was binary instead of skip entirely, etc
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/3a8037c1
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/3a8037c1
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/3a8037c1
Branch: refs/heads/ib/7922
Commit: 3a8037c16afa1fb00f58f6e4aa307c505e5e1c61
Parents: 5adbb28
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Jul 31 19:14:26 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:36 2015 -0400
----------------------------------------------------------------------
Allura/allura/controllers/repository.py | 16 +++++++++++-----
Allura/allura/templates/repo/commit.html | 16 +++++++---------
2 files changed, 18 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/3a8037c1/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 0524589..c17f06a 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -563,11 +563,17 @@ class CommitBrowser(BaseController):
limit, page, start = g.handle_paging(limit, page,
default=self.DEFAULT_PAGE_LIMIT)
diffs = self._commit.paged_diffs(start=start, end=start + limit)
- result['artifacts'] = [
- (t, f, 'blob' if tree.get_blob_by_path(f) else 'tree',
- tree.get_blob_by_path(f) and tree.get_blob_by_path(f).has_html_view)
- for t in ('added', 'removed', 'changed', 'copied', 'renamed')
- for f in diffs[t]]
+ result['artifacts'] = []
+ for t in ('added', 'removed', 'changed', 'copied', 'renamed'):
+ for f in diffs[t]:
+ if t in ('copied', 'renamed'):
+ filepath = f['new']
+ else:
+ filepath = f
+ is_text = filepath and tree.get_blob_by_path(filepath) and tree.get_blob_by_path(filepath).has_html_view
+ result['artifacts'].append(
+ (t, f, 'blob' if tree.get_blob_by_path(f) else 'tree', is_text)
+ )
count = diffs['total']
result.update(dict(page=page, limit=limit, count=count))
return result
http://git-wip-us.apache.org/repos/asf/allura/blob/3a8037c1/Allura/allura/templates/repo/commit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/commit.html b/Allura/allura/templates/repo/commit.html
index f7206d4..b0adabc 100644
--- a/Allura/allura/templates/repo/commit.html
+++ b/Allura/allura/templates/repo/commit.html
@@ -132,9 +132,8 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
</table>
{% for type, file, obj_type, is_text in artifacts %}
- {% if is_text %}
- <div class="inline-diff">
- <h6>
+ <div class="inline-diff">
+ <h6>
{% if type in ('added', 'changed') %}
{% if obj_type == 'tree' %}
<a href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file))}}">{{h.really_unicode(file)}}</a>
@@ -145,9 +144,7 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
{% endif %}
{% elif type == 'removed' %}
<a href="{{prev[0].url()}}tree/{{h.urlquote(h.really_unicode(file))}}">{{h.really_unicode(file)}}</a>
- {% elif type == 'renamed' %}
- <a href="{{prev[0].url()}}tree/{{h.urlquote(h.really_unicode(file))}}">{{h.really_unicode(file)}}</a>
- {% elif type == 'copied' %}
+ {% elif type in ('copied', 'renamed') %}
<a href="{{prev[0].url()}}tree/{{h.urlquote(h.really_unicode(file.old))}}">{{h.really_unicode(file.old)}}</a>
to
<a href="{{commit.url()}}tree/{{h.urlquote(h.really_unicode(file.new))}}">{{h.really_unicode(file.new)}}</a>
@@ -156,14 +153,16 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
<div id="diff-{{loop.index}}" class="inline-diff-body">
{% if type == 'removed' %}
<span class="empty-diff">File was removed.</span>
- {% elif type == 'copied' %}
+ {% elif type in ('copied', 'renamed') %}
{% if file.ratio == 1 %}
- <span class="empty-diff">File was copied or renamed.</span>
+ <span class="empty-diff">File was {{ type }}.</span>
{% else %}
{{g.highlight(file.diff, lexer='diff')}}
{% endif %}
{% elif obj_type == 'tree' %}
<span class="empty-diff">Directory.</span>
+ {% elif not is_text %}
+ <span class="empty-diff">Binary file was {{ type }}.</span>
{% else %}
<img src="{{g.forge_static('images/spinner.gif')}}" class="loading_icon" alt="Loading..."/>
<script type="text/javascript">
@@ -175,7 +174,6 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
{% endif %}
</div>
</div>
- {% endif %}
{% endfor %}
{{ c.page_list.display(page=page, limit=limit, count=count) }}
{% endblock %}
[26/50] allura git commit: [#7925] tests, fix,
and docstring for has_html_view
Posted by je...@apache.org.
[#7925] tests, fix, and docstring for has_html_view
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/7133cb19
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/7133cb19
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/7133cb19
Branch: refs/heads/ib/7922
Commit: 7133cb19b3b770f45159ceacc968e85464599af4
Parents: 9835504
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Jul 31 20:25:09 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:37 2015 -0400
----------------------------------------------------------------------
Allura/allura/model/repository.py | 28 +++++++++++++++-----------
Allura/allura/tests/unit/test_repo.py | 32 +++++++++++++++++++++++++-----
2 files changed, 43 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/7133cb19/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 636d10c..3db43a8 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -78,18 +78,18 @@ SObjType = S.OneOf('blob', 'tree', 'submodule')
# Used for when we're going to batch queries using $in
QSIZE = 100
BINARY_EXTENSIONS = [
- "3ds", "3g2", "3gp", "7z", "a", "aac", "adp", "ai", "aif", "apk", "ar", "asf", "au", "avi",
- "bak", "bin", "bk", "bmp", "btif", "bz2", "cab", "caf", "cgm", "cmx", "cpio", "cr2", "dat", "deb", "djvu", "dll",
- "dmg", "dng", "doc", "docx", "dra", "DS_Store", "dsk", "dts", "dtshd", "dvb", "dwg", "dxf", "ecelp4800",
- "ecelp7470", "ecelp9600", "egg", "eol", "eot", "epub", "exe", "f4v", "fbs", "fh", "fla", "flac", "fli", "flv",
- "fpx", "fst", "fvt", "g3", "gif", "gz", "h261", "h263", "h264", "ico", "ief", "img", "ipa", "iso", "jar", "jpeg",
- "jpg", "jpgv", "jpm", "jxr", "ktx", "lvp", "lz", "lzma", "lzo", "m3u", "m4a", "m4v", "mar", "mdi", "mid", "mj2",
- "mka", "mkv", "mmr", "mng", "mov", "movie", "mp3", "mp4", "mp4a", "mpeg", "mpg", "mpga", "mxu", "nef", "npx", "o",
- "oga", "ogg", "ogv", "otf", "pbm", "pcx", "pdf", "pea", "pgm", "pic", "png", "pnm", "ppm", "psd", "pya", "pyc",
- "pyo", "pyv", "qt", "rar", "ras", "raw", "rgb", "rip", "rlc", "rz", "s3m", "s7z", "scpt", "sgi", "shar", "sil",
- "smv", "so", "sub", "swf", "tar", "tbz2", "tga", "tgz", "tif", "tiff", "tlz", "ts", "ttf", "uvh", "uvi", "uvm",
- "uvp", "uvs", "uvu", "viv", "vob", "war", "wav", "wax", "wbmp", "wdp", "weba", "webm", "webp", "whl", "wm", "wma",
- "wmv", "wmx", "woff", "woff2", "wvx", "xbm", "xif", "xm", "xpi", "xpm", "xwd", "xz", "z", "zip", "zipx"
+ ".3ds", ".3g2", ".3gp", ".7z", ".a", ".aac", ".adp", ".ai", ".aif", ".apk", ".ar", ".asf", ".au", ".avi",
+ ".bak", ".bin", ".bk", ".bmp", ".btif", ".bz2", ".cab", ".caf", ".cgm", ".cmx", ".cpio", ".cr2", ".dat", ".deb", ".djvu", ".dll",
+ ".dmg", ".dng", ".doc", ".docx", ".dra", ".DS_Store", ".dsk", ".dts", ".dtshd", ".dvb", ".dwg", ".dxf", ".ecelp4800",
+ ".ecelp7470", ".ecelp9600", ".egg", ".eol", ".eot", ".epub", ".exe", ".f4v", ".fbs", ".fh", ".fla", ".flac", ".fli", ".flv",
+ ".fpx", ".fst", ".fvt", ".g3", ".gif", ".gz", ".h261", ".h263", ".h264", ".ico", ".ief", ".img", ".ipa", ".iso", ".jar", ".jpeg",
+ ".jpg", ".jpgv", ".jpm", ".jxr", ".ktx", ".lvp", ".lz", ".lzma", ".lzo", ".m3u", ".m4a", ".m4v", ".mar", ".mdi", ".mid", ".mj2",
+ ".mka", ".mkv", ".mmr", ".mng", ".mov", ".movie", ".mp3", ".mp4", ".mp4a", ".mpeg", ".mpg", ".mpga", ".mxu", ".nef", ".npx", ".o",
+ ".oga", ".ogg", ".ogv", ".otf", ".pbm", ".pcx", ".pdf", ".pea", ".pgm", ".pic", ".png", ".pnm", ".ppm", ".psd", ".pya", ".pyc",
+ ".pyo", ".pyv", ".qt", ".rar", ".ras", ".raw", ".rgb", ".rip", ".rlc", ".rz", ".s3m", ".s7z", ".scpt", ".sgi", ".shar", ".sil",
+ ".smv", ".so", ".sub", ".swf", ".tar", ".tbz2", ".tga", ".tgz", ".tif", ".tiff", ".tlz", ".ts", ".ttf", ".uvh", ".uvi", ".uvm",
+ ".uvp", ".uvs", ".uvu", ".viv", ".vob", ".war", ".wav", ".wax", ".wbmp", ".wdp", ".weba", ".webm", ".webp", ".whl", ".wm", ".wma",
+ ".wmv", ".wmx", ".woff", ".woff2", ".wvx", ".xbm", ".xif", ".xm", ".xpi", ".xpm", ".xwd", ".xz", ".z", ".zip", ".zipx"
]
PYPELINE_EXTENSIONS = utils.MARKDOWN_EXTENSIONS + ['.rst']
@@ -1478,6 +1478,10 @@ class Blob(object):
@LazyProperty
def has_html_view(self):
+ '''
+ Return true if file is a text file that can be displayed.
+ :return: boolean
+ '''
if self.extension in BINARY_EXTENSIONS:
return False
if (self.content_type.startswith('text/') or
http://git-wip-us.apache.org/repos/asf/allura/blob/7133cb19/Allura/allura/tests/unit/test_repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/test_repo.py b/Allura/allura/tests/unit/test_repo.py
index 9008571..2e52ebe 100644
--- a/Allura/allura/tests/unit/test_repo.py
+++ b/Allura/allura/tests/unit/test_repo.py
@@ -153,13 +153,35 @@ class TestTree(unittest.TestCase):
class TestBlob(unittest.TestCase):
def test_pypeline_view(self):
- blob = M.repository.Blob(Mock(), Mock(), Mock())
- blob._id = 'blob1'
- blob.path = Mock(return_value='path')
- blob.name = 'INSTALL.mdown'
- blob.extension = '.mdown'
+ blob = M.repository.Blob(Mock(), 'INSTALL.mdown', 'blob1')
assert_equal(blob.has_pypeline_view, True)
+ def test_has_html_view_text_mime(self):
+ blob = M.repository.Blob(Mock(), 'INSTALL', 'blob1')
+ blob.content_type = 'text/plain'
+ assert_equal(blob.has_html_view, True)
+
+ def test_has_html_view_text_ext(self):
+ blob = M.repository.Blob(Mock(), 'INSTALL.txt', 'blob1')
+ blob.content_type = 'foo/bar'
+ assert_equal(blob.has_html_view, True)
+
+ def test_has_html_view_text_contents(self):
+ blob = M.repository.Blob(MagicMock(), 'INSTALL', 'blob1')
+ blob.content_type = 'foo/bar'
+ blob.text = 'hello world, this is text here'
+ assert_equal(blob.has_html_view, True)
+
+ def test_has_html_view_bin_ext(self):
+ blob = M.repository.Blob(Mock(), 'INSTALL.zip', 'blob1')
+ assert_equal(blob.has_html_view, False)
+
+ def test_has_html_view_bin_content(self):
+ blob = M.repository.Blob(MagicMock(), 'myfile', 'blob1')
+ blob.content_type = 'whatever'
+ blob.text = '\0\0\0\0'
+ assert_equal(blob.has_html_view, False)
+
class TestCommit(unittest.TestCase):
[49/50] allura git commit: [#7922] ticket:834 Add href="#" to sidebar
admin header, so that tests won't fail
Posted by je...@apache.org.
[#7922] ticket:834 Add href="#" to sidebar admin header, so that tests won't fail
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5cb23a0a
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5cb23a0a
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5cb23a0a
Branch: refs/heads/ib/7922
Commit: 5cb23a0aa18cf90c982008c59f043a880a9c3350
Parents: 2e970fa
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Aug 13 19:39:40 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 19:40:00 2015 +0300
----------------------------------------------------------------------
Allura/allura/templates/jinja_master/sidebar_menu.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/5cb23a0a/Allura/allura/templates/jinja_master/sidebar_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/sidebar_menu.html b/Allura/allura/templates/jinja_master/sidebar_menu.html
index 64102fc..80d37ac 100644
--- a/Allura/allura/templates/jinja_master/sidebar_menu.html
+++ b/Allura/allura/templates/jinja_master/sidebar_menu.html
@@ -61,7 +61,7 @@
{% set admin_menu = c.app.admin_menu() %}
{% endif %}
{% if admin_menu %}
- <a id='sidebar-admin-header' onclick='$("#sidebar-admin-menu").toggleClass("hidden");'>
+ <a id='sidebar-admin-header' onclick='$("#sidebar-admin-menu").toggleClass("hidden");return false;' href='#'>
{{sidebar_item(c.app.admin_menu_collapse_button)}}
</a>
<div id='sidebar-admin-menu' class='hidden'>
[15/50] allura git commit: [#7950] avoid conflicting height
declarations for wiki editor
Posted by je...@apache.org.
[#7950] avoid conflicting height declarations for wiki editor
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/8a226bd5
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/8a226bd5
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/8a226bd5
Branch: refs/heads/ib/7922
Commit: 8a226bd59b0a8c03c8af9848403285b67cc4b886
Parents: d884945
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Aug 7 14:10:49 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Aug 7 14:10:49 2015 +0000
----------------------------------------------------------------------
ForgeWiki/forgewiki/templates/wiki/page_edit.html | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/8a226bd5/ForgeWiki/forgewiki/templates/wiki/page_edit.html
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/templates/wiki/page_edit.html b/ForgeWiki/forgewiki/templates/wiki/page_edit.html
index fa0e95e..4e9584b 100644
--- a/ForgeWiki/forgewiki/templates/wiki/page_edit.html
+++ b/ForgeWiki/forgewiki/templates/wiki/page_edit.html
@@ -26,8 +26,7 @@
{% block extra_css %}
<style type="text/css">
.markdown_edit .CodeMirror {
- height: auto;
- min-height: 600px;
+ height: 500px; /* match max-height in markitup_sf.css */
}
</style>
{% endblock %}
[12/50] allura git commit: CHANGES updated for ASF release 1.3.1
Posted by je...@apache.org.
CHANGES updated for ASF release 1.3.1
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/d07cd701
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d07cd701
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d07cd701
Branch: refs/heads/ib/7922
Commit: d07cd7017b7ba1f08879babad3db8ad9fb92d7b4
Parents: acd5b12
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Aug 5 18:32:25 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Wed Aug 5 18:32:25 2015 -0400
----------------------------------------------------------------------
CHANGES | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/d07cd701/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 5f4f0a9..917fd37 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,58 @@
+Version 1.3.1 (August 2015)
+
+Upgrade Instructions
+
+ To enable CORS headers for the rest APIs, use the cors.* settings in the development.ini file.
+ If you have your own .ini file, enable git tag & branch caching speedups by setting: repo_refs_cache_threshold = .01
+
+New Features
+
+ * [#5943] Post-setup instructions
+ * [#6373] Document administrative commands
+ * [#7897] Live syntax highlighting for markdown editing
+ * [#7927] Allow CORS access to rest APIs
+ * [#7540] Ticket notifications should include links to attachments
+
+Security
+
+ * [#7947] XSS vulnerability in link rewriting
+ * [#7942] In project admin - user permissions, removing a custom group needs to use POST
+ * [#7685] Subscribe/unsubscribe action should use POST
+
+Bug Fixes & Minor Improvements
+
+ Tickets:
+ * [#4020] Date picker in milestone editor doesn't flip between months
+ Wiki:
+ * [#4802] Wiki edit link is not very discoverable
+ * [#7310] "Maximize" should stick
+ Code repositories:
+ * [#7873] Git branch & tag speedups -- NEEDS INI
+ * [#7894] Don't update merge request timestamps incorrectly
+ * [#7932] Fix pagination issue in the commit browser
+ * [#7899] Issue with downloading files from repo with spaces in name
+ * [#7906] Fix login check on ApacheAccessHandler.py
+ Forums:
+ * [#7880] Forums mail not getting sent that require moderation
+ * [#7930] Bug: viewing a thread updates project mod_date
+ Project Admin:
+ * [#7884] Move add/edit Features to Metadata section
+ * [#7885] Tooltip for project admin
+ * [#7898] Icon upload/edit is not clear
+ General:
+ * [#7803] Fix taskd_cleanup to search for right process name
+ * [#7889] Improve markdown logic for cached vs threshold limits
+ * [#7890] Neighborhood cache preventing saving admin changes
+ * [#7916] Error when handling user-profile URLs of users with invalid names.
+ * [#7928] Site admin search tables can overflow the page width
+ * [#7903] No mention about small letters in user registration
+ * [#7909] Use dashes when suggesting project shortnames
+ * [#7915] Move Allura installation instructions into the docs
+ For Developers:
+ * [#7809] Update install/docker to ubuntu 14.04
+ * [#7891] Remove zarkov integration code
+
+
Version 1.3.0 (June 2015)
Upgrade Instructions
[24/50] allura git commit: [#7925] remove --find-copies-harder due to
false-positives
Posted by je...@apache.org.
[#7925] remove --find-copies-harder due to false-positives
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/155e0b0f
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/155e0b0f
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/155e0b0f
Branch: refs/heads/ib/7922
Commit: 155e0b0fcdecedee1df4bb3fdcf394952c6f580d
Parents: 73385a8
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Jul 31 16:09:59 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:36 2015 -0400
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/155e0b0f/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 9a8549a..ece0d6c 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -651,7 +651,6 @@ class GitImplementation(M.RepositoryImplementation):
'--name-status',
'--no-abbrev',
'--root',
- '--find-copies-harder',
# show tree entry itself as well as subtrees (Commit.added_paths relies on this)
'-t',
'-z', # don't escape filenames and use \x00 as fields delimiter
[02/50] allura git commit: [#7947] fix minor HTML changes in tests,
also artifact links now have trailing slashes again (they went away
in [8da7c57] for some reason)
Posted by je...@apache.org.
[#7947] fix minor HTML changes in tests, also artifact links now have trailing slashes again (they went away in [8da7c57] for some reason)
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/dd3ca5bf
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/dd3ca5bf
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/dd3ca5bf
Branch: refs/heads/ib/7922
Commit: dd3ca5bf6fc5be91a2ef29012c6a59c62cf85a8a
Parents: e0e2f0c
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Aug 3 18:47:15 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Aug 3 18:55:26 2015 +0000
----------------------------------------------------------------------
Allura/allura/tests/functional/test_root.py | 2 +-
Allura/allura/tests/test_globals.py | 114 ++++++++++---------
Allura/allura/tests/test_helpers.py | 2 +-
.../forgeblog/tests/unit/test_blog_post.py | 2 +-
.../forgetracker/tests/functional/test_root.py | 10 +-
5 files changed, 68 insertions(+), 62 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/dd3ca5bf/Allura/allura/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_root.py b/Allura/allura/tests/functional/test_root.py
index 8f29b31..bc54d65 100644
--- a/Allura/allura/tests/functional/test_root.py
+++ b/Allura/allura/tests/functional/test_root.py
@@ -149,7 +149,7 @@ class TestRootController(TestController):
n = M.Neighborhood.query.get(name='Projects')
r = self.app.get(
'/nf/markdown_to_html?markdown=*aaa*bb[wiki:Home]&project=test&app=bugs&neighborhood=%s' % n._id, validate_chunk=True)
- assert '<p><em>aaa</em>bb<a class="alink" href="/p/test/wiki/Home">[wiki:Home]</a></p>' in r, r
+ assert '<p><em>aaa</em>bb<a class="alink" href="/p/test/wiki/Home/">[wiki:Home]</a></p>' in r, r
def test_slash_redirect(self):
self.app.get('/p', status=301)
http://git-wip-us.apache.org/repos/asf/allura/blob/dd3ca5bf/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index 91565ae..0203969 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -48,6 +48,9 @@ from allura.tests import decorators as td
from forgewiki import model as WM
from forgeblog import model as BM
+def squish_spaces(text):
+ return re.sub(r'\s+', ' ', text)
+
def setUp():
"""Method called by nose once before running the package. Some functions need it run again to reset data"""
@@ -210,12 +213,14 @@ def test_macro_members():
p_test.add_user(M.User.by_username('test-user'), ['Developer'])
p_test.add_user(M.User.by_username('test-user-0'), ['Member'])
ThreadLocalORMSession.flush_all()
- r = g.markdown_wiki.convert('[[members limit=2]]')
- assert_equal(r, '<div class="markdown_content"><h6>Project Members:</h6>\n'
- '<ul class="md-users-list">\n'
- '<li><a href="/u/test-admin">Test Admin</a> (admin)</li><li><a href="/u/test-user">Test User</a></li>\n'
- '<li class="md-users-list-more"><a href="/p/test/_members">All Members</a></li>\n'
- '</ul>\n'
+ r = g.markdown_wiki.convert('[[members limit=2]]').replace('\t','').replace('\n','')
+ assert_equal(r,
+ '<div class="markdown_content"><h6>Project Members:</h6>'
+ '<ul class="md-users-list">'
+ '<li><a href="/u/test-admin/">Test Admin</a> (admin)</li>'
+ '<li><a href="/u/test-user/">Test User</a></li>'
+ '<li class="md-users-list-more"><a href="/p/test/_members">All Members</a></li>'
+ '</ul>'
'</div>')
@@ -224,10 +229,11 @@ def test_macro_members_escaping():
user = M.User.by_username('test-admin')
user.display_name = u'Test Admin <script>'
r = g.markdown_wiki.convert('[[members]]')
- assert_equal(r, u'<div class="markdown_content"><h6>Project Members:</h6>\n'
- u'<ul class="md-users-list">\n'
- u'<li><a href="/u/test-admin">Test Admin <script></a> (admin)</li>\n'
- u'</ul>\n</div>')
+ assert_equal(r.replace('\n', '').replace('\t', ''),
+ u'<div class="markdown_content"><h6>Project Members:</h6>'
+ u'<ul class="md-users-list">'
+ u'<li><a href="/u/test-admin/">Test Admin <script></a> (admin)</li>'
+ u'</ul></div>')
@with_setup(setUp)
@@ -236,8 +242,11 @@ def test_macro_project_admins():
user.display_name = u'Test Ådmin <script>'
with h.push_context('test', neighborhood='Projects'):
r = g.markdown_wiki.convert('[[project_admins]]')
- assert_equal(
- r, u'<div class="markdown_content"><h6>Project Admins:</h6>\n<ul class="md-users-list">\n<li><a href="/u/test-admin">Test \xc5dmin <script></a></li>\n</ul>\n</div>')
+ assert_equal(r.replace('\n', ''),
+ u'<div class="markdown_content"><h6>Project Admins:</h6>'
+ u'<ul class="md-users-list">'
+ u' <li><a href="/u/test-admin/">Test \xc5dmin <script></a></li>'
+ u'</ul></div>')
@with_setup(setUp)
@@ -249,7 +258,7 @@ def test_macro_project_admins_one_br():
with h.push_config(c, project=p_test):
r = g.markdown_wiki.convert('[[project_admins]]\n[[download_button]]')
- assert not '</a><br /><br /><a href=' in r, r
+ assert not '</a><br/><br/><a href=' in r, r
assert '</a></li><li><a href=' in r, r
@@ -272,17 +281,17 @@ def test_macro_include_no_extra_br():
md = '[[include ref=Include_1]]\n[[include ref=Include_2]]\n[[include ref=Include_3]]'
html = g.markdown_wiki.convert(md)
- expected_html = '''
-<div class="markdown_content">
-<p>
-<div><div class="markdown_content"><p>included page 1</p></div></div>
-<div><div class="markdown_content"><p>included page 2</p></div></div>
-<div><div class="markdown_content"><p>included page 3</p></div></div>
-</p>
-<p></p>
+ expected_html = '''<div class="markdown_content"><p></p><div>
+<div class="markdown_content"><p>included page 1</p></div>
+</div>
+<div>
+<div class="markdown_content"><p>included page 2</p></div>
+</div>
+<div>
+<div class="markdown_content"><p>included page 3</p></div>
</div>
-'''.strip().replace('\n', '')
- assert html.strip().replace('\n', '') == expected_html, html
+<p></p></div>'''
+ assert_equal(squish_spaces(html), squish_spaces(expected_html))
@with_setup(setUp, tearDown)
@td.with_wiki
@@ -324,10 +333,9 @@ def test_macro_embed(oembed_fetch):
"html": '<iframe width="480" height="270" src="http://www.youtube.com/embed/kOLpSPEA72U?feature=oembed" frameborder="0" allowfullscreen></iframe>)',
"title": "Nature's 3D Printer: MIND BLOWING Cocoon in Rainforest - Smarter Every Day 94",
}
- r = g.markdown_wiki.convert(
- '[[embed url=http://www.youtube.com/watch?v=kOLpSPEA72U]]')
- assert_in('<div class="grid-20"><iframe height="270" src="https://www.youtube.com/embed/kOLpSPEA72U?feature=oembed" width="480"></iframe>\n</div>',
- r)
+ r = g.markdown_wiki.convert('[[embed url=http://www.youtube.com/watch?v=kOLpSPEA72U]]')
+ assert_in('<div class="grid-20"><iframe height="270" src="https://www.youtube.com/embed/kOLpSPEA72U?feature=oembed" width="480"></iframe></div>',
+ r.replace('\n', ''))
def test_macro_embed_notsupported():
@@ -357,29 +365,29 @@ def test_wiki_artifact_links():
assert 'See <span>[18:13:49]</span>' in text, text
with h.push_context('test', 'wiki', neighborhood='Projects'):
text = g.markdown.convert('Read [here](Home) about our project')
- assert '<a class="" href="/p/test/wiki/Home">here</a>' in text, text
+ assert '<a class="" href="/p/test/wiki/Home/">here</a>' in text, text
text = g.markdown.convert('[Go home](test:wiki:Home)')
- assert '<a class="" href="/p/test/wiki/Home">Go home</a>' in text, text
+ assert '<a class="" href="/p/test/wiki/Home/">Go home</a>' in text, text
text = g.markdown.convert('See [test:wiki:Home]')
- assert '<a class="alink" href="/p/test/wiki/Home">[test:wiki:Home]</a>' in text, text
+ assert '<a class="alink" href="/p/test/wiki/Home/">[test:wiki:Home]</a>' in text, text
def test_markdown_links():
with patch.dict(tg.config, {'nofollow_exempt_domains': 'foobar.net'}):
- text = g.markdown.convert(
- 'Read [here](http://foobar.net/) about our project')
- assert_in('class="" href="http://foobar.net">here</a> about', text)
+ text = g.markdown.convert('Read [here](http://foobar.net/) about our project')
+ assert_in('class="" href="http://foobar.net/">here</a> about', text)
- text = g.markdown.convert(
- 'Read [here](http://foobar.net/) about our project')
- assert_in('class="" href="http://foobar.net" rel="nofollow">here</a> about', text)
+ text = g.markdown.convert('Read [here](http://foobar.net/) about our project')
+ assert_in('class="" href="http://foobar.net/" rel="nofollow">here</a> about', text)
text = g.markdown.convert('Read [here](/p/foobar/blah) about our project')
assert_in('class="" href="/p/foobar/blah">here</a> about', text)
+ text = g.markdown.convert('Read [here](/p/foobar/blah/) about our project')
+ assert_in('class="" href="/p/foobar/blah/">here</a> about', text)
+
text = g.markdown.convert('Read <http://foobar.net/> about our project')
- assert_in(
- 'href="http://foobar.net" rel="nofollow">http://foobar.net/</a> about', text)
+ assert_in('href="http://foobar.net/" rel="nofollow">http://foobar.net/</a> about', text)
def test_markdown_and_html():
@@ -390,11 +398,9 @@ def test_markdown_and_html():
def test_markdown_within_html():
with h.push_context('test', neighborhood='Projects'):
- r = g.markdown_wiki.convert(
- '<div style="float:left" markdown>**blah**</div>')
- assert '''<div style="float: left;">
-<p><strong>blah</strong></p>
-</div>''' in r, r
+ r = g.markdown_wiki.convert('<div style="float:left" markdown>**blah**</div>')
+ assert_in('<div style="float: left;"><p><strong>blah</strong></p></div>',
+ r.replace('\n', ''))
def test_markdown_with_html_comments():
@@ -413,16 +419,15 @@ def test_markdown_big_text():
def test_markdown_basics():
with h.push_context('test', 'wiki', neighborhood='Projects'):
text = g.markdown.convert('# Foo!\n[Home]')
- assert '<a class="alink" href="/p/test/wiki/Home">[Home]</a>' in text, text
+ assert '<a class="alink" href="/p/test/wiki/Home/">[Home]</a>' in text, text
text = g.markdown.convert('# Foo!\n[Rooted]')
assert '<a href=' not in text, text
- assert '<br' in g.markdown.convert(
- 'Multi\nLine'), g.markdown.convert('Multi\nLine')
+ assert '<br' in g.markdown.convert('Multi\nLine'), g.markdown.convert('Multi\nLine')
assert '<br' not in g.markdown.convert('Multi\n\nLine')
g.markdown.convert("<class 'foo'>") # should not raise an exception
- assert '<br>' not in g.markdown.convert('''# Header
+ assert '<br' not in g.markdown.convert('''# Header
Some text in a regular paragraph
@@ -446,7 +451,7 @@ def test_markdown_autolink():
# beginning of doc
assert_in('<a href=', g.markdown.convert('http://domain.net abc'))
# beginning of a line
- assert_in('<br />\n<a href="http://',
+ assert_in('<br/>\n<a href="http://',
g.markdown.convert('foobar\nhttp://domain.net abc'))
# no conversion of these urls:
assert_in('a blahttp://sdf.com z',
@@ -461,8 +466,7 @@ def test_markdown_autolink():
def test_markdown_autolink_with_escape():
# \_ is unnecessary but valid markdown escaping and should be considered as a regular underscore
# (it occurs during html2text conversion during project migrations)
- r = g.markdown.convert(
- 'a http://www.phpmyadmin.net/home\_page/security/\#target b')
+ r = g.markdown.convert('a http://www.phpmyadmin.net/home\_page/security/\#target b')
assert 'href="http://www.phpmyadmin.net/home_page/security/#target"' in r, r
@@ -588,7 +592,7 @@ def test_myprojects_macro():
for p in c.user.my_projects():
if p.deleted or p.is_nbhd_project:
continue
- proj_title = '<h2><a href="%s">%s</a></h2>' % (p.url().rstrip('/'), p.name)
+ proj_title = '<h2><a href="%s">%s</a></h2>' % (p.url(), p.name)
assert_in(proj_title, r)
h.set_context('u/test-user-1', 'wiki', neighborhood='Users')
@@ -597,7 +601,7 @@ def test_myprojects_macro():
for p in user.my_projects():
if p.deleted or p.is_nbhd_project:
continue
- proj_title = '<h2><a href="%s">%s</a></h2>' % (p.url().rstrip('/'), p.name)
+ proj_title = '<h2><a href="%s">%s</a></h2>' % (p.url(), p.name)
assert_in(proj_title, r)
@@ -625,9 +629,11 @@ def test_hideawards_macro():
with h.push_context(p_nbhd.neighborhood_project._id):
r = g.markdown_wiki.convert('[[projects]]')
- assert '<div class="feature">\n<a href="http://award.org" title="Winner!" rel="nofollow">Award short</a>\n</div>' in r, r
+ assert_in('<div class="feature"> <a href="http://award.org" rel="nofollow" title="Winner!">Award short</a> </div>',
+ squish_spaces(r))
+
r = g.markdown_wiki.convert('[[projects show_awards_banner=False]]')
- assert '<div class="feature">\n<a href="http://award.org" title="Winner!" rel="nofollow">Award short</a>\n</div>' not in r, r
+ assert_not_in('Award short', r)
def get_project_names(r):
http://git-wip-us.apache.org/repos/asf/allura/blob/dd3ca5bf/Allura/allura/tests/test_helpers.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_helpers.py b/Allura/allura/tests/test_helpers.py
index 49032eb..22d5b94 100644
--- a/Allura/allura/tests/test_helpers.py
+++ b/Allura/allura/tests/test_helpers.py
@@ -250,7 +250,7 @@ def test_render_any_markup_formatting():
'<div class="markdown_content"><h3 id="foo">foo</h3>\n'
'<div class="codehilite"><pre><span class="nt">'
'<script></span>alert(1)<span class="nt">'
- '</script></span> bar\n</pre></div>\n</div>')
+ '</script></span> bar\n</pre></div>\n\n</div>')
class AuditLogMock(Mock):
http://git-wip-us.apache.org/repos/asf/allura/blob/dd3ca5bf/ForgeBlog/forgeblog/tests/unit/test_blog_post.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/tests/unit/test_blog_post.py b/ForgeBlog/forgeblog/tests/unit/test_blog_post.py
index 34842c5..fadfcf0 100644
--- a/ForgeBlog/forgeblog/tests/unit/test_blog_post.py
+++ b/ForgeBlog/forgeblog/tests/unit/test_blog_post.py
@@ -132,6 +132,6 @@ class TestHtmlPreview(BlogTestWithModel):
'fugiat nulla pariatur. Excepteur sint occaecat cupidatat '
'non proident, sunt in culpa qui officia deserunt mollit '
'anim id est laborum.... '
- '<a class="" href="/p/test/blog/%s/%02i/untitled">'
+ '<a class="" href="/p/test/blog/%s/%02i/untitled/">'
'read more</a></p></div>') % (now.year, now.month)
assert_equal(self._make_post(text).html_text_preview, expected)
http://git-wip-us.apache.org/repos/asf/allura/blob/dd3ca5bf/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 89041d7..47c9aab 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -984,8 +984,8 @@ class TestFunctionalController(TrackerTestController):
assert_not_in('Tickets: <s>#1</s>', r)
assert_in('Tickets: <s>#2</s>', r)
- assert_in('<a class="alink" href="/p/test/bugs/1">[#1]</a>', r.body)
- assert_in('<a class="alink strikethrough" href="/p/test/bugs/2">[#2]</a>', r.body)
+ assert_in('<a class="alink" href="/p/test/bugs/1/">[#1]</a>', r.body)
+ assert_in('<a class="alink strikethrough" href="/p/test/bugs/2/">[#2]</a>', r.body)
def test_ticket_view_editable(self):
summary = 'test ticket view page can be edited'
@@ -2381,7 +2381,7 @@ class TestFunctionalController(TrackerTestController):
return_path, rcpts, body = _client.sendmail.call_args[0]
body = body.split('\n')
assert 'Subject: [test:bugs] #1 test <h2> ticket' in body
- assert_in('<p><strong> <a class="alink" href="http://localhost:8080/p/test/bugs/1">[bugs:#1]</a> test <h2> ticket</strong></p>', body)
+ assert_in('<p><strong> <a class="alink" href="http://localhost:8080/p/test/bugs/1/">[bugs:#1]</a> test <h2> ticket</strong></p>', body)
@patch('forgetracker.search.query_filter_choices')
def test_multiselect(self, query_filter_choices):
@@ -3195,9 +3195,9 @@ class TestArtifactLinks(TrackerTestController):
assert_equal(ticket_features.app.config._id, features.config._id)
c.app = bugs
- link = u'<div class="markdown_content"><p><a class="alink" href="/p/test/bugs/1">[#1]</a></p></div>'
+ link = u'<div class="markdown_content"><p><a class="alink" href="/p/test/bugs/1/">[#1]</a></p></div>'
assert_equal(g.markdown.convert('[#1]'), link)
c.app = features
- link = u'<div class="markdown_content"><p><a class="alink" href="/p/test/features/1">[#1]</a></p></div>'
+ link = u'<div class="markdown_content"><p><a class="alink" href="/p/test/features/1/">[#1]</a></p></div>'
assert_equal(g.markdown.convert('[#1]'), link)
[41/50] allura git commit: [#7922] ticket:826 Fix tool ordering
Posted by je...@apache.org.
[#7922] ticket:826 Fix tool ordering
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/2769771f
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/2769771f
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/2769771f
Branch: refs/heads/ib/7922
Commit: 2769771fbb126be2e5fbfbec3a3044bf44b99126
Parents: 1c00249
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Jul 31 12:48:43 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 18:14:42 2015 +0300
----------------------------------------------------------------------
Allura/allura/ext/admin/templates/project_tools.html | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/2769771f/Allura/allura/ext/admin/templates/project_tools.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/project_tools.html b/Allura/allura/ext/admin/templates/project_tools.html
index 90c03d4..aa825f1 100644
--- a/Allura/allura/ext/admin/templates/project_tools.html
+++ b/Allura/allura/ext/admin/templates/project_tools.html
@@ -92,9 +92,8 @@
{% endfor %}
{{sidebar_item(app.admin_menu_delete_button)}}
</ul>
- {% if not app.uninstallable %}
- <input type="hidden" class="mount_point" value="{{mount['ac'].options.mount_point}}"/>
- {% endif %}
+ {# for ordering #}
+ <input type="hidden" class="mount_point" value="{{mount['ac'].options.mount_point}}"/>
</div>
{% endif %}
{% if 'sub' in mount and not mount['sub'].deleted %}
[50/50] allura git commit: [#7922] ticket:834 Fix one more test
Posted by je...@apache.org.
[#7922] ticket:834 Fix one more test
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/f3e16b3a
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/f3e16b3a
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/f3e16b3a
Branch: refs/heads/ib/7922
Commit: f3e16b3a64f6e3c7816a72ee4823bec4cb63fe31
Parents: 5cb23a0
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Aug 13 20:30:04 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 20:30:04 2015 +0300
----------------------------------------------------------------------
ForgeWiki/forgewiki/tests/functional/test_root.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/f3e16b3a/ForgeWiki/forgewiki/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/functional/test_root.py b/ForgeWiki/forgewiki/tests/functional/test_root.py
index e2604bc..a42bce6 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_root.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_root.py
@@ -826,7 +826,7 @@ class TestRootController(TestController):
menu = [li.find('span').getText() for li in menu.findAll('li')]
assert_equal(
menu,
- ['Admin', 'Set Home', 'Permissions', 'Options', 'Label', 'Delete'])
+ ['Set Home', 'Permissions', 'Options', 'Label', 'Delete'])
def test_sidebar_admin_menu_invisible_to_not_admin(self):
def assert_invisible_for(username):
[13/50] allura git commit: Remove unused #help CSS (has been around
forever, never used) which will alleviate one case of #7945 css interference
Posted by je...@apache.org.
Remove unused #help CSS (has been around forever, never used) which will alleviate one case of #7945 css interference
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/dc857c58
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/dc857c58
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/dc857c58
Branch: refs/heads/ib/7922
Commit: dc857c58f597564667fea437a03a51ed1e1def4a
Parents: d07cd70
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Aug 5 17:53:31 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 6 13:18:41 2015 +0300
----------------------------------------------------------------------
Allura/allura/nf/allura/css/site_style.css | 13 -------------
1 file changed, 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/dc857c58/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index 055583e..5a6339c 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -803,19 +803,6 @@ blockquote {
border: 1px solid black;
}
-/* help */
-#help {
- width: 100%;
- padding: 20px 0 0;
- -moz-box-shadow: rgba(0, 0, 0, 0.5) 0 0 20px 0 inset;
- -webkit-box-shadow: rgba(0, 0, 0, 0.5) 0 0 20px 0 inset;
- -o-box-shadow: rgba(0, 0, 0, 0.5) 0 0 20px 0 inset;
- box-shadow: rgba(0, 0, 0, 0.5) 0 0 20px 0 inset;
-}
-#help h1 {
- padding-left: 20px;
-}
-
.markdown_syntax_toc_crumb {
float: right !important;
margin-left: 20px;
[21/50] allura git commit: [#7925] simplify and de-bug git output
processing by using a new var, no in-place updates to 'files'
Posted by je...@apache.org.
[#7925] simplify and de-bug git output processing by using a new var, no in-place updates to 'files'
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5adbb285
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5adbb285
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5adbb285
Branch: refs/heads/ib/7922
Commit: 5adbb2858dd0f5ac189bc10dc85530e481380cba
Parents: 787ee90
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Jul 31 16:12:23 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:36 2015 -0400
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 74 ++++++++++++++++++--------------
1 file changed, 42 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/5adbb285/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index ece0d6c..9462087 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -642,9 +642,9 @@ class GitImplementation(M.RepositoryImplementation):
max_count=1).splitlines()[1:]
def paged_diffs(self, commit_id, start=0, end=None):
- result = {'added': [], 'removed': [], 'changed': [], 'copied': [], 'renamed': [], 'total': 0}
+ result = {'added': [], 'removed': [], 'changed': [], 'copied': [], 'renamed': []}
- files = self._git.git.diff_tree(
+ cmd_output = self._git.git.diff_tree(
'--no-commit-id',
'--find-renames',
'--find-copies',
@@ -656,39 +656,49 @@ class GitImplementation(M.RepositoryImplementation):
'-z', # don't escape filenames and use \x00 as fields delimiter
commit_id).split('\x00')[:-1]
- result['total'] = len(files) / 2
- x = 0
- while x < len(files):
- try:
- if files[x].startswith("R") or files[x].startswith("C"):
- change_list = result['renamed'] if files[x].startswith("R") else result['copied']
- ratio = float(files[x][1:4]) / 100.0
- change_list.append({
- 'new': h.really_unicode(files[x + 2]),
- 'old': h.really_unicode(files[x + 1]),
- 'ratio': ratio,
- 'diff': '',
- })
- del files[x:x+3]
- x += 3
- result['total'] -= 1
- else:
- x += 2
- except IndexError:
- break
+ ''' cmd_output will be like:
+ [
+ 'A',
+ 'filename',
+ 'D',
+ 'another filename',
+ 'M',
+ 'po',
+ 'R100',
+ 'po/sr.po',
+ 'po/sr_Latn.po',
+ ]
+ '''
- files = [(files[i], h.really_unicode(files[i + 1]))
- for i in xrange(0, result['total'] + 1, 2)]
+ x = 0
+ files = []
+ while x < len(cmd_output):
+ status = cmd_output[x][0]
+ if status in ('R', 'C'):
+ # TODO: make sure we have a test for this
+ ratio = float(cmd_output[x][1:4]) / 100.0
+ files.append((status, {
+ 'new': h.really_unicode(cmd_output[x + 2]),
+ 'old': h.really_unicode(cmd_output[x + 1]),
+ 'ratio': ratio,
+ 'diff': '',
+ }))
+ x += 3
+ else:
+ files.append((status, h.really_unicode(cmd_output[x+1])))
+ x += 2
- # files = [('A', u'filename'), ('D', u'another filename'), ...]
for status, name in files[start:end]:
- if status == 'A':
- result['added'].append(name)
- elif status == 'D':
- result['removed'].append(name)
- elif status == 'M':
- result['changed'].append(name)
-
+ change_list = {
+ 'R': result['renamed'],
+ 'C': result['copied'],
+ 'A': result['added'],
+ 'D': result['removed'],
+ 'M': result['changed']
+ }[status]
+ change_list.append(name)
+
+ result['total'] = len(files)
return result
@contextmanager
[06/50] allura git commit: [#7947] match case of beautifulsoup4,
with pypi
Posted by je...@apache.org.
[#7947] match case of beautifulsoup4, with pypi
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/0015f479
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/0015f479
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/0015f479
Branch: refs/heads/ib/7922
Commit: 0015f4792248a537079dfa4f04f00ce85f767cee
Parents: cc5f2ac
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Aug 3 21:47:05 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Aug 3 21:47:05 2015 +0000
----------------------------------------------------------------------
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/0015f479/requirements.txt
----------------------------------------------------------------------
diff --git a/requirements.txt b/requirements.txt
index d327584..0c96317 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,6 @@
ActivityStream==0.2.0
BeautifulSoup==3.2.0
-BeautifulSoup4==4.4.0
+beautifulsoup4==4.4.0
Beaker==1.6.4
chardet==1.0.1
colander==0.9.3
[28/50] allura git commit: [#7925] more info if file was changed
during copy/rename. Don't show diff links if no diff is being displayed
Posted by je...@apache.org.
[#7925] more info if file was changed during copy/rename. Don't show diff links if no diff is being displayed
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/96391122
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/96391122
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/96391122
Branch: refs/heads/ib/7922
Commit: 963911220644208590b3b767bc3753aececc51e0
Parents: 1919ec0
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Tue Aug 4 14:52:57 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:37 2015 -0400
----------------------------------------------------------------------
Allura/allura/templates/repo/commit.html | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/96391122/Allura/allura/templates/repo/commit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/commit.html b/Allura/allura/templates/repo/commit.html
index adf57b2..7678a32 100644
--- a/Allura/allura/templates/repo/commit.html
+++ b/Allura/allura/templates/repo/commit.html
@@ -116,7 +116,9 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
<tbody>
{% for type, file, _, _ in artifacts %}
<tr>
- <td>{{ type }}</td>
+ <td>{{ type }}
+ {% if type in ('copied', 'renamed') and file.ratio != 1 %}(with changes){% endif %}
+ </td>
<td><a href="#diff-{{loop.index}}">
{% if type == 'copied' %}
{{ '%s -> %s' % (h.really_unicode(file.old), h.really_unicode(file.new)) }}
@@ -137,7 +139,7 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
{% if type in ('added', 'changed') %}
{% set file_url = commit.url() + 'tree/' + h.urlquote(h.really_unicode(file)) %}
<a href="{{ file_url }}">{{h.really_unicode(file)}}</a>
- {% if obj_type != 'tree' %}
+ {% if obj_type != 'tree' and is_text %}
{% set diff_url = file_url + '?barediff=' + (prev[0]._id if prev else '') %}
<a class="commit-diff-link" href="{{ diff_url.replace('?barediff=', '?diff=') }}">Diff</a>
<a class="commit-diff-link switch-diff-format-link" data-diformat="{{session.diformat}}" data-diffid="diff-{{loop.index}}" href="{{ diff_url }}">Switch to {{'unified' if session.diformat == 'sidebyside' else 'side-by-side'}} view</a>
[43/50] allura git commit: [#7922] ticket:826 Fix tests
Posted by je...@apache.org.
[#7922] ticket:826 Fix tests
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/a27de2be
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/a27de2be
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/a27de2be
Branch: refs/heads/ib/7922
Commit: a27de2bef413441e79bb38d1505a33d4258e45d7
Parents: e2c2b03
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Aug 3 13:21:53 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 18:14:42 2015 +0300
----------------------------------------------------------------------
.../tests/functional/test_neighborhood.py | 2 +-
AlluraTest/alluratest/controller.py | 6 ++
.../tests/functional/test_controllers.py | 13 +++--
.../forgetracker/tests/functional/test_root.py | 61 ++++++++++++--------
.../forgewiki/tests/functional/test_rest.py | 2 +-
.../forgewiki/tests/functional/test_root.py | 9 ++-
6 files changed, 60 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/a27de2be/Allura/allura/tests/functional/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index 9359efc..8b6a74f 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -173,7 +173,7 @@ class TestNeighborhood(TestController):
r = self.app.get('/p/test/admin/tools')
assert '<div class="fleft isnt_sorted">' in r
- delete_tool = r.html.find('a', {'class': 'mount_delete'})
+ delete_tool = r.html.findAll('a', {'class': 'admin_tool_delete_modal'})
assert_equal(len(delete_tool), 1)
def test_show_title(self):
http://git-wip-us.apache.org/repos/asf/allura/blob/a27de2be/AlluraTest/alluratest/controller.py
----------------------------------------------------------------------
diff --git a/AlluraTest/alluratest/controller.py b/AlluraTest/alluratest/controller.py
index 5a61ab7..babf262 100644
--- a/AlluraTest/alluratest/controller.py
+++ b/AlluraTest/alluratest/controller.py
@@ -185,6 +185,12 @@ class TestController(object):
json_dict = json_dict.strip(' ;')
return json.loads(json_dict)
+ def find_form(self, resp, cond):
+ """Find form on the page that meets given condition"""
+ for f in resp.forms.itervalues():
+ if cond(f):
+ return f
+
class TestRestApiBase(TestController):
http://git-wip-us.apache.org/repos/asf/allura/blob/a27de2be/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 4c363d2..dcc975f 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -574,10 +574,15 @@ class TestFork(_TestCase):
r = self._follow(r, **kw)
return r
+ def _find_request_merge_form(self, resp):
+ cond = lambda f: f.action == 'do_request_merge'
+ return self.find_form(resp, cond)
+
def _request_merge(self, **kw):
r = self.app.get('/p/test2/code/request_merge', **kw)
r = self._follow(r, **kw)
- r = r.forms[0].submit()
+ form = self._find_request_merge_form(r)
+ r = form.submit()
r = self._follow(r, **kw)
mr_num = r.request.url.split('/')[-2]
assert mr_num.isdigit(), mr_num
@@ -640,7 +645,7 @@ class TestFork(_TestCase):
assert 'git checkout master' in merge_instructions
assert 'git fetch git://git.localhost/p/test2/code master' in merge_instructions
assert 'git merge {}'.format(c_id) in merge_instructions
- assert_in('less than 1 minute ago', r.html.findAll('p')[0].getText())
+ assert_in('less than 1 minute ago', r.html.findAll('p')[2].getText())
merge_form = r.html.find('form', action='merge')
assert merge_form
@@ -669,8 +674,8 @@ class TestFork(_TestCase):
r, mr_num = self._request_merge()
r = self.app.get('/p/test/src-git/merge-requests/')
assert 'href="%s/"' % mr_num in r, r
- assert_equal(r.html.findAll('span')[8].getText(), 'less than 1 minute ago')
- assert_equal(r.html.findAll('span')[9].getText(), 'less than 1 minute ago')
+ assert_equal(r.html.findAll('span')[-2].getText(), 'less than 1 minute ago')
+ assert_equal(r.html.findAll('span')[-1].getText(), 'less than 1 minute ago')
def test_merge_request_update_status(self):
r, mr_num = self._request_merge()
http://git-wip-us.apache.org/repos/asf/allura/blob/a27de2be/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 47c9aab..351b80b 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -27,6 +27,7 @@ import allura
import mock
import PIL
+from BeautifulSoup import BeautifulSoup
from mock import patch
from nose.tools import (
assert_true,
@@ -65,11 +66,19 @@ class TrackerTestController(TestController):
def setup_with_tools(self):
pass
+ def _find_new_ticket_form(self, resp):
+ cond = lambda f: f.action.endswith('/save_ticket')
+ return self.find_form(resp, cond)
+
+ def _find_update_ticket_form(self, resp):
+ cond = lambda f: f.action.endswith('/update_ticket_from_widget')
+ return self.find_form(resp, cond)
+
def new_ticket(self, mount_point='/bugs/', extra_environ=None, **kw):
extra_environ = extra_environ or {}
response = self.app.get(mount_point + 'new/',
extra_environ=extra_environ)
- form = response.forms[1]
+ form = self._find_new_ticket_form(response)
# If this is ProjectUserCombo's select populate it
# with all the users in the project. This is a workaround for tests,
# in real enviroment this is populated via ajax.
@@ -346,7 +355,7 @@ class TestFunctionalController(TrackerTestController):
def test_new_ticket_form(self):
response = self.app.get('/bugs/new/')
- form = response.forms[1]
+ form = self._find_new_ticket_form(response)
form['ticket_form.summary'] = 'test new ticket form'
form['ticket_form.description'] = 'test new ticket form description'
response = form.submit().follow()
@@ -841,7 +850,8 @@ class TestFunctionalController(TrackerTestController):
}, upload_files=[upload]).follow()
assert file_name in ticket_editor, ticket_editor.showbrowser()
req = self.app.get('/bugs/1/')
- file_link = req.html.findAll('form')[1].findAll('a')[1]
+ form = self._find_update_ticket_form(req)
+ file_link = BeautifulSoup(form.text).findAll('a')[1]
assert_equal(file_link.string, file_name)
self.app.post(str(file_link['href']), {
'delete': 'True'
@@ -883,7 +893,8 @@ class TestFunctionalController(TrackerTestController):
ticket_editor = self.app.post('/bugs/1/update_ticket', {
'summary': 'zzz'
}, upload_files=[upload]).follow()
- download = self.app.get(str(ticket_editor.html.findAll('form')[1].findAll('a')[1]['href']))
+ form = self._find_update_ticket_form(ticket_editor)
+ download = self.app.get(str(BeautifulSoup(form.text).findAll('a')[1]['href']))
assert_equal(download.body, file_data)
def test_two_attachments(self):
@@ -1229,18 +1240,17 @@ class TestFunctionalController(TrackerTestController):
'/admin/bugs/set_custom_fields', params=variable_encode(params))
# Test new ticket form
r = self.app.get('/bugs/new/')
- form = r.forms[1]
+ form = self._find_new_ticket_form(r)
form['ticket_form.custom_fields._priority'] = 'urgent'
form['ticket_form.custom_fields._category'] = 'bugs'
error_form = form.submit()
- assert_equal(error_form.forms[1]['ticket_form.custom_fields._priority'].value,
- 'urgent')
- assert_equal(error_form.forms[1]['ticket_form.custom_fields._category'].value,
- 'bugs')
+ form = self._find_new_ticket_form(error_form)
+ assert_equal(form['ticket_form.custom_fields._priority'].value, 'urgent')
+ assert_equal(form['ticket_form.custom_fields._category'].value, 'bugs')
# Test edit ticket form
self.new_ticket(summary='Test ticket')
response = self.app.get('/bugs/1/')
- form = response.forms[1]
+ form = self._find_update_ticket_form(response)
assert_equal(
form['ticket_form.custom_fields._priority'].value, 'normal')
assert_equal(form['ticket_form.custom_fields._category'].value, '')
@@ -1248,29 +1258,29 @@ class TestFunctionalController(TrackerTestController):
form['ticket_form.custom_fields._priority'] = 'urgent'
form['ticket_form.custom_fields._category'] = 'bugs'
error_form = form.submit()
- assert_equal(error_form.forms[1]['ticket_form.custom_fields._priority'].value,
- 'urgent')
- assert_equal(error_form.forms[1]['ticket_form.custom_fields._category'].value,
- 'bugs')
+ form = self._find_update_ticket_form(error_form)
+ assert_equal(form['ticket_form.custom_fields._priority'].value, 'urgent')
+ assert_equal(form['ticket_form.custom_fields._category'].value, 'bugs')
def test_new_ticket_validation(self):
summary = 'ticket summary'
response = self.app.get('/bugs/new/')
assert not response.html.find('div', {'class': 'error'})
- form = response.forms[1]
+ form = self._find_new_ticket_form(response)
form['ticket_form.labels'] = 'foo'
# try submitting with no summary set and check for error message
error_form = form.submit()
- assert error_form.forms[1]['ticket_form.labels'].value == 'foo'
- error_message = error_form.html.find('div', {'class': 'error'})
+ form = self._find_new_ticket_form(error_form)
+ assert form['ticket_form.labels'].value == 'foo'
+ error_message = BeautifulSoup(form.text).find('div', {'class': 'error'})
assert error_message
assert (error_message.string == 'You must provide a Title' or
error_message.string == 'Missing value')
assert error_message.findPreviousSibling('input').get('name') == 'ticket_form.summary'
# set a summary, submit, and check for success
- error_form.forms[1]['ticket_form.summary'] = summary
- success = error_form.forms[1].submit().follow().html
- assert success.findAll('form')[1].get('action') == '/p/test/bugs/1/update_ticket_from_widget'
+ form['ticket_form.summary'] = summary
+ success = form.submit().follow().html
+ assert success.findAll('form', {'action': '/p/test/bugs/1/update_ticket_from_widget'}) is not None
assert success.find('input', {'name': 'ticket_form.summary'})['value'] == summary
def test_edit_ticket_validation(self):
@@ -1281,7 +1291,7 @@ class TestFunctionalController(TrackerTestController):
# check that existing form is valid
assert response.html.find('input', {'name': 'ticket_form.summary'})['value'] == old_summary
assert not response.html.find('div', {'class': 'error'})
- form = response.forms[1]
+ form = self._find_update_ticket_form(response)
# try submitting with no summary set and check for error message
form['ticket_form.summary'] = ""
error_form = form.submit()
@@ -1290,11 +1300,12 @@ class TestFunctionalController(TrackerTestController):
assert error_message.string == 'You must provide a Title'
assert error_message.findPreviousSibling('input').get('name') == 'ticket_form.summary'
# set a summary, submit, and check for success
- error_form.forms[1]['ticket_form.summary'] = new_summary
- r = error_form.forms[1].submit()
+ form = self._find_update_ticket_form(error_form)
+ form['ticket_form.summary'] = new_summary
+ r = form.submit()
assert r.status_int == 302, r.showbrowser()
success = r.follow().html
- assert success.findAll('form')[1].get('action') == '/p/test/bugs/1/update_ticket_from_widget'
+ assert success.findAll('form', {'action': '/p/test/bugs/1/update_ticket_from_widget'}) is not None
assert success.find('input', {'name': 'ticket_form.summary'})['value'] == new_summary
def test_home(self):
@@ -2721,7 +2732,7 @@ class TestCustomUserField(TrackerTestController):
def test_change_user_field(self):
kw = {'custom_fields._code_review': ''}
r = self.new_ticket(summary='test custom fields', **kw).follow()
- f = r.forms[1]
+ f = self._find_update_ticket_form(r)
# Populate ProjectUserCombo's select with option we want.
# This is a workaround for tests,
# in real enviroment this is populated via ajax.
http://git-wip-us.apache.org/repos/asf/allura/blob/a27de2be/ForgeWiki/forgewiki/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/functional/test_rest.py b/ForgeWiki/forgewiki/tests/functional/test_rest.py
index 6a5de3b..a2b58ae 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_rest.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_rest.py
@@ -42,7 +42,7 @@ class TestWikiApi(TestRestApiBase):
def test_get_page(self):
r = self.app.get('/p/test/wiki/Home/')
- discussion_url = r.html.findAll('form')[2]['action'][:-4]
+ discussion_url = r.html.findAll('form')[3]['action'][:-4]
content = file(__file__).read()
self.app.post('/wiki/Home/attach',
upload_files=[('file_info', 'test_root.py', content)])
http://git-wip-us.apache.org/repos/asf/allura/blob/a27de2be/ForgeWiki/forgewiki/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/functional/test_root.py b/ForgeWiki/forgewiki/tests/functional/test_root.py
index 3f69d89..276c4b9 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_root.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_root.py
@@ -54,6 +54,10 @@ class TestRootController(TestController):
def setup_with_tools(self):
pass
+ def _find_edit_form(self, resp):
+ cond = lambda f: f.id == 'page_edit_form'
+ return self.find_form(resp, cond)
+
def test_root_index(self):
page_url = h.urlquote(u'/wiki/tést/')
r = self.app.get(page_url).follow()
@@ -678,8 +682,9 @@ class TestRootController(TestController):
assert 'The resource was found at http://localhost/p/test/wiki/Home/;' in self.app.get(
'/p/test/wiki/')
req = self.app.get('/p/test/wiki/Home/edit')
- req.forms[1]['title'].value = 'new_title'
- req.forms[1].submit()
+ form = self._find_edit_form(req)
+ form['title'].value = 'new_title'
+ form.submit()
assert 'The resource was found at http://localhost/p/test/wiki/new_title/;' in self.app.get(
'/p/test/wiki/')
[27/50] allura git commit: [#7925] add renamed files to template used
by "Browse Commits" page
Posted by je...@apache.org.
[#7925] add renamed files to template used by "Browse Commits" page
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/9835504d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/9835504d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/9835504d
Branch: refs/heads/ib/7922
Commit: 9835504d7f5e0fd68195b92ba5f66e65f844c02f
Parents: 3a8037c
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Jul 31 20:36:07 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:37 2015 -0400
----------------------------------------------------------------------
Allura/allura/templates/repo/commit_basic.html | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/9835504d/Allura/allura/templates/repo/commit_basic.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/commit_basic.html b/Allura/allura/templates/repo/commit_basic.html
index f1625ca..e4ec126 100644
--- a/Allura/allura/templates/repo/commit_basic.html
+++ b/Allura/allura/templates/repo/commit_basic.html
@@ -46,6 +46,15 @@
<a href="{{commit.url()}}tree/{{h.really_unicode(diff.new)}}">{{h.really_unicode(diff.new)}}</a>
</td>
</tr>
+ {% endfor %}{% for diff in commit.diffs.renamed %}
+ <tr>
+ <td>rename</td>
+ <td>
+ <a href="{{prev[0].url()}}tree/{{h.really_unicode(diff.old)}}">{{h.really_unicode(diff.old)}}</a>
+ <br/>to<br/>
+ <a href="{{commit.url()}}tree/{{h.really_unicode(diff.new)}}">{{h.really_unicode(diff.new)}}</a>
+ </td>
+ </tr>
{% endfor %}
</tbody>
</table>
[42/50] allura git commit: [#7922] ticket:826 Make menu collapsible
Posted by je...@apache.org.
[#7922] ticket:826 Make menu collapsible
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e2c2b039
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e2c2b039
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e2c2b039
Branch: refs/heads/ib/7922
Commit: e2c2b03918d629401845f09a3f5eecb1e60c290f
Parents: 2769771
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Jul 31 13:33:43 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 18:14:42 2015 +0300
----------------------------------------------------------------------
Allura/allura/app.py | 9 +++++++++
.../templates/jinja_master/sidebar_menu.html | 20 ++++++++++++++++++++
2 files changed, 29 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/e2c2b039/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 3aa8aad..67fff89 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -626,6 +626,15 @@ class Application(object):
return links
@LazyProperty
+ def admin_menu_collapse_button(self):
+ return SitemapEntry(
+ label='Admin',
+ url='#',
+ extra_html_attrs={
+ 'id': 'sidebar-admin-menu-trigger',
+ })
+
+ @LazyProperty
def admin_menu_delete_button(self):
anchored_tools = self.project.neighborhood.get_anchored_tools()
anchored = self.tool_label.lower() in anchored_tools.keys()
http://git-wip-us.apache.org/repos/asf/allura/blob/e2c2b039/Allura/allura/templates/jinja_master/sidebar_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/sidebar_menu.html b/Allura/allura/templates/jinja_master/sidebar_menu.html
index 9a81035..752440c 100644
--- a/Allura/allura/templates/jinja_master/sidebar_menu.html
+++ b/Allura/allura/templates/jinja_master/sidebar_menu.html
@@ -55,7 +55,26 @@
{% endif %}
{% if c.app %}
{% if h.has_access(c.app, 'admin')() %}
+ <style>
+ #sidebar-admin-menu.hide ul li:not(:first-child) {
+ display: none;
+ }
+ #sidebar-admin-menu.hide ul li:first-child {
+ border-bottom: medium none;
+ }
+ </style>
+ <div id='sidebar-admin-menu' class='hide'>
{% for s in c.app.admin_menu() %}
+ {% if loop.first %}
+ {{sidebar_item(c.app.admin_menu_collapse_button)}}
+ <script>
+ $('#sidebar-admin-menu-trigger').click(function(e) {
+ e.preventDefault();
+ $(this).parents('li').toggleClass('active');
+ $('#sidebar-admin-menu').toggleClass('hide');
+ });
+ </script>
+ {% endif %}
{{sidebar_item(s)}}
{% endfor %}
{{sidebar_item(c.app.admin_menu_delete_button)}}
@@ -64,6 +83,7 @@
{% if c.app.admin_menu_delete_button %}
{{c.app.admin_tool_delete_modal.display()}}
{% endif %}
+ </div>
{% endif %}
{% for s in c.app.sidebar_menu() %}
{{sidebar_item(s)}}
[36/50] allura git commit: [#7959] set focus to our input box
initially, as well as after errors and when proceeding to next step
Posted by je...@apache.org.
[#7959] set focus to our input box initially, as well as after errors and when proceeding to next step
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/96538161
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/96538161
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/96538161
Branch: refs/heads/ib/7922
Commit: 96538161cc5b03e24a86fedb8a9e72b40165a0c6
Parents: 4090d3b
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Aug 12 18:53:38 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 12 18:53:38 2015 +0000
----------------------------------------------------------------------
Allura/allura/public/nf/js/phone-verification.js | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/96538161/Allura/allura/public/nf/js/phone-verification.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/phone-verification.js b/Allura/allura/public/nf/js/phone-verification.js
index 4af2a9e..01792fe 100644
--- a/Allura/allura/public/nf/js/phone-verification.js
+++ b/Allura/allura/public/nf/js/phone-verification.js
@@ -48,7 +48,7 @@ function render(state) {
var FormStepMixin = {
- /*
+ /*
* Subclasses must implement:
* - getAPIUrl(): return API url this step will submit to
* - getAPIData(): returns data to submit to API url
@@ -60,11 +60,13 @@ var FormStepMixin = {
render: function() {
var input_props = {
type: 'text',
+ ref: 'mainInput',
className: grid,
value: this.props.state[this.getKey()],
disabled: this.isInputDisabled(),
onChange: this.handleChange,
- onKeyDown: this.onKeyDown
+ onKeyDown: this.onKeyDown,
+ autoFocus: true
};
var button_props = {
onClick: this.handleClick,
@@ -83,6 +85,13 @@ var FormStepMixin = {
dom('button', button_props, 'Submit')));
},
+ componentDidMount: function() {
+ React.findDOMNode(this.refs.mainInput).focus();
+ },
+ componentDidUpdate: function() {
+ React.findDOMNode(this.refs.mainInput).focus();
+ },
+
getErrorHtml: function() {
return {__html: this.props.state.error || ' '};
},
@@ -94,7 +103,7 @@ var FormStepMixin = {
getMessage: function() { return this.getHtml('message-' + this.getKey()); },
getExtraMessage: function() { return this.getHtml('message-extra'); },
-
+
handleClick: function() {
if (!this.isButtonDisabled()) {
set_state({error: null});
@@ -146,7 +155,7 @@ var FormStepMixin = {
var StepVerify = React.createClass({
mixins: [FormStepMixin],
-
+
getAPIUrl: function() { return 'verify_phone'; },
getAPIData: function() { return {'number': this.props.state[this.getKey()]}; },
getLabel: function() { return 'Enter phone number'; },
@@ -156,7 +165,7 @@ var StepVerify = React.createClass({
var StepCheck = React.createClass({
mixins: [FormStepMixin],
-
+
getAPIUrl: function() { return 'check_phone_verification'; },
getAPIData: function() { return {'pin': this.props.state[this.getKey()]}; },
getLabel: function() { return 'Enter your PIN'; },
[35/50] allura git commit: [#7925] Git tree command flags now support
older versions of git
Posted by je...@apache.org.
[#7925] Git tree command flags now support older versions of git
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/4090d3be
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/4090d3be
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/4090d3be
Branch: refs/heads/ib/7922
Commit: 4090d3be84f56fff9a4739e8d0e97eaaece7b4cb
Parents: d8e7ade
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Aug 10 13:31:52 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 13:31:52 2015 -0400
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/4090d3be/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 318f81f..480631b 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -646,8 +646,8 @@ class GitImplementation(M.RepositoryImplementation):
cmd_output = self._git.git.diff_tree(
'--no-commit-id',
- '--find-renames',
- '--find-copies',
+ '-M', # detect renames
+ '-C', # detect copies
'--name-status',
'--no-abbrev',
'--root',
[03/50] allura git commit: [#7947] use beautifulsoup4 for correct
identification of tricky tag situations during URL rewriting
Posted by je...@apache.org.
[#7947] use beautifulsoup4 for correct identification of tricky tag situations during URL rewriting
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e0e2f0c4
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e0e2f0c4
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e0e2f0c4
Branch: refs/heads/ib/7922
Commit: e0e2f0c4057a33256d59da72c73626848a1d6579
Parents: 556a99e
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Aug 3 18:45:36 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Aug 3 18:55:26 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/markdown_extensions.py | 17 ++++++-----------
Allura/allura/tests/test_globals.py | 7 +++++++
requirements.txt | 3 ++-
3 files changed, 15 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/e0e2f0c4/Allura/allura/lib/markdown_extensions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/markdown_extensions.py b/Allura/allura/lib/markdown_extensions.py
index 83e8069..cbccf5d 100644
--- a/Allura/allura/lib/markdown_extensions.py
+++ b/Allura/allura/lib/markdown_extensions.py
@@ -20,7 +20,7 @@ import logging
from urlparse import urljoin
from tg import config
-from BeautifulSoup import BeautifulSoup
+from bs4 import BeautifulSoup
import html5lib
import html5lib.serializer
import html5lib.filters.alphabeticalattributes
@@ -441,7 +441,8 @@ class RelativeLinkRewriter(markdown.postprocessors.Postprocessor):
self._make_absolute = make_absolute
def run(self, text):
- soup = BeautifulSoup(text)
+ soup = BeautifulSoup(text, 'html5lib') # 'html.parser' parser gives weird </li> behaviour with test_macro_members
+
if self._make_absolute:
rewrite = self._rewrite_abs
else:
@@ -450,15 +451,9 @@ class RelativeLinkRewriter(markdown.postprocessors.Postprocessor):
rewrite(link, 'href')
for link in soup.findAll('img'):
rewrite(link, 'src')
- # BeautifulSoup always stores data in unicode,
- # but when doing unicode(soup) it does some strange things
- # like nesting html comments, e.g. returns <!--<!-- comment -->-->
- # instead of <!-- comment -->.
- # Converting soup object to string representation first,
- # and then back to unicode avoids that.
- # str() called on BeautifulSoup document always returns string
- # encoded in utf-8, so this should always work.
- return h.really_unicode(str(soup))
+
+ # html5lib parser adds html/head/body tags, so output <body> without its own tags
+ return unicode(soup.body)[len('<body>'):-len('</body>')]
def _rewrite(self, tag, attr):
val = tag.get(attr)
http://git-wip-us.apache.org/repos/asf/allura/blob/e0e2f0c4/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index ca04652..91565ae 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -480,6 +480,13 @@ def test_markdown_invalid_tagslash():
r = g.markdown.convert('<div/onload><img src=x onerror=alert(document.cookie)>')
assert_not_in('onerror', r)
+def test_markdown_invalid_script_in_link():
+ r = g.markdown.convert('[xss](http://"><a onmouseover=prompt(document.domain)>xss</a>)')
+ assert_equal('''<div class="markdown_content"><p><a class="" href='http://"><a%20onmouseover=prompt(document.domain)>xss</a>' rel="nofollow">xss</a></p></div>''', r)
+
+def test_markdown_invalid_script_in_link2():
+ r = g.markdown.convert('[xss](http://"><img src=x onerror=alert(document.cookie)>)')
+ assert_equal('''<div class="markdown_content"><p><a class="" href='http://"><img%20src=x%20onerror=alert(document.cookie)>' rel="nofollow">xss</a></p></div>''', r)
@td.with_wiki
def test_macro_include():
http://git-wip-us.apache.org/repos/asf/allura/blob/e0e2f0c4/requirements.txt
----------------------------------------------------------------------
diff --git a/requirements.txt b/requirements.txt
index 77581e2..d327584 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,6 @@
ActivityStream==0.2.0
BeautifulSoup==3.2.0
+BeautifulSoup4==4.4.0
Beaker==1.6.4
chardet==1.0.1
colander==0.9.3
@@ -81,4 +82,4 @@ q==2.3
WebError==0.10.3
-e git://github.com/brondsem/sphinx-argparse.git#egg=sphinx-argparse # pending merge requests
sphinx-rtd-theme==0.1.6
-sphinxcontrib-programoutput==0.8
\ No newline at end of file
+sphinxcontrib-programoutput==0.8
[39/50] allura git commit: [#7922] ticket:826 Add docstrings for new
properties
Posted by je...@apache.org.
[#7922] ticket:826 Add docstrings for new properties
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e7a08f83
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e7a08f83
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e7a08f83
Branch: refs/heads/ib/7922
Commit: e7a08f835585a73507e2cef3df45f5985654f6f5
Parents: 2f7c627
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Aug 3 13:46:11 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 18:14:42 2015 +0300
----------------------------------------------------------------------
Allura/allura/app.py | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/e7a08f83/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 67fff89..f060204 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -293,10 +293,12 @@ class Application(object):
@LazyProperty
def admin_modal(self):
+ """Returns modal dialog widget for app's admin options"""
return admin_widgets.AdminModal()
@LazyProperty
def admin_tool_delete_modal(self):
+ """Returns modal dialog widget for app's delete workflow"""
return admin_widgets.AdminToolDeleteModal()
@LazyProperty
@@ -627,6 +629,7 @@ class Application(object):
@LazyProperty
def admin_menu_collapse_button(self):
+ """Returns button for showing/hiding admin sidebar menu"""
return SitemapEntry(
label='Admin',
url='#',
@@ -636,6 +639,7 @@ class Application(object):
@LazyProperty
def admin_menu_delete_button(self):
+ """Returns button for deleting an app if app can be deleted"""
anchored_tools = self.project.neighborhood.get_anchored_tools()
anchored = self.tool_label.lower() in anchored_tools.keys()
if self.uninstallable and not anchored:
[22/50] allura git commit: [#7925] fix looping/delete bug
Posted by je...@apache.org.
[#7925] fix looping/delete bug
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/787ee906
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/787ee906
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/787ee906
Branch: refs/heads/ib/7922
Commit: 787ee906ab185dcee0193bd412b5cc4bab252cbd
Parents: 155e0b0
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Jul 31 16:10:38 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:36 2015 -0400
----------------------------------------------------------------------
ForgeSVN/forgesvn/model/svn.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/787ee906/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index f43f536..b9d986e 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -817,8 +817,8 @@ class SVNImplementation(M.RepositoryImplementation):
# svn commit -m "Replace aaa.txt"
result['changed'].append(h.really_unicode(p.path))
- for r in result['copied']:
- if r['old'] in result['removed'][:]:
+ for r in result['copied'][:]:
+ if r['old'] in result['removed']:
result['removed'].remove(r['old'])
result['copied'].remove(r)
result['renamed'].append(r)
[46/50] allura git commit: [#7922] ticket:834 Show tool label in
admin menu header
Posted by je...@apache.org.
[#7922] ticket:834 Show tool label in admin menu header
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e4b92c7c
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e4b92c7c
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e4b92c7c
Branch: refs/heads/ib/7922
Commit: e4b92c7cabcb01c5c75688c06ee36af63e0d3ae4
Parents: d8de171
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Aug 13 18:41:12 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 18:41:12 2015 +0300
----------------------------------------------------------------------
Allura/allura/app.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/e4b92c7c/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 28ff19e..2379767 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -631,7 +631,7 @@ class Application(object):
def admin_menu_collapse_button(self):
"""Returns button for showing/hiding admin sidebar menu"""
return SitemapEntry(
- label='Admin',
+ label=u'Admin - {}'.format(self.config.options.mount_label),
extra_html_attrs={
'id': 'sidebar-admin-menu-trigger',
})
[32/50] allura git commit: [#7925] use frozensets for faster O(1)
checking of file extensions
Posted by je...@apache.org.
[#7925] use frozensets for faster O(1) checking of file extensions
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/d8e7ade5
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d8e7ade5
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d8e7ade5
Branch: refs/heads/ib/7922
Commit: d8e7ade5d7ec8fa35d09b4d2cb2a4ee2aa54bb29
Parents: 46baba1
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Aug 7 18:04:45 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:38 2015 -0400
----------------------------------------------------------------------
Allura/allura/model/repository.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/d8e7ade5/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index acbc3d1..77c3fc4 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -65,10 +65,10 @@ config = utils.ConfigProxy(
common_prefix='forgemail.url')
README_RE = re.compile('^README(\.[^.]*)?$', re.IGNORECASE)
-VIEWABLE_EXTENSIONS = [
+VIEWABLE_EXTENSIONS = frozenset([
'.php', '.py', '.js', '.java', '.html', '.htm', '.yaml', '.sh',
'.rb', '.phtml', '.txt', '.bat', '.ps1', '.xhtml', '.css', '.cfm', '.jsp', '.jspx',
- '.pl', '.php4', '.php3', '.rhtml', '.svg', '.markdown', '.json', '.ini', '.tcl', '.vbs', '.xsl']
+ '.pl', '.php4', '.php3', '.rhtml', '.svg', '.markdown', '.json', '.ini', '.tcl', '.vbs', '.xsl'])
# Some schema types
@@ -77,7 +77,7 @@ SObjType = S.OneOf('blob', 'tree', 'submodule')
# Used for when we're going to batch queries using $in
QSIZE = 100
-BINARY_EXTENSIONS = [
+BINARY_EXTENSIONS = frozenset([
".3ds", ".3g2", ".3gp", ".7z", ".a", ".aac", ".adp", ".ai", ".aif", ".apk", ".ar", ".asf", ".au", ".avi",
".bak", ".bin", ".bk", ".bmp", ".btif", ".bz2", ".cab", ".caf", ".cgm", ".cmx", ".cpio", ".cr2", ".dat", ".deb", ".djvu", ".dll",
".dmg", ".dng", ".doc", ".docx", ".dra", ".DS_Store", ".dsk", ".dts", ".dtshd", ".dvb", ".dwg", ".dxf", ".ecelp4800",
@@ -90,9 +90,9 @@ BINARY_EXTENSIONS = [
".smv", ".so", ".sub", ".swf", ".tar", ".tbz2", ".tga", ".tgz", ".tif", ".tiff", ".tlz", ".ts", ".ttf", ".uvh", ".uvi", ".uvm",
".uvp", ".uvs", ".uvu", ".viv", ".vob", ".war", ".wav", ".wax", ".wbmp", ".wdp", ".weba", ".webm", ".webp", ".whl", ".wm", ".wma",
".wmv", ".wmx", ".woff", ".woff2", ".wvx", ".xbm", ".xif", ".xm", ".xpi", ".xpm", ".xwd", ".xz", ".z", ".zip", ".zipx"
-]
+])
-PYPELINE_EXTENSIONS = utils.MARKDOWN_EXTENSIONS + ['.rst']
+PYPELINE_EXTENSIONS = frozenset(utils.MARKDOWN_EXTENSIONS + ['.rst'])
DIFF_SIMILARITY_THRESHOLD = .5 # used for determining file renames
[34/50] allura git commit: [#7925] join split lines into one again.
We're ok >79 chars
Posted by je...@apache.org.
[#7925] join split lines into one again. We're ok >79 chars
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5ac9651f
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5ac9651f
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5ac9651f
Branch: refs/heads/ib/7922
Commit: 5ac9651fa789d9fbf762a08375145b0d622acc2b
Parents: 9639112
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Tue Aug 4 20:32:26 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:38 2015 -0400
----------------------------------------------------------------------
Allura/allura/tests/model/test_repo.py | 121 +++++++++-------------------
1 file changed, 39 insertions(+), 82 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/5ac9651f/Allura/allura/tests/model/test_repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_repo.py b/Allura/allura/tests/model/test_repo.py
index c0a6bc8..9b364aa 100644
--- a/Allura/allura/tests/model/test_repo.py
+++ b/Allura/allura/tests/model/test_repo.py
@@ -32,7 +32,6 @@ from allura.lib import helpers as h
class TestGitLikeTree(object):
-
def test_set_blob(self):
tree = M.GitLikeTree()
tree.set_blob('/dir/dir2/file', 'file-oid')
@@ -63,7 +62,6 @@ class TestGitLikeTree(object):
class RepoImplTestBase(object):
-
def test_commit_run(self):
M.repository.CommitRunDoc.m.remove()
commit_ids = list(self.repo.all_commit_ids())
@@ -100,7 +98,6 @@ class RepoImplTestBase(object):
class RepoTestBase(unittest.TestCase):
-
def setUp(self):
setup_basic_test()
@@ -131,7 +128,6 @@ class RepoTestBase(unittest.TestCase):
class TestLastCommit(unittest.TestCase):
-
def setUp(self):
setup_basic_test()
setup_global_objects()
@@ -168,6 +164,7 @@ class TestLastCommit(unittest.TestCase):
m = mock.Mock()
m.name = p
return m
+
for p in tree_paths:
if '/' in p:
node, sub = p.split('/', 1)
@@ -222,8 +219,7 @@ class TestLastCommit(unittest.TestCase):
'dir1/file2',
])
lcd = M.repository.LastCommit.get(commit1.tree)
- self.assertEqual(
- self.repo._commits[lcd.commit_id].message, commit1.message)
+ self.assertEqual(self.repo._commits[lcd.commit_id].message, commit1.message)
self.assertEqual(lcd.path, '')
self.assertEqual(len(lcd.entries), 2)
self.assertEqual(lcd.by_name['file1'], commit1._id)
@@ -231,13 +227,10 @@ class TestLastCommit(unittest.TestCase):
def test_multiple_commits_no_overlap(self):
commit1 = self._add_commit('Commit 1', ['file1'])
- commit2 = self._add_commit(
- 'Commit 2', ['file1', 'dir1/file1'], ['dir1/file1'], [commit1])
- commit3 = self._add_commit(
- 'Commit 3', ['file1', 'dir1/file1', 'file2'], ['file2'], [commit2])
+ commit2 = self._add_commit('Commit 2', ['file1', 'dir1/file1'], ['dir1/file1'], [commit1])
+ commit3 = self._add_commit('Commit 3', ['file1', 'dir1/file1', 'file2'], ['file2'], [commit2])
lcd = M.repository.LastCommit.get(commit3.tree)
- self.assertEqual(
- self.repo._commits[lcd.commit_id].message, commit3.message)
+ self.assertEqual(self.repo._commits[lcd.commit_id].message, commit3.message)
self.assertEqual(lcd.commit_id, commit3._id)
self.assertEqual(lcd.path, '')
self.assertEqual(len(lcd.entries), 3)
@@ -247,13 +240,10 @@ class TestLastCommit(unittest.TestCase):
def test_multiple_commits_with_overlap(self):
commit1 = self._add_commit('Commit 1', ['file1'])
- commit2 = self._add_commit(
- 'Commit 2', ['file1', 'dir1/file1'], ['dir1/file1'], [commit1])
- commit3 = self._add_commit(
- 'Commit 3', ['file1', 'dir1/file1', 'file2'], ['file1', 'file2'], [commit2])
+ commit2 = self._add_commit('Commit 2', ['file1', 'dir1/file1'], ['dir1/file1'], [commit1])
+ commit3 = self._add_commit('Commit 3', ['file1', 'dir1/file1', 'file2'], ['file1', 'file2'], [commit2])
lcd = M.repository.LastCommit.get(commit3.tree)
- self.assertEqual(
- self.repo._commits[lcd.commit_id].message, commit3.message)
+ self.assertEqual(self.repo._commits[lcd.commit_id].message, commit3.message)
self.assertEqual(lcd.path, '')
self.assertEqual(len(lcd.entries), 3)
self.assertEqual(lcd.by_name['file1'], commit3._id)
@@ -262,13 +252,10 @@ class TestLastCommit(unittest.TestCase):
def test_multiple_commits_subdir_change(self):
commit1 = self._add_commit('Commit 1', ['file1', 'dir1/file1'])
- commit2 = self._add_commit(
- 'Commit 2', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file2'], [commit1])
- commit3 = self._add_commit(
- 'Commit 3', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file1'], [commit2])
+ commit2 = self._add_commit('Commit 2', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file2'], [commit1])
+ commit3 = self._add_commit('Commit 3', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file1'], [commit2])
lcd = M.repository.LastCommit.get(commit3.tree)
- self.assertEqual(
- self.repo._commits[lcd.commit_id].message, commit3.message)
+ self.assertEqual(self.repo._commits[lcd.commit_id].message, commit3.message)
self.assertEqual(lcd.path, '')
self.assertEqual(len(lcd.entries), 2)
self.assertEqual(lcd.by_name['file1'], commit1._id)
@@ -276,14 +263,11 @@ class TestLastCommit(unittest.TestCase):
def test_subdir_lcd(self):
commit1 = self._add_commit('Commit 1', ['file1', 'dir1/file1'])
- commit2 = self._add_commit(
- 'Commit 2', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file2'], [commit1])
- commit3 = self._add_commit(
- 'Commit 3', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file1'], [commit2])
+ commit2 = self._add_commit('Commit 2', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file2'], [commit1])
+ commit3 = self._add_commit('Commit 3', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file1'], [commit2])
tree = self._build_tree(commit3, '/dir1', ['file1', 'file2'])
lcd = M.repository.LastCommit.get(tree)
- self.assertEqual(
- self.repo._commits[lcd.commit_id].message, commit3.message)
+ self.assertEqual(self.repo._commits[lcd.commit_id].message, commit3.message)
self.assertEqual(lcd.path, 'dir1')
self.assertEqual(len(lcd.entries), 2)
self.assertEqual(lcd.by_name['file1'], commit3._id)
@@ -291,16 +275,12 @@ class TestLastCommit(unittest.TestCase):
def test_subdir_lcd_prev_commit(self):
commit1 = self._add_commit('Commit 1', ['file1', 'dir1/file1'])
- commit2 = self._add_commit(
- 'Commit 2', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file2'], [commit1])
- commit3 = self._add_commit(
- 'Commit 3', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file1'], [commit2])
- commit4 = self._add_commit(
- 'Commit 4', ['file1', 'dir1/file1', 'dir1/file2', 'file2'], ['file2'], [commit3])
+ commit2 = self._add_commit('Commit 2', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file2'], [commit1])
+ commit3 = self._add_commit('Commit 3', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file1'], [commit2])
+ commit4 = self._add_commit('Commit 4', ['file1', 'dir1/file1', 'dir1/file2', 'file2'], ['file2'], [commit3])
tree = self._build_tree(commit4, '/dir1', ['file1', 'file2'])
lcd = M.repository.LastCommit.get(tree)
- self.assertEqual(
- self.repo._commits[lcd.commit_id].message, commit3.message)
+ self.assertEqual(self.repo._commits[lcd.commit_id].message, commit3.message)
self.assertEqual(lcd.path, 'dir1')
self.assertEqual(len(lcd.entries), 2)
self.assertEqual(lcd.by_name['file1'], commit3._id)
@@ -308,32 +288,26 @@ class TestLastCommit(unittest.TestCase):
def test_subdir_lcd_always_empty(self):
commit1 = self._add_commit('Commit 1', ['file1', 'dir1'])
- commit2 = self._add_commit(
- 'Commit 2', ['file1', 'file2'], ['file2'], [commit1])
+ commit2 = self._add_commit('Commit 2', ['file1', 'file2'], ['file2'], [commit1])
tree = self._build_tree(commit2, '/dir1', [])
lcd = M.repository.LastCommit.get(tree)
- self.assertEqual(
- self.repo._commits[lcd.commit_id].message, commit1.message)
+ self.assertEqual(self.repo._commits[lcd.commit_id].message, commit1.message)
self.assertEqual(lcd.path, 'dir1')
self.assertEqual(lcd.entries, [])
def test_subdir_lcd_emptied(self):
commit1 = self._add_commit('Commit 1', ['file1', 'dir1/file1'])
- commit2 = self._add_commit(
- 'Commit 2', ['file1'], ['dir1/file1'], [commit1])
+ commit2 = self._add_commit('Commit 2', ['file1'], ['dir1/file1'], [commit1])
tree = self._build_tree(commit2, '/dir1', [])
lcd = M.repository.LastCommit.get(tree)
- self.assertEqual(
- self.repo._commits[lcd.commit_id].message, commit2.message)
+ self.assertEqual(self.repo._commits[lcd.commit_id].message, commit2.message)
self.assertEqual(lcd.path, 'dir1')
self.assertEqual(lcd.entries, [])
def test_existing_lcd_unchained(self):
commit1 = self._add_commit('Commit 1', ['file1', 'dir1/file1'])
- commit2 = self._add_commit(
- 'Commit 2', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file2'], [commit1])
- commit3 = self._add_commit(
- 'Commit 3', ['file1', 'dir1/file1', 'dir1/file2'], ['file1'], [commit2])
+ commit2 = self._add_commit('Commit 2', ['file1', 'dir1/file1', 'dir1/file2'], ['dir1/file2'], [commit1])
+ commit3 = self._add_commit('Commit 3', ['file1', 'dir1/file1', 'dir1/file2'], ['file1'], [commit2])
prev_lcd = M.repository.LastCommit(
path='dir1',
commit_id=commit2._id,
@@ -350,19 +324,15 @@ class TestLastCommit(unittest.TestCase):
tree = self._build_tree(commit3, '/dir1', ['file1', 'file2'])
lcd = M.repository.LastCommit.get(tree)
self.assertEqual(lcd._id, prev_lcd._id)
- self.assertEqual(
- self.repo._commits[lcd.commit_id].message, commit2.message)
+ self.assertEqual(self.repo._commits[lcd.commit_id].message, commit2.message)
self.assertEqual(lcd.path, 'dir1')
self.assertEqual(lcd.entries, prev_lcd.entries)
def test_existing_lcd_partial(self):
commit1 = self._add_commit('Commit 1', ['file1'])
- commit2 = self._add_commit(
- 'Commit 2', ['file1', 'file2'], ['file2'], [commit1])
- commit3 = self._add_commit(
- 'Commit 3', ['file1', 'file2', 'file3'], ['file3'], [commit2])
- commit4 = self._add_commit(
- 'Commit 4', ['file1', 'file2', 'file3', 'file4'], ['file2', 'file4'], [commit3])
+ commit2 = self._add_commit('Commit 2', ['file1', 'file2'], ['file2'], [commit1])
+ commit3 = self._add_commit('Commit 3', ['file1', 'file2', 'file3'], ['file3'], [commit2])
+ commit4 = self._add_commit('Commit 4', ['file1', 'file2', 'file3', 'file4'], ['file2', 'file4'], [commit3])
prev_lcd = M.repository.LastCommit(
path='',
commit_id=commit3._id,
@@ -380,8 +350,7 @@ class TestLastCommit(unittest.TestCase):
)
session(prev_lcd).flush()
lcd = M.repository.LastCommit.get(commit4.tree)
- self.assertEqual(
- self.repo._commits[lcd.commit_id].message, commit4.message)
+ self.assertEqual(self.repo._commits[lcd.commit_id].message, commit4.message)
self.assertEqual(lcd.path, '')
self.assertEqual(len(lcd.entries), 4)
self.assertEqual(lcd.by_name['file1'], commit1._id)
@@ -404,14 +373,11 @@ class TestLastCommit(unittest.TestCase):
def test_timeout(self):
commit1 = self._add_commit('Commit 1', ['file1'])
- commit2 = self._add_commit(
- 'Commit 2', ['file1', 'dir1/file1'], ['dir1/file1'], [commit1])
- commit3 = self._add_commit(
- 'Commit 3', ['file1', 'dir1/file1', 'file2'], ['file2'], [commit2])
+ commit2 = self._add_commit('Commit 2', ['file1', 'dir1/file1'], ['dir1/file1'], [commit1])
+ commit3 = self._add_commit('Commit 3', ['file1', 'dir1/file1', 'file2'], ['file2'], [commit2])
with h.push_config(config, lcd_timeout=-1000):
lcd = M.repository.LastCommit.get(commit3.tree)
- self.assertEqual(
- self.repo._commits[lcd.commit_id].message, commit3.message)
+ self.assertEqual(self.repo._commits[lcd.commit_id].message, commit3.message)
self.assertEqual(lcd.commit_id, commit3._id)
self.assertEqual(lcd.path, '')
self.assertEqual(len(lcd.entries), 1)
@@ -419,15 +385,12 @@ class TestLastCommit(unittest.TestCase):
def test_loop(self):
commit1 = self._add_commit('Commit 1', ['file1'])
- commit2 = self._add_commit(
- 'Commit 2', ['file1', 'dir1/file1'], ['dir1/file1'], [commit1])
- commit3 = self._add_commit(
- 'Commit 3', ['file1', 'dir1/file1', 'file2'], ['file2'], [commit2])
+ commit2 = self._add_commit('Commit 2', ['file1', 'dir1/file1'], ['dir1/file1'], [commit1])
+ commit3 = self._add_commit('Commit 3', ['file1', 'dir1/file1', 'file2'], ['file2'], [commit2])
commit2.parent_ids = [commit3._id]
session(commit2).flush(commit2)
lcd = M.repository.LastCommit.get(commit3.tree)
- self.assertEqual(
- self.repo._commits[lcd.commit_id].message, commit3.message)
+ self.assertEqual(self.repo._commits[lcd.commit_id].message, commit3.message)
self.assertEqual(lcd.commit_id, commit3._id)
self.assertEqual(lcd.path, '')
self.assertEqual(len(lcd.entries), 3)
@@ -436,7 +399,6 @@ class TestLastCommit(unittest.TestCase):
class TestModelCache(unittest.TestCase):
-
def setUp(self):
self.cache = M.repository.ModelCache()
@@ -510,15 +472,11 @@ class TestModelCache(unittest.TestCase):
self.assertEqual(self.cache._instance_cache,
{M.repository.Tree: {'OBJID': tree}})
tree._id = '_id'
- self.assertEqual(
- self.cache.get(M.repository.Tree, {'val1': 'test_set1'}), tree)
- self.assertEqual(
- self.cache.get(M.repository.Tree, {'val2': 'test_set2'}), tree)
+ self.assertEqual(self.cache.get(M.repository.Tree, {'val1': 'test_set1'}), tree)
+ self.assertEqual(self.cache.get(M.repository.Tree, {'val2': 'test_set2'}), tree)
self.cache.set(M.repository.Tree, {'val1': 'test_set2'}, tree)
- self.assertEqual(
- self.cache.get(M.repository.Tree, {'val1': 'test_set1'}), tree)
- self.assertEqual(
- self.cache.get(M.repository.Tree, {'val2': 'test_set2'}), tree)
+ self.assertEqual(self.cache.get(M.repository.Tree, {'val1': 'test_set1'}), tree)
+ self.assertEqual(self.cache.get(M.repository.Tree, {'val2': 'test_set2'}), tree)
@mock.patch('bson.ObjectId')
def test_set_none_val(self, obj_id):
@@ -727,7 +685,6 @@ class TestModelCache(unittest.TestCase):
class TestMergeRequest(object):
-
def setUp(self):
setup_basic_test()
setup_global_objects()
[16/50] allura git commit: bump up run_tests multiprocessing timeout
Posted by je...@apache.org.
bump up run_tests multiprocessing timeout
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/032c2ed8
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/032c2ed8
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/032c2ed8
Branch: refs/heads/ib/7922
Commit: 032c2ed88e4882bc4018f8632b9a3f8d5239b8f4
Parents: 8a226bd
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Aug 7 19:50:26 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Aug 7 19:50:26 2015 +0000
----------------------------------------------------------------------
run_tests | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/032c2ed8/run_tests
----------------------------------------------------------------------
diff --git a/run_tests b/run_tests
index c91362c..4640244 100755
--- a/run_tests
+++ b/run_tests
@@ -30,7 +30,7 @@ import textwrap
CPUS = multiprocessing.cpu_count()
CONCURRENT_SUITES = (CPUS // 4) or CPUS
CONCURRENT_TESTS = max(CPUS // CONCURRENT_SUITES, 2) # need at least two, see thread http://mail-archives.apache.org/mod_mbox/allura-dev/201409.mbox/%3C541C5756.1020604%40brondsema.net%3E
-PROC_TIMEOUT = 180
+PROC_TIMEOUT = 360
ALT_PKG_PATHS = {
'Allura': 'allura/tests/',
[44/50] allura git commit: [#7922] ticket:826 Add tests for sitebar
admin menu
Posted by je...@apache.org.
[#7922] ticket:826 Add tests for sitebar admin menu
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/2f7c6273
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/2f7c6273
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/2f7c6273
Branch: refs/heads/ib/7922
Commit: 2f7c6273bac4bb74e743bf3757ca62592c3ebf05
Parents: a27de2b
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Aug 3 13:37:56 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 18:14:42 2015 +0300
----------------------------------------------------------------------
ForgeWiki/forgewiki/tests/functional/test_root.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/2f7c6273/ForgeWiki/forgewiki/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/functional/test_root.py b/ForgeWiki/forgewiki/tests/functional/test_root.py
index 276c4b9..e2604bc 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_root.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_root.py
@@ -819,3 +819,20 @@ class TestRootController(TestController):
'Page creation rate limit exceeded. Please try again later.')
p = model.Page.query.get(title='page2')
assert_equal(p, None)
+
+ def test_sidebar_admin_menu(self):
+ r = self.app.get('/p/test/wiki/Home/')
+ menu = r.html.find('div', {'id': 'sidebar-admin-menu'})
+ menu = [li.find('span').getText() for li in menu.findAll('li')]
+ assert_equal(
+ menu,
+ ['Admin', 'Set Home', 'Permissions', 'Options', 'Label', 'Delete'])
+
+ def test_sidebar_admin_menu_invisible_to_not_admin(self):
+ def assert_invisible_for(username):
+ env = {'username': username}
+ r = self.app.get('/p/test/wiki/Home/', extra_environ=env)
+ menu = r.html.find('div', {'id': 'sidebar-admin-menu'})
+ assert_equal(menu, None)
+ assert_invisible_for('*anonymous')
+ assert_invisible_for('test-user')
[40/50] allura git commit: [#7922] Add "admin" section to the left
sidebar
Posted by je...@apache.org.
[#7922] Add "admin" section to the left sidebar
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/ef7125cc
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/ef7125cc
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/ef7125cc
Branch: refs/heads/ib/7922
Commit: ef7125cc112d9afb9700a56c80ca74646d26d89c
Parents: 2f144a9
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Jul 29 19:25:49 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 18:14:42 2015 +0300
----------------------------------------------------------------------
Allura/allura/app.py | 22 +++++++++
Allura/allura/ext/admin/admin_main.py | 5 ++-
.../ext/admin/templates/project_tools.html | 44 ++++--------------
Allura/allura/lib/widgets/admin_widgets.py | 47 ++++++++++++++++++++
.../lib/widgets/resources/js/admin_modal.js | 34 ++++++++++++++
.../resources/js/admin_tool_delete_modal.js | 40 +++++++++++++++++
Allura/allura/public/nf/js/project_tools.js | 39 ----------------
.../templates/jinja_master/sidebar_menu.html | 11 +++++
.../widgets/admin_tool_delete_modal.html | 34 ++++++++++++++
9 files changed, 199 insertions(+), 77 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/ef7125cc/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 62b82fe..3aa8aad 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -44,6 +44,7 @@ from allura import model
from allura.controllers import BaseController
from allura.lib.decorators import require_post, memoize
from allura.lib.utils import permanent_redirect, ConfigProxy
+from allura.lib.widgets import admin_widgets
from allura import model as M
log = logging.getLogger(__name__)
@@ -291,6 +292,14 @@ class Application(object):
self.admin = DefaultAdminController(self)
@LazyProperty
+ def admin_modal(self):
+ return admin_widgets.AdminModal()
+
+ @LazyProperty
+ def admin_tool_delete_modal(self):
+ return admin_widgets.AdminToolDeleteModal()
+
+ @LazyProperty
def sitemap(self):
"""Return a list of :class:`SitemapEntries <allura.app.SitemapEntry>`
describing the page hierarchy provided by this Application.
@@ -616,6 +625,19 @@ class Application(object):
links.append(SitemapEntry('Webhooks', admin_url + 'webhooks'))
return links
+ @LazyProperty
+ def admin_menu_delete_button(self):
+ anchored_tools = self.project.neighborhood.get_anchored_tools()
+ anchored = self.tool_label.lower() in anchored_tools.keys()
+ if self.uninstallable and not anchored:
+ return SitemapEntry(
+ label='Delete',
+ url='#',
+ className='admin_tool_delete_modal',
+ extra_html_attrs={
+ 'data-mount-point': self.config.options.mount_point,
+ })
+
def handle_message(self, topic, message):
"""Handle incoming email msgs addressed to this tool.
Default is a no-op.
http://git-wip-us.apache.org/repos/asf/allura/blob/ef7125cc/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index ec61edb..dcda9be 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -44,6 +44,7 @@ from allura.controllers import BaseController
from allura.lib.decorators import require_post
from allura.tasks import export_tasks
from allura.lib.widgets.project_list import ProjectScreenshots
+from allura.lib.widgets import admin_widgets
from . import widgets as aw
@@ -54,8 +55,8 @@ log = logging.getLogger(__name__)
class W:
markdown_editor = ffw.MarkdownEdit()
label_edit = ffw.LabelEdit()
- mount_delete = ffw.Lightbox(name='mount_delete', trigger='a.mount_delete')
- admin_modal = ffw.Lightbox(name='admin_modal', trigger='a.admin_modal')
+ admin_modal = admin_widgets.AdminModal()
+ mount_delete = admin_widgets.AdminToolDeleteModal()
install_modal = ffw.Lightbox(
name='install_modal', trigger='a.install_trig')
explain_export_modal = ffw.Lightbox(
http://git-wip-us.apache.org/repos/asf/allura/blob/ef7125cc/Allura/allura/ext/admin/templates/project_tools.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/project_tools.html b/Allura/allura/ext/admin/templates/project_tools.html
index 38705ed..c9eab4a 100644
--- a/Allura/allura/ext/admin/templates/project_tools.html
+++ b/Allura/allura/ext/admin/templates/project_tools.html
@@ -17,6 +17,7 @@
under the License.
-#}
{% extends g.theme.master %}
+{% from 'allura:templates/jinja_master/sidebar_menu.html' import sidebar_item with context %}
{% do g.register_forge_css('css/forge/deck.css') %}
{% do g.register_forge_js('js/project_tools.js', location='body_js_tail') %}
@@ -87,24 +88,9 @@
<img src="{{ g.theme.app_icon_url(app, 48) }}" alt="">
</li>
{% for link in links %}
- <li>
- <a href="{{ link.url }}" class="{{ link.className }}">{{ link.label }}</a>
- </li>
+ {{sidebar_item(link)}}
{% endfor %}
- {% if app.uninstallable and not (app.tool_label.lower() in app.project.neighborhood.get_anchored_tools().keys()) %}
- <li>
- <form method="post" action="update_mounts" id="mounts_edit_2-{{loop.index0}}">
- <input type="hidden" class="mount_point"
- name="tool-{{loop.index0}}.mount_point"
- value="{{mount['ac'].options.mount_point}}"/>
- <input name="tool-{{loop.index0}}.delete" type="hidden" value="Delete"/>
- {% if mount['ac'].load().uninstallable %}
- <a href="#" class="mount_delete" data-mount-point="{{ mount['ac'].options.mount_point }}">Delete</a>
- {% endif %}
- {{lib.csrf_token()}}
- </form>
- </li>
- {% endif %}
+ {{sidebar_item(app.admin_menu_delete_button)}}
</ul>
{% if not app.uninstallable %}
<input type="hidden" class="mount_point" value="{{mount['ac'].options.mount_point}}"/>
@@ -119,14 +105,9 @@
<img src="{{ g.theme.app_icon_url('subproject', 48) }}" alt="">
</li>
<li>
- <form method="post" action="update_mounts" id="mounts_edit_2-{{loop.index0}}">
- <input type="hidden" class="shortname"
- name="subproject-{{loop.index0}}.shortname"
- value="{{mount['sub'].shortname}}"/>
- <input name="subproject-{{loop.index0}}.delete" type="hidden" value="Delete"/>
- <a href="#" class="mount_delete" data-mount-point="{{ mount['sub'].shortname }}">Delete</a>
- {{lib.csrf_token()}}
- </form>
+ <a href="#" data-mount-point="{{ mount['sub'].shortname }}" class="admin_tool_delete_modal">
+ <span>Delete</span>
+ </a>
</li>
</ul>
</div>
@@ -137,17 +118,8 @@
<div style="clear:both">
{{c.page_list.display(page=page, limit=limit, count=total_mounts)}}
</div>
-<form id="mount_delete_form" style="display:none">
- <div class="grid-13 warning_msg">Warning: This will destroy all data in this tool and is irreversible!</div>
- <div class="grid-13"> </div>
- <hr>
- <div class="grid-13"> </div>
- <div class="grid-13">
- <input type="button" value="Delete" class="continue_delete"> <input type="button" value="Cancel" class="cancel_delete close">
- </div>
-</form>
-{{c.admin_modal.display(content='<h1 id="popup_title"></h1><div id="popup_contents"></div>')}}
-{{c.mount_delete.display(content='<h1>Confirm Delete</h1>')}}
+{{c.admin_modal.display()}}
+{{c.mount_delete.display()}}
<div><!--dummy-->
<h3 style="clear:left">Grouping</h3>
http://git-wip-us.apache.org/repos/asf/allura/blob/ef7125cc/Allura/allura/lib/widgets/admin_widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/admin_widgets.py b/Allura/allura/lib/widgets/admin_widgets.py
new file mode 100644
index 0000000..249962e
--- /dev/null
+++ b/Allura/allura/lib/widgets/admin_widgets.py
@@ -0,0 +1,47 @@
+# 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
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import ew.jinja2_ew as ew
+
+from allura.lib.widgets import form_fields as ffw
+
+
+class AdminModal(ffw.Lightbox):
+ defaults = dict(
+ ffw.Lightbox.defaults,
+ name='admin_modal',
+ trigger='a.admin_modal',
+ content='<h1 id="admin_modal_title"></h1>'
+ '<div id="admin_modal_contents"></div>')
+
+ def resources(self):
+ for r in super(AdminModal, self).resources():
+ yield r
+ yield ew.JSLink('js/admin_modal.js')
+
+
+class AdminToolDeleteModal(ffw.Lightbox):
+ defaults = dict(
+ ffw.Lightbox.defaults,
+ name='admin_tool_delete_modal',
+ trigger='a.admin_tool_delete_modal',
+ content_template='allura:templates/widgets/admin_tool_delete_modal.html')
+
+ def resources(self):
+ for r in super(AdminToolDeleteModal, self).resources():
+ yield r
+ yield ew.JSLink('js/admin_tool_delete_modal.js')
http://git-wip-us.apache.org/repos/asf/allura/blob/ef7125cc/Allura/allura/lib/widgets/resources/js/admin_modal.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/admin_modal.js b/Allura/allura/lib/widgets/resources/js/admin_modal.js
new file mode 100644
index 0000000..41a5264
--- /dev/null
+++ b/Allura/allura/lib/widgets/resources/js/admin_modal.js
@@ -0,0 +1,34 @@
+/*
+ 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
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+$(function() {
+ var cval = $.cookie('_session_id');
+ var csrf_input = $('<input name="_session_id" type="hidden" value="'+cval+'">');
+ var $popup_title = $('#admin_modal_title');
+ var $popup_contents = $('#admin_modal_contents');
+ $('a.admin_modal').click(function () {
+ var link = this;
+ $popup_title.html('');
+ $popup_contents.html('Loading...');
+ $.get(link.href, function (data) {
+ $popup_title.html($(link).html());
+ $popup_contents.html(data);
+ $popup_contents.find('form').append(csrf_input);
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/allura/blob/ef7125cc/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js b/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js
new file mode 100644
index 0000000..3d41261
--- /dev/null
+++ b/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js
@@ -0,0 +1,40 @@
+/*
+ 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
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+$(function() {
+ var $form = $('#admin-tool-delete-modal-form');
+ $('a.admin_tool_delete_modal').click(function() {
+ var mount_point = $(this).data('mount-point');
+ $form.find('.mount_point').val(mount_point);
+ var tool_label = 'this';
+ if (mount_point) {
+ tool_label = 'the "' + mount_point + '"';
+ }
+ var msg = 'Warning: This will destroy all data in ';
+ msg += tool_label;
+ msg += ' tool and is irreversible!';
+ $form.find('.warning-msg').text(msg);
+ });
+ $form.find('.delete-tool').click(function() {
+ if ($form.find('.mount_point').val()) {
+ $form.submit();
+ } else {
+ console.log('Do not know which tool to delete!');
+ }
+ });
+});
http://git-wip-us.apache.org/repos/asf/allura/blob/ef7125cc/Allura/allura/public/nf/js/project_tools.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/project_tools.js b/Allura/allura/public/nf/js/project_tools.js
index a690937..c235f05 100644
--- a/Allura/allura/public/nf/js/project_tools.js
+++ b/Allura/allura/public/nf/js/project_tools.js
@@ -18,9 +18,6 @@
*/
(function() {
- // Provide CSRF protection
- var cval = $.cookie('_session_id');
- var csrf_input = $('<input name="_session_id" type="hidden" value="'+cval+'">');
// Install popup
var install_popup = $('#lightbox_install_modal');
var install_form = $('#install_form');
@@ -50,42 +47,6 @@
new_mount_label.val('');
}
});
- // Edit popup
- var $popup_title = $('#popup_title');
- var $popup_contents = $('#popup_contents');
- $('a.admin_modal').click(function () {
- var link = this;
- $popup_title.html('');
- $popup_contents.html('Loading...');
- $.get(link.href, function (data) {
- $popup_title.html($(link).html());
- $popup_contents.html(data);
- $popup_contents.find('form').append(csrf_input);
- });
- });
- // delete popup
- var form_to_delete = null;
- var mount_delete_popup = $('#lightbox_mount_delete');
- var mount_delete_form = $('#mount_delete_form');
- mount_delete_popup.append(mount_delete_form.show());
- mount_delete_form.find('.continue_delete').click(function () {
- form_to_delete.submit();
- form_to_delete = null;
- });
- mount_delete_form.find('.cancel_delete').click(function () {
- form_to_delete = null;
- });
- $('a.mount_delete').click(function () {
- var tool_label = 'this';
- var mount_point = $(this).data('mount-point');
- if (mount_point) {
- tool_label = 'the "' + mount_point + '"';
- }
- $('div.warning_msg').text('Warning: This will destroy all data in ' + tool_label + ' tool and is irreversible!');
-
- form_to_delete = this.parentNode;
- return false;
- });
// sorting
$('#sortable').sortable({items: ".fleft:not(.isnt_sorted)"}).bind( "sortupdate", function (e) {
var sortables = $('#sortable .fleft');
http://git-wip-us.apache.org/repos/asf/allura/blob/ef7125cc/Allura/allura/templates/jinja_master/sidebar_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/sidebar_menu.html b/Allura/allura/templates/jinja_master/sidebar_menu.html
index b51a15b..9a81035 100644
--- a/Allura/allura/templates/jinja_master/sidebar_menu.html
+++ b/Allura/allura/templates/jinja_master/sidebar_menu.html
@@ -54,6 +54,17 @@
{% endfor %}
{% endif %}
{% if c.app %}
+ {% if h.has_access(c.app, 'admin')() %}
+ {% for s in c.app.admin_menu() %}
+ {{sidebar_item(s)}}
+ {% endfor %}
+ {{sidebar_item(c.app.admin_menu_delete_button)}}
+ {{sidebar_item(None)}}
+ {{c.app.admin_modal.display()}}
+ {% if c.app.admin_menu_delete_button %}
+ {{c.app.admin_tool_delete_modal.display()}}
+ {% endif %}
+ {% endif %}
{% for s in c.app.sidebar_menu() %}
{{sidebar_item(s)}}
{% endfor %}
http://git-wip-us.apache.org/repos/asf/allura/blob/ef7125cc/Allura/allura/templates/widgets/admin_tool_delete_modal.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/admin_tool_delete_modal.html b/Allura/allura/templates/widgets/admin_tool_delete_modal.html
new file mode 100644
index 0000000..dd8aab4
--- /dev/null
+++ b/Allura/allura/templates/widgets/admin_tool_delete_modal.html
@@ -0,0 +1,34 @@
+{#-
+ 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
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-#}
+{% import 'allura:templates/jinja_master/lib.html' as lib with context %}
+
+<h1>Confirm Delete</h1>
+<form method="POST"
+ action="{{c.project.url()}}admin/update_mounts"
+ id="admin-tool-delete-modal-form">
+<p class="warning-msg">Warning: This will destroy all data in this tool and is irreversible!</p>
+<hr>
+<p>
+ <input type="button" value="Delete" class="delete-tool">
+ <input type="button" value="Cancel" class="close">
+</p>
+<input type="hidden" class="mount_point" name="tool-0.mount_point"/>
+<input name="tool-0.delete" type="hidden" value="Delete"/>
+{{lib.csrf_token()}}
+</form>
[29/50] allura git commit: [#7925] include renames in webhook payload
Posted by je...@apache.org.
[#7925] include renames in webhook payload
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/95f56486
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/95f56486
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/95f56486
Branch: refs/heads/ib/7922
Commit: 95f56486ae75a01864d50ada7b6c49a166025e63
Parents: 7133cb1
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Jul 31 20:49:01 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:37 2015 -0400
----------------------------------------------------------------------
Allura/allura/model/repository.py | 1 +
ForgeGit/forgegit/tests/model/test_repository.py | 8 +++++---
ForgeSVN/forgesvn/tests/model/test_repository.py | 6 ++++--
3 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/95f56486/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 3db43a8..acbc3d1 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -1275,6 +1275,7 @@ class Commit(RepoObject, ActivityObject):
'removed': self.diffs.removed,
'modified': self.diffs.changed,
'copied': self.diffs.copied,
+ 'renamed': self.diffs.renamed,
}
http://git-wip-us.apache.org/repos/asf/allura/blob/95f56486/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 948f228..25daa62 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -121,7 +121,7 @@ class TestNewGit(unittest.TestCase):
assert_equal(
sorted(rev.webhook_info.keys()),
sorted(['id', 'url', 'timestamp', 'message', 'author',
- 'committer', 'added', 'removed', 'modified', 'copied']))
+ 'committer', 'added', 'removed', 'renamed', 'modified', 'copied']))
class TestGitRepo(unittest.TestCase, RepoImplTestBase):
@@ -568,7 +568,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'added': [u'bad'],
'removed': [],
'modified': [],
- 'copied': []
+ 'copied': [],
+ 'renamed': [],
}, {
'id': u'1e146e67985dcd71c74de79613719bef7bddca4a',
'url': u'http://localhost/p/test/src-git/ci/1e146e67985dcd71c74de79613719bef7bddca4a/',
@@ -583,7 +584,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'added': [],
'removed': [],
'modified': [u'README'],
- 'copied': []
+ 'copied': [],
+ 'renamed': [],
}],
'repository': {
'name': u'Git',
http://git-wip-us.apache.org/repos/asf/allura/blob/95f56486/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 9889a60..1c997b7 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -102,7 +102,7 @@ class TestNewRepo(unittest.TestCase):
assert_equal(
sorted(self.rev.webhook_info.keys()),
sorted(['id', 'url', 'timestamp', 'message', 'author',
- 'committer', 'added', 'removed', 'modified', 'copied']))
+ 'committer', 'added', 'removed', 'renamed', 'modified', 'copied']))
class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
@@ -595,7 +595,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
'added': [u'/ЗРЯЧИЙ_ТА_ПОБАЧИТЬ'],
'removed': [],
'modified': [],
- 'copied': []
+ 'copied': [],
+ 'renamed': [],
}, {
'id': u'r5',
'url': u'http://localhost/p/test/src/5/',
@@ -613,6 +614,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
'copied': [
{'new': u'/b', 'old': u'/a', 'diff': '', 'ratio': 1},
],
+ 'renamed': [],
}],
'repository': {
'name': u'SVN',
[09/50] allura git commit: [#7915] "contributing" cleanup
Posted by je...@apache.org.
[#7915] "contributing" cleanup
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/91870717
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/91870717
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/91870717
Branch: refs/heads/ib/7922
Commit: 91870717e1b2d3b481ece1c8c00ab5d57b392aa7
Parents: ff2fff4
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Aug 5 17:37:59 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Wed Aug 5 17:53:23 2015 -0400
----------------------------------------------------------------------
Allura/docs/development/contributing.rst | 4 +-
Allura/docs/getting_started/installation.rst | 2 +-
CONTRIBUTING | 174 ----------------------
3 files changed, 4 insertions(+), 176 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/91870717/Allura/docs/development/contributing.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/development/contributing.rst b/Allura/docs/development/contributing.rst
index 2dff6ad..a3b8ba4 100644
--- a/Allura/docs/development/contributing.rst
+++ b/Allura/docs/development/contributing.rst
@@ -15,6 +15,8 @@
specific language governing permissions and limitations
under the License.
+.. _contributing:
+
************
Contributing
************
@@ -36,7 +38,7 @@ Installing Allura
-----------------
Before hacking on Allura, you'll need to get an Allura instance up and running
so you can see and test the changes you make. You can install Allura from
-scratch, or by using our pre-built Vagrant image. Instructions for these
+scratch, or by using our Docker container images. Instructions for these
approaches can be found here:
* :ref:`Install from scratch <step-by-step-install>`
http://git-wip-us.apache.org/repos/asf/allura/blob/91870717/Allura/docs/getting_started/installation.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/installation.rst b/Allura/docs/getting_started/installation.rst
index d43d52d..5ad62a7 100644
--- a/Allura/docs/getting_started/installation.rst
+++ b/Allura/docs/getting_started/installation.rst
@@ -220,7 +220,7 @@ Extra
* Ask questions and discuss Allura on the `allura-dev mailing list <http://mail-archives.apache.org/mod_mbox/allura-dev/>`_
* Run the test suite (slow): :code:`$ ALLURA_VALIDATION=none ./run_tests`
* File bug reports at https://forge-allura.apache.org/p/allura/tickets/new/ (login required)
-* Contribute code according to `this guide <https://forge-allura.apache.org/p/allura/wiki/Contributing%20Code/>`_
+* Contribute code according to :ref:`this guide <contributing>`
.. _docker-install:
http://git-wip-us.apache.org/repos/asf/allura/blob/91870717/CONTRIBUTING
----------------------------------------------------------------------
diff --git a/CONTRIBUTING b/CONTRIBUTING
deleted file mode 100644
index 88ae8ce..0000000
--- a/CONTRIBUTING
+++ /dev/null
@@ -1,174 +0,0 @@
- 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
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
-ABOUT ALLURA
-
-Allura is an open source implementation of a software "forge", a
-web-site that manages source code repositories, bug reports,
-discussions, mailing lists, wiki pages, blogs and more for any
-number of individual projects.
-
-SourceForge.net is running an instance of Allura (aka New Forge, or
-Forge 2.0); and Allura itself is a project managed there:
-
- <https://allura.apache.org/>
-
-The source for Allura is available there from a Git repo under the
-Apache License, Version 2.0.
-
- <http://www.apache.org/licenses/LICENSE-2.0>
-
-Allura is written in Python and leverages a great many existing Python
-packages (see requirements.txt and friends). It comes with tests which
-we run with nose (see <http://somethingaboutorange.com/mrl/projects/nose/1.0.0/>).
-It is extensible in several ways, most importantly via the notion of
-"tools" based on allura.Application; but also with themes,
-authentication, and various other pluggable-APIs.
-
-CONTRIBUTING
-
-Allura is an effort _for_ the community: an open source platform for
-sharing development. We think it should be _of_ the community as well.
-We want to encourage community involvement in development, testing and
-design. We do that with a public git repo, a bug tracker, a discussion
-list and an IRC channel.
-
-
-- REPORTING BUGS
-
-Report bugs to our public tracker at:
-
- <https://forge-allura.apache.org/p/allura/tickets/>
-
-Four things make for a good bug report:
-
- + it's not a duplicate of an existing bug
-
- + it has a clear description of what was expected vs. what actually
- happened and why what actually happened was wrong
-
- + it has a recipe as simple as possible to reproduce it
-
- + it describes the environment in which the bug happens, i.e., your
- os, browser, and browser version; or if you're running your own
- forge -- the relevant details of the host os and supporting tools
-
-Other things that increase the value of a bug report but aren't always
-possible or applicable:
-
- + screen shots
-
- + code (to be added to the automated tests) that tests for the problem
-
- + patches to fix the problem
-
-
-- GETTING THE CODE
-
-The code is self-hosted in a public git repository. Get it by cloning:
-
- git clone https://git-wip-us.apache.org/repos/asf/allura.git allura
-
-- CONTRIBUTING CODE
-
-Develop and test your patches locally and then get them to us in one of
-two ways:
-
- + push your changes up to your 'forked' repo, and from there send us
- a merge request
-
- + attach a patch file to a ticket
-
-Things your patch-sequence must have/do:
-
- + follow PEP-8 <http://www.python.org/dev/peps/pep-0008/> coding
- guidelines
-
- + contain appropriate tests to be added to the automated testing
- machinery
-
- + pass existing tests (and/or fix existing tests that need to change)
-
- + be divided into an appropriate number of commits, one per reasonable
- "chunk" of functionality
-
-Things your patch will have before it can be merged into branch 'dev' or
-'master':
-
- + Discussion either on the mailing list or in the merge request, where
- you submitted it
-
- + Code-review (possibly many times as you re-work your patches in
- response to discussion)
-
-Very small patches might not need much discussion.
-
-
-- CONTRIBUTING TO THE DISCUSSION
-
-We intend to develop "out in the open", which means having a public
-discussion where we talk about new features, submitted patches, bugs,
-direction, and deployment. You can join in the discussion on the
-mailing list:
-
- <http://mail-archives.apache.org/mod_mbox/allura-dev/>
-
-
-- ASKING QUESTIONS
-
-First, is your question already answered in the FAQ?
-
- <https://forge-allura.apache.org/p/allura/wiki/FAQ/>
-
-If not, then the right place to ask is either the mailing list (above)
-or the IRC channel:
-
- <irc://irc.freenode.com:6667/#sourceforge>
-
-
-- OUR DEVELOPMENT MODEL
-
-Our model is a somewhat scaled-down version of how the Git project
-itself is run. We have two main branches
-
- + master: release quality
-
- + dev: integration branch for commits expected to go to master
-
- + feature branches not yet ready for integration testing, starting
- with the two character initials of the author, e.g., db/1368 for Dave
- Brondsema's work on bug [#1368] or wo/contributing for Wolf's work on
- the CONTRIBUTING doc
-
-'master' and 'dev' are stable; they will never be rewound or rebased.
-Feature branches are typically cut from 'dev', and usually rebased to
-'dev' just before they are merged there. In the meanwhile they may be
-rebased or rewound as necessary. Being on 'dev' is not a guarantee that
-a commit will make it to master. Anything that turns out to not
-actually be ready will be reverted.
-
-'dev' will always contain 'master'. Emergency fixes may go directly to
-'master' which would then immediately be merged down into 'dev'.
-
-As we get more contributors and start having "patch-churn", we will
-re-evaluate a three-branch model, like Git. The third branch would be
-'pu' (for "proposed update").
-
-We expect that people deploying the code will deploy from 'master' or
-from a release tag. We expect that people experimenting with the code
-will deploy from 'dev' or from their own feature branches or integration
-branches cut from 'dev'.
[11/50] allura git commit: [#7915] more exact links into installation
docs
Posted by je...@apache.org.
[#7915] more exact links into installation docs
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/acd5b126
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/acd5b126
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/acd5b126
Branch: refs/heads/ib/7922
Commit: acd5b1268f24895a90d9493b1230852bcc4db1e3
Parents: 9187071
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Aug 5 17:50:37 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Wed Aug 5 17:53:24 2015 -0400
----------------------------------------------------------------------
INSTALL.markdown | 2 +-
README.markdown | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/acd5b126/INSTALL.markdown
----------------------------------------------------------------------
diff --git a/INSTALL.markdown b/INSTALL.markdown
index 57c0b89..b9a74b9 100644
--- a/INSTALL.markdown
+++ b/INSTALL.markdown
@@ -17,4 +17,4 @@
under the License.
-->
-See `Allura/docs`.
+See see `Allura/docs/getting_started/installation.rst` or <https://forge-allura.apache.org/docs/getting_started/installation.html>.
http://git-wip-us.apache.org/repos/asf/allura/blob/acd5b126/README.markdown
----------------------------------------------------------------------
diff --git a/README.markdown b/README.markdown
index 5eec88f..1e762da 100644
--- a/README.markdown
+++ b/README.markdown
@@ -22,7 +22,7 @@ Apache Allura
Allura is an open source implementation of a software "forge", a web site that manages source code repositories, bug reports, discussions, mailing lists, wiki pages, blogs and more for any number of individual projects.
-To install Allura, see `Allura/docs`.
+To install Allura, see `Allura/docs/getting_started/installation.rst` or <https://forge-allura.apache.org/docs/getting_started/installation.html>.
Website: <https://allura.apache.org/>
[18/50] allura git commit: [#7925] Refactor and improve the diff
processing
Posted by je...@apache.org.
[#7925] Refactor and improve the diff processing
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/7f738bdf
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/7f738bdf
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/7f738bdf
Branch: refs/heads/ib/7922
Commit: 7f738bdfbb93e78d8d557f8b60fb1965ce9e67ce
Parents: 7eeb0dd
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Jul 27 16:06:28 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:35 2015 -0400
----------------------------------------------------------------------
Allura/allura/lib/custom_middleware.py | 4 --
Allura/allura/model/repository.py | 67 +----------------------------
ForgeGit/forgegit/model/git_repo.py | 51 +++++++++++++++-------
ForgeSVN/forgesvn/model/svn.py | 17 +++++---
4 files changed, 47 insertions(+), 92 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/7f738bdf/Allura/allura/lib/custom_middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/custom_middleware.py b/Allura/allura/lib/custom_middleware.py
index e56a530..1938e51 100644
--- a/Allura/allura/lib/custom_middleware.py
+++ b/Allura/allura/lib/custom_middleware.py
@@ -322,10 +322,6 @@ class AlluraTimerMiddleware(TimerMiddleware):
Timer('urlopen', urllib2, 'urlopen'),
Timer('base_repo_tool.{method_name}',
allura.model.repository.RepositoryImplementation, 'last_commit_ids'),
- Timer('_diffs_copied', allura.model.repository.Commit, '_diffs_copied'),
- Timer(
- 'sequencematcher.{method_name}', allura.model.repository.SequenceMatcher,
- 'ratio', 'quick_ratio', 'real_quick_ratio'),
Timer('unified_diff', allura.model.repository, 'unified_diff'),
] + [Timer('sidebar', ep.load(), 'sidebar_menu') for ep in tool_entry_points]
http://git-wip-us.apache.org/repos/asf/allura/blob/7f738bdf/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 5fe2ba9..636d10c 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -1168,78 +1168,15 @@ class Commit(RepoObject, ActivityObject):
def paged_diffs(self, start=0, end=None):
diffs = self.repo.paged_diffs(self._id, start, end)
- if not diffs.get('copied'):
- diffs['copied'] = []
- copied = self._diffs_copied(diffs['added'], diffs['removed'])
- diffs['copied'].extend(copied)
+
return Object(
added=sorted(diffs['added']),
removed=sorted(diffs['removed']),
changed=sorted(diffs['changed']),
copied=sorted(diffs['copied']),
+ renamed=sorted(diffs['renamed']),
total=diffs['total'])
- def _diffs_copied(self, added, removed):
- '''Return list with file renames diffs.
-
- Will change `added` and `removed` lists also.
- '''
- def _blobs_similarity(removed_blob, added):
- best = dict(ratio=0, name='', blob=None)
- for added_name in added:
- added_blob = self.tree.get_obj_by_path(added_name)
- if not isinstance(added_blob, Blob):
- continue
- diff = SequenceMatcher(None, removed_blob.text,
- added_blob.text)
- ratio = diff.quick_ratio()
- if ratio > best['ratio']:
- best['ratio'] = ratio
- best['name'] = added_name
- best['blob'] = added_blob
-
- if ratio == 1:
- break # we'll won't find better similarity than 100% :)
-
- if best['ratio'] > DIFF_SIMILARITY_THRESHOLD:
- diff = ''
- if best['ratio'] < 1:
- added_blob = best['blob']
- rpath = ('a' + removed_blob.path()).encode('utf-8')
- apath = ('b' + added_blob.path()).encode('utf-8')
- diff = ''.join(unified_diff(list(removed_blob),
- list(added_blob),
- rpath, apath))
- return dict(new=best['name'],
- ratio=best['ratio'], diff=diff)
-
- def _trees_similarity(removed_tree, added):
- for added_name in added:
- added_tree = self.tree.get_obj_by_path(added_name)
- if not isinstance(added_tree, Tree):
- continue
- if removed_tree._id == added_tree._id:
- return dict(new=added_name,
- ratio=1, diff='')
-
- if not removed:
- return []
- copied = []
- prev_commit = self.get_parent()
- for removed_name in removed[:]:
- removed_blob = prev_commit.tree.get_obj_by_path(removed_name)
- rename_info = None
- if isinstance(removed_blob, Blob):
- rename_info = _blobs_similarity(removed_blob, added)
- elif isinstance(removed_blob, Tree):
- rename_info = _trees_similarity(removed_blob, added)
- if rename_info is not None:
- rename_info['old'] = removed_name
- copied.append(rename_info)
- removed.remove(rename_info['old'])
- added.remove(rename_info['new'])
- return copied
-
def get_path(self, path, create=True):
path = path.lstrip('/')
parts = path.split('/')
http://git-wip-us.apache.org/repos/asf/allura/blob/7f738bdf/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 9549fa6..9a8549a 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -642,36 +642,55 @@ class GitImplementation(M.RepositoryImplementation):
max_count=1).splitlines()[1:]
def paged_diffs(self, commit_id, start=0, end=None):
- added, removed, changed = [], [], []
+ result = {'added': [], 'removed': [], 'changed': [], 'copied': [], 'renamed': [], 'total': 0}
+
files = self._git.git.diff_tree(
'--no-commit-id',
+ '--find-renames',
+ '--find-copies',
'--name-status',
- '--no-renames',
+ '--no-abbrev',
'--root',
- # show tree entry itself as well as subtrees (Commit.added_paths
- # relies on this)
+ '--find-copies-harder',
+ # show tree entry itself as well as subtrees (Commit.added_paths relies on this)
'-t',
'-z', # don't escape filenames and use \x00 as fields delimiter
commit_id).split('\x00')[:-1]
- total = len(files) / 2
- files = [(files[i], h.really_unicode(files[i+1]))
- for i in xrange(0, len(files), 2)]
+ result['total'] = len(files) / 2
+ x = 0
+ while x < len(files):
+ try:
+ if files[x].startswith("R") or files[x].startswith("C"):
+ change_list = result['renamed'] if files[x].startswith("R") else result['copied']
+ ratio = float(files[x][1:4]) / 100.0
+ change_list.append({
+ 'new': h.really_unicode(files[x + 2]),
+ 'old': h.really_unicode(files[x + 1]),
+ 'ratio': ratio,
+ 'diff': '',
+ })
+ del files[x:x+3]
+ x += 3
+ result['total'] -= 1
+ else:
+ x += 2
+ except IndexError:
+ break
+
+ files = [(files[i], h.really_unicode(files[i + 1]))
+ for i in xrange(0, result['total'] + 1, 2)]
# files = [('A', u'filename'), ('D', u'another filename'), ...]
for status, name in files[start:end]:
if status == 'A':
- added.append(name)
+ result['added'].append(name)
elif status == 'D':
- removed.append(name)
+ result['removed'].append(name)
elif status == 'M':
- changed.append(name)
- return {
- 'added': added,
- 'removed': removed,
- 'changed': changed,
- 'total': total,
- }
+ result['changed'].append(name)
+
+ return result
@contextmanager
def _shared_clone(self, from_path):
http://git-wip-us.apache.org/repos/asf/allura/blob/7f738bdf/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index cd410e3..f43f536 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -781,13 +781,7 @@ class SVNImplementation(M.RepositoryImplementation):
return []
def paged_diffs(self, commit_id, start=0, end=None):
- result = {
- 'added': [],
- 'removed': [],
- 'changed': [],
- 'copied': [],
- 'total': 0,
- }
+ result = {'added': [], 'removed': [], 'changed': [], 'copied': [], 'renamed': [], 'total': 0}
rev = self._revision(commit_id)
try:
log_info = self._svn.log(
@@ -822,6 +816,15 @@ class SVNImplementation(M.RepositoryImplementation):
# svn add aaa.txt
# svn commit -m "Replace aaa.txt"
result['changed'].append(h.really_unicode(p.path))
+
+ for r in result['copied']:
+ if r['old'] in result['removed'][:]:
+ result['removed'].remove(r['old'])
+ result['copied'].remove(r)
+ result['renamed'].append(r)
+ if r['new'] in result['added']:
+ result['added'].remove(r['new'])
+
return result
Mapper.compile_all()
[38/50] allura git commit: [#7922] ticket:826 Fix subproject delete
Posted by je...@apache.org.
[#7922] ticket:826 Fix subproject delete
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/1c002499
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1c002499
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1c002499
Branch: refs/heads/ib/7922
Commit: 1c002499f8c1ff3b59ae12710b30158ae1b1c993
Parents: ef7125c
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Jul 31 12:28:21 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 18:14:42 2015 +0300
----------------------------------------------------------------------
Allura/allura/ext/admin/templates/project_tools.html | 4 +++-
.../lib/widgets/resources/js/admin_tool_delete_modal.js | 9 ++++++++-
.../allura/templates/widgets/admin_tool_delete_modal.html | 4 ++--
3 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/1c002499/Allura/allura/ext/admin/templates/project_tools.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/project_tools.html b/Allura/allura/ext/admin/templates/project_tools.html
index c9eab4a..90c03d4 100644
--- a/Allura/allura/ext/admin/templates/project_tools.html
+++ b/Allura/allura/ext/admin/templates/project_tools.html
@@ -105,7 +105,9 @@
<img src="{{ g.theme.app_icon_url('subproject', 48) }}" alt="">
</li>
<li>
- <a href="#" data-mount-point="{{ mount['sub'].shortname }}" class="admin_tool_delete_modal">
+ <a href="#" data-mount-point="{{ mount['sub'].shortname }}"
+ data-subproject="true"
+ class="admin_tool_delete_modal">
<span>Delete</span>
</a>
</li>
http://git-wip-us.apache.org/repos/asf/allura/blob/1c002499/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js b/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js
index 3d41261..211f5ed 100644
--- a/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js
+++ b/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js
@@ -20,7 +20,14 @@ $(function() {
var $form = $('#admin-tool-delete-modal-form');
$('a.admin_tool_delete_modal').click(function() {
var mount_point = $(this).data('mount-point');
- $form.find('.mount_point').val(mount_point);
+ var is_sub = $(this).data('subproject');
+ var prefix = is_sub ? 'subproject-0' : 'tool-0';
+ var mount_point_name = prefix + (is_sub ? '.shortname' : '.mount_point');
+ var delete_name = prefix + '.delete';
+ $form.find('.mount_point')
+ .attr('name', mount_point_name)
+ .val(mount_point);
+ $form.find('.delete-input').attr('name', delete_name);
var tool_label = 'this';
if (mount_point) {
tool_label = 'the "' + mount_point + '"';
http://git-wip-us.apache.org/repos/asf/allura/blob/1c002499/Allura/allura/templates/widgets/admin_tool_delete_modal.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/admin_tool_delete_modal.html b/Allura/allura/templates/widgets/admin_tool_delete_modal.html
index dd8aab4..692c582 100644
--- a/Allura/allura/templates/widgets/admin_tool_delete_modal.html
+++ b/Allura/allura/templates/widgets/admin_tool_delete_modal.html
@@ -28,7 +28,7 @@
<input type="button" value="Delete" class="delete-tool">
<input type="button" value="Cancel" class="close">
</p>
-<input type="hidden" class="mount_point" name="tool-0.mount_point"/>
-<input name="tool-0.delete" type="hidden" value="Delete"/>
+<input type="hidden" class="mount_point">
+<input type="hidden" value="Delete" class="delete-input">
{{lib.csrf_token()}}
</form>
[23/50] allura git commit: [#7925] Update commit web view to show
copied and renamed changes
Posted by je...@apache.org.
[#7925] Update commit web view to show copied and renamed changes
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/73385a88
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/73385a88
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/73385a88
Branch: refs/heads/ib/7922
Commit: 73385a88dd6bc36adc4e1f8716b1fb3a621662bc
Parents: 04b87c6
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Jul 27 16:11:50 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:36 2015 -0400
----------------------------------------------------------------------
Allura/allura/controllers/repository.py | 4 ++--
Allura/allura/templates/repo/commit.html | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/73385a88/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 5d03f64..0524589 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -565,8 +565,8 @@ class CommitBrowser(BaseController):
diffs = self._commit.paged_diffs(start=start, end=start + limit)
result['artifacts'] = [
(t, f, 'blob' if tree.get_blob_by_path(f) else 'tree',
- tree.get_blob_by_path(f) and tree.get_blob_by_path(f).is_text)
- for t in ('added', 'removed', 'changed', 'copied')
+ tree.get_blob_by_path(f) and tree.get_blob_by_path(f).has_html_view)
+ for t in ('added', 'removed', 'changed', 'copied', 'renamed')
for f in diffs[t]]
count = diffs['total']
result.update(dict(page=page, limit=limit, count=count))
http://git-wip-us.apache.org/repos/asf/allura/blob/73385a88/Allura/allura/templates/repo/commit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/commit.html b/Allura/allura/templates/repo/commit.html
index f029f52..f7206d4 100644
--- a/Allura/allura/templates/repo/commit.html
+++ b/Allura/allura/templates/repo/commit.html
@@ -1,3 +1,4 @@
+
{#-
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -119,6 +120,8 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
<td><a href="#diff-{{loop.index}}">
{% if type == 'copied' %}
{{ '%s -> %s' % (h.really_unicode(file.old), h.really_unicode(file.new)) }}
+ {% elif type == 'renamed' %}
+ {{ '%s -> %s' % (h.really_unicode(file.old), h.really_unicode(file.new)) }}
{% else %}
{{h.really_unicode(file)}}
{% endif %}
@@ -142,6 +145,8 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
{% endif %}
{% elif type == 'removed' %}
<a href="{{prev[0].url()}}tree/{{h.urlquote(h.really_unicode(file))}}">{{h.really_unicode(file)}}</a>
+ {% elif type == 'renamed' %}
+ <a href="{{prev[0].url()}}tree/{{h.urlquote(h.really_unicode(file))}}">{{h.really_unicode(file)}}</a>
{% elif type == 'copied' %}
<a href="{{prev[0].url()}}tree/{{h.urlquote(h.really_unicode(file.old))}}">{{h.really_unicode(file.old)}}</a>
to
[37/50] allura git commit: [#7960] instead of assuming 10-digit ph#
is US, just provide better error help
Posted by je...@apache.org.
[#7960] instead of assuming 10-digit ph# is US, just provide better error help
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/2f144a9d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/2f144a9d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/2f144a9d
Branch: refs/heads/ib/7922
Commit: 2f144a9dc3b11e8987815200dd66c93976643c18
Parents: 9653816
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Aug 12 22:16:55 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 15:09:11 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/phone/nexmo.py | 23 +++++++++++++++-----
Allura/allura/lib/utils.py | 3 ---
.../tests/functional/test_neighborhood.py | 2 +-
Allura/allura/tests/test_utils.py | 2 +-
Allura/allura/tests/unit/phone/test_nexmo.py | 15 +++++++++++++
5 files changed, 34 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/2f144a9d/Allura/allura/lib/phone/nexmo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/phone/nexmo.py b/Allura/allura/lib/phone/nexmo.py
index 3b28c71..dfb1bf0 100644
--- a/Allura/allura/lib/phone/nexmo.py
+++ b/Allura/allura/lib/phone/nexmo.py
@@ -17,9 +17,12 @@
import logging
from urlparse import urljoin
-
+import cgi
import json
+
import requests
+import jinja2
+
from allura.lib.phone import PhoneService
from allura.lib.utils import phone_number_hash
@@ -46,10 +49,18 @@ class NexmoPhoneService(PhoneService):
}
return dict(params, **common)
- def error(self, code=None, msg=None):
- allowed_codes = ['3', '10', '15', '16', '17']
+ def error(self, code=None, msg=None, number=''):
+ allowed_codes = ['3', '10', '15', '16', '17'] # https://docs.nexmo.com/index.php/verify/search#verify_return_code
if code is None or str(code) not in allowed_codes:
msg = 'Failed sending request to Nexmo'
+ if str(code) == '3' and msg.endswith(' number'):
+ msg = jinja2.Markup(
+ '{}{}{}'.format(
+ cgi.escape(msg), # escape it just in case Nexmo sent some HTML we don't want through
+ '<br>Make sure you include the country code (see examples above)',
+ '. For US numbers, you must include <code>1-</code> before the area code.' if len(number) == 10 else '',
+ ))
+
return {'status': 'error', 'error': msg}
def ok(self, **params):
@@ -64,10 +75,10 @@ class NexmoPhoneService(PhoneService):
log_params = dict(params, api_key='...', api_secret='...')
if 'number' in log_params:
log_params['number'] = phone_number_hash(log_params['number'])
- params = json.dumps(params, sort_keys=True)
+ post_params = json.dumps(params, sort_keys=True)
log.info('PhoneService (nexmo) request: %s %s', url, log_params)
try:
- resp = requests.post(url, data=params, headers=headers)
+ resp = requests.post(url, data=post_params, headers=headers)
log.info('PhoneService (nexmo) response: %s', resp.content)
resp = resp.json()
except Exception:
@@ -75,7 +86,7 @@ class NexmoPhoneService(PhoneService):
return self.error()
if resp.get('status') == '0':
return self.ok(request_id=resp.get('request_id'))
- return self.error(code=resp.get('status'), msg=resp.get('error_text'))
+ return self.error(code=resp.get('status'), msg=resp.get('error_text'), number=params.get('number',''))
def verify(self, number):
url = urljoin(self.BASE_URL, 'verify')
http://git-wip-us.apache.org/repos/asf/allura/blob/2f144a9d/Allura/allura/lib/utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index b00d7c1..eb273d2 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -607,9 +607,6 @@ class DateJSONEncoder(json.JSONEncoder):
def clean_phone_number(number):
pattern = re.compile('\W+')
number = pattern.sub('', number)
- if len(number) == 10:
- # assume US phone
- number = u'1' + number
return number
http://git-wip-us.apache.org/repos/asf/allura/blob/2f144a9d/Allura/allura/tests/functional/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index f87e9ea..9359efc 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -984,7 +984,7 @@ class TestPhoneVerificationOnProjectRegistration(TestController):
with h.push_config(config, **{'project.verify_phone': 'true'}):
phone_service.verify.return_value = {
'request_id': 'request-id', 'status': 'ok'}
- r = self.app.get('/p/verify_phone', {'number': '555-444-3333'})
+ r = self.app.get('/p/verify_phone', {'number': '1-555-444-3333'})
phone_service.verify.assert_called_once_with('15554443333')
assert_equal(r.json, {'status': 'ok'})
rid = r.session.get('phone_verification.request_id')
http://git-wip-us.apache.org/repos/asf/allura/blob/2f144a9d/Allura/allura/tests/test_utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_utils.py b/Allura/allura/tests/test_utils.py
index 39d61b3..dd67ded 100644
--- a/Allura/allura/tests/test_utils.py
+++ b/Allura/allura/tests/test_utils.py
@@ -317,7 +317,7 @@ def test_clean_phone_number():
clean = utils.clean_phone_number
assert_equal(clean('123456789'), '123456789')
assert_equal(clean('+123 456:789'), '123456789')
- assert_equal(clean('555-555-5555'), '15555555555')
+ assert_equal(clean('555-555-5555'), '5555555555')
assert_equal(clean('1-555-555-5555'), '15555555555')
http://git-wip-us.apache.org/repos/asf/allura/blob/2f144a9d/Allura/allura/tests/unit/phone/test_nexmo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/phone/test_nexmo.py b/Allura/allura/tests/unit/phone/test_nexmo.py
index 0d9c419..640aab6 100644
--- a/Allura/allura/tests/unit/phone/test_nexmo.py
+++ b/Allura/allura/tests/unit/phone/test_nexmo.py
@@ -18,6 +18,7 @@
import json
from mock import patch
from datadiff.tools import assert_equal
+from nose.tools import assert_in, assert_not_in
from allura.lib.phone.nexmo import NexmoPhoneService
@@ -52,6 +53,20 @@ class TestPhoneService(object):
expected = {'status': 'error', 'error': 'text'}
assert_equal(expected, res)
+ # invalid format, possibly US
+ res = self.phone.error(code='3', msg='Invalid value for parameter: number', number='8005551234')
+ assert_equal(res['status'], 'error')
+ assert_in('Invalid value for parameter: number', res['error'])
+ assert_in('country code', res['error'])
+ assert_in('US', res['error'])
+
+ # invalid format, not US
+ res = self.phone.error(code='3', msg='Invalid value for parameter: number', number='738005551234')
+ assert_equal(res['status'], 'error')
+ assert_in('Invalid value for parameter: number', res['error'])
+ assert_in('country code', res['error'])
+ assert_not_in('US', res['error'])
+
def test_ok(self):
res = self.phone.ok(request_id='123', other='smth')
expected = {'status': 'ok', 'request_id': '123', 'other': 'smth'}
[19/50] allura git commit: [#7925] Improve binary file detection
Posted by je...@apache.org.
[#7925] Improve binary file detection
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/7eeb0dd0
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/7eeb0dd0
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/7eeb0dd0
Branch: refs/heads/ib/7922
Commit: 7eeb0dd06ec8f0aca4a890efe0fae4c9524c4972
Parents: e252f5e
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Jul 27 15:58:59 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Aug 10 09:38:35 2015 -0400
----------------------------------------------------------------------
Allura/allura/model/repository.py | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/7eeb0dd0/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 7bc36c1..5fe2ba9 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -77,11 +77,21 @@ SObjType = S.OneOf('blob', 'tree', 'submodule')
# Used for when we're going to batch queries using $in
QSIZE = 100
-README_RE = re.compile('^README(\.[^.]*)?$', re.IGNORECASE)
-VIEWABLE_EXTENSIONS = [
- '.php', '.py', '.js', '.java', '.html', '.htm', '.yaml', '.sh',
- '.rb', '.phtml', '.txt', '.bat', '.ps1', '.xhtml', '.css', '.cfm', '.jsp', '.jspx',
- '.pl', '.php4', '.php3', '.rhtml', '.svg', '.markdown', '.json', '.ini', '.tcl', '.vbs', '.xsl']
+BINARY_EXTENSIONS = [
+ "3ds", "3g2", "3gp", "7z", "a", "aac", "adp", "ai", "aif", "apk", "ar", "asf", "au", "avi",
+ "bak", "bin", "bk", "bmp", "btif", "bz2", "cab", "caf", "cgm", "cmx", "cpio", "cr2", "dat", "deb", "djvu", "dll",
+ "dmg", "dng", "doc", "docx", "dra", "DS_Store", "dsk", "dts", "dtshd", "dvb", "dwg", "dxf", "ecelp4800",
+ "ecelp7470", "ecelp9600", "egg", "eol", "eot", "epub", "exe", "f4v", "fbs", "fh", "fla", "flac", "fli", "flv",
+ "fpx", "fst", "fvt", "g3", "gif", "gz", "h261", "h263", "h264", "ico", "ief", "img", "ipa", "iso", "jar", "jpeg",
+ "jpg", "jpgv", "jpm", "jxr", "ktx", "lvp", "lz", "lzma", "lzo", "m3u", "m4a", "m4v", "mar", "mdi", "mid", "mj2",
+ "mka", "mkv", "mmr", "mng", "mov", "movie", "mp3", "mp4", "mp4a", "mpeg", "mpg", "mpga", "mxu", "nef", "npx", "o",
+ "oga", "ogg", "ogv", "otf", "pbm", "pcx", "pdf", "pea", "pgm", "pic", "png", "pnm", "ppm", "psd", "pya", "pyc",
+ "pyo", "pyv", "qt", "rar", "ras", "raw", "rgb", "rip", "rlc", "rz", "s3m", "s7z", "scpt", "sgi", "shar", "sil",
+ "smv", "so", "sub", "swf", "tar", "tbz2", "tga", "tgz", "tif", "tiff", "tlz", "ts", "ttf", "uvh", "uvi", "uvm",
+ "uvp", "uvs", "uvu", "viv", "vob", "war", "wav", "wax", "wbmp", "wdp", "weba", "webm", "webp", "whl", "wm", "wma",
+ "wmv", "wmx", "woff", "woff2", "wvx", "xbm", "xif", "xm", "xpi", "xpm", "xwd", "xz", "z", "zip", "zipx"
+]
+
PYPELINE_EXTENSIONS = utils.MARKDOWN_EXTENSIONS + ['.rst']
DIFF_SIMILARITY_THRESHOLD = .5 # used for determining file renames
@@ -1520,12 +1530,6 @@ class Blob(object):
return self._content_type_encoding[0]
@LazyProperty
- def is_text(self):
- """Return true if this blob is text."""
-
- return self.content_type.startswith("text")
-
- @LazyProperty
def content_encoding(self):
return self._content_type_encoding[1]
@@ -1535,8 +1539,10 @@ class Blob(object):
return True
return False
- @property
+ @LazyProperty
def has_html_view(self):
+ if self.extension in BINARY_EXTENSIONS:
+ return False
if (self.content_type.startswith('text/') or
self.extension in VIEWABLE_EXTENSIONS or
self.extension in PYPELINE_EXTENSIONS or