You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2018/09/18 17:59:48 UTC
[1/3] allura git commit: [#8231] copy some repo settings when forking
Repository: allura
Updated Branches:
refs/heads/db/8231 [created] 572fe0f26
[#8231] copy some repo settings when forking
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/96cb9d08
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/96cb9d08
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/96cb9d08
Branch: refs/heads/db/8231
Commit: 96cb9d08971033a59ef469152e13c6e0d5bbaf7b
Parents: c3bc5d1
Author: Dave Brondsema <da...@brondsema.net>
Authored: Tue Sep 18 13:46:04 2018 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Sep 18 13:46:04 2018 -0400
----------------------------------------------------------------------
ForgeGit/forgegit/git_main.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/96cb9d08/ForgeGit/forgegit/git_main.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/git_main.py b/ForgeGit/forgegit/git_main.py
index 050addb..cfdb7b0 100644
--- a/ForgeGit/forgegit/git_main.py
+++ b/ForgeGit/forgegit/git_main.py
@@ -82,19 +82,20 @@ class ForgeGitApp(RepositoryApp):
def install(self, project):
'''Create repo object for this tool'''
super(ForgeGitApp, self).install(project)
- GM.Repository(
+ repo = GM.Repository(
name=self.config.options.mount_point + '.git',
tool='git',
status='initializing',
fs_path=self.config.options.get('fs_path'))
ThreadLocalORMSession.flush_all()
- cloned_from_project_id = self.config.options.get(
- 'cloned_from_project_id')
+ cloned_from_project_id = self.config.options.get('cloned_from_project_id')
cloned_from_repo_id = self.config.options.get('cloned_from_repo_id')
init_from_url = self.config.options.get('init_from_url')
init_from_path = self.config.options.get('init_from_path')
if cloned_from_project_id is not None:
cloned_from = GM.Repository.query.get(_id=cloned_from_repo_id)
+ repo.default_branch_name = cloned_from.default_branch_name
+ repo.additional_viewable_extensions = cloned_from.additional_viewable_extensions
allura.tasks.repo_tasks.clone.post(
cloned_from_path=cloned_from.full_fs_path,
cloned_from_name=cloned_from.app.config.script_name(),
[2/3] allura git commit: [#8231] make viewable extensions dialog work
nicer
Posted by br...@apache.org.
[#8231] make viewable extensions dialog work nicer
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/4ebec5c7
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/4ebec5c7
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/4ebec5c7
Branch: refs/heads/db/8231
Commit: 4ebec5c77eef13b19cf01f6db57b1a1f09f8acd2
Parents: 96cb9d0
Author: Dave Brondsema <da...@brondsema.net>
Authored: Tue Sep 18 13:46:27 2018 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Sep 18 13:46:27 2018 -0400
----------------------------------------------------------------------
Allura/allura/lib/repository.py | 4 ++--
.../allura/templates/repo/admin_extensions.html | 23 +++++---------------
2 files changed, 8 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/4ebec5c7/Allura/allura/lib/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/repository.py b/Allura/allura/lib/repository.py
index d89f4c2..c176a63 100644
--- a/Allura/allura/lib/repository.py
+++ b/Allura/allura/lib/repository.py
@@ -258,8 +258,8 @@ class RepoAdminController(DefaultAdminController):
@expose()
@require_post()
def set_extensions(self, **post_data):
- self.repo.additional_viewable_extensions = post_data[
- 'additional_viewable_extensions']
+ self.repo.additional_viewable_extensions = post_data['additional_viewable_extensions']
+ redirect(request.referer)
@without_trailing_slash
@expose('jinja:allura:templates/repo/default_branch.html')
http://git-wip-us.apache.org/repos/asf/allura/blob/4ebec5c7/Allura/allura/templates/repo/admin_extensions.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/admin_extensions.html b/Allura/allura/templates/repo/admin_extensions.html
index e09a77a..f3801cf 100644
--- a/Allura/allura/templates/repo/admin_extensions.html
+++ b/Allura/allura/templates/repo/admin_extensions.html
@@ -16,12 +16,14 @@
specific language governing permissions and limitations
under the License.
-#}
-<form>
+{% import 'allura:templates/jinja_master/lib.html' as lib with context %}
+
+<form method="post" action="{{c.project.url()}}admin/{{app.config.options.mount_point}}/set_extensions">
<label class="grid-13">Extensions:</label>
<div class="grid-13">
{% if allow_config %}
<input type="text" name="additional_viewable_extensions"
- id="additional_viewable_extensions" title="e.g., .svnignore,.gitignore,.ini"
+ id="additional_viewable_extensions" placeholder=".ini, .foo, Makefile"
{% if additional_viewable_extensions %} value="{{additional_viewable_extensions}}"{% endif %}/>
{% else %}
<span>{{additional_viewable_extensions}}</span>
@@ -33,21 +35,8 @@
<hr>
<div class="grid-13"> </div>
<div class="grid-13">
- <input type="button" onclick="save_extensions()" value="Save">
+ <input type="button" value="Save" class="submit">
+ {{lib.csrf_token()}}
</div>
{% endif %}
</form>
-{% if allow_config %}
- <script type="text/javascript">
- function save_extensions() {
- var cval = $.cookie('_session_id');
- $.post('{{c.project.url()}}admin/{{app.config.options.mount_point}}/set_extensions', {
- additional_viewable_extensions: $('#additional_viewable_extensions').val(),
- _session_id:cval
- },
- function () {
- location.reload();
- });
- }
- </script>
-{% endif %}
[3/3] allura git commit: [#8231] don't actually change the repo (web
process might not have permission to,
and this can get called from get_default_branch() automatically
Posted by br...@apache.org.
[#8231] don't actually change the repo (web process might not have permission to, and this can get called from get_default_branch() automatically
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/572fe0f2
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/572fe0f2
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/572fe0f2
Branch: refs/heads/db/8231
Commit: 572fe0f267c643ef3b61a61c2b75700fe6b212d4
Parents: 4ebec5c
Author: Dave Brondsema <da...@brondsema.net>
Authored: Tue Sep 18 13:58:43 2018 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Sep 18 13:58:43 2018 -0400
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/572fe0f2/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 950c0c8..a2d55db 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -616,8 +616,6 @@ class GitImplementation(M.RepositoryImplementation):
def set_default_branch(self, name):
if not name:
return
- # HEAD should point to default branch
- self._git.git.symbolic_ref('HEAD', 'refs/heads/%s' % name)
self._repo.default_branch_name = name
session(self._repo).flush(self._repo)