You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/04/01 23:11:00 UTC
[43/45] allura git commit: [#7837] ticket:750 List directories in the
commit info
[#7837] ticket:750 List directories in the commit info
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/44dda6b2
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/44dda6b2
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/44dda6b2
Branch: refs/heads/hss/7072
Commit: 44dda6b208347e8249a997fd9576329371c88cc5
Parents: 5fc0458
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Mar 27 16:35:59 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Mar 30 19:20:42 2015 +0000
----------------------------------------------------------------------
Allura/allura/controllers/repository.py | 6 +++---
Allura/allura/templates/repo/commit.html | 16 +++++++++++-----
2 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/44dda6b2/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 8d8cfff..c08ec99 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -538,9 +538,9 @@ class CommitBrowser(BaseController):
default=self.DEFAULT_PAGE_LIMIT)
diffs = self._commit.paged_diffs(start=start, end=start + limit)
result['artifacts'] = [
- (t, f) for t in ('added', 'removed', 'changed', 'copied')
- for f in diffs[t]
- if t == 'removed' or tree.get_blob_by_path(f)]
+ (t, f, 'blob' if tree.get_blob_by_path(f) else 'tree')
+ for t in ('added', 'removed', 'changed', 'copied')
+ for f in diffs[t]]
count = diffs['total']
result.update(dict(page=page, limit=limit, count=count))
return result
http://git-wip-us.apache.org/repos/asf/allura/blob/44dda6b2/Allura/allura/templates/repo/commit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/commit.html b/Allura/allura/templates/repo/commit.html
index 98afbba..4870332 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,13 +128,17 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
</tbody>
</table>
-{% for type, file in artifacts %}
+{% for type, file, obj_type in artifacts %}
<div class="inline-diff">
<h6>
{% if type in ('added', 'changed') %}
- <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>
+ {% 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>
+ {% endif %}
{% elif type == 'removed' %}
<a href="{{prev[0].url()}}tree/{{h.urlquote(h.really_unicode(file))}}">{{h.really_unicode(file)}}</a>
{% elif type == 'copied' %}
@@ -152,6 +156,8 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
{% else %}
{{g.highlight(file.diff, lexer='diff')}}
{% endif %}
+ {% elif obj_type == 'tree' %}
+ <span class="empty-diff">Directory.</span>
{% else %}
<img src="{{g.forge_static('images/spinner.gif')}}" class="loading_icon" alt="Loading..."/>
<script type="text/javascript">