@@ -167,7 +167,9 class Repository < ActiveRecord::Base | |||
|
167 | 167 | end |
|
168 | 168 | |
|
169 | 169 | def entries(path=nil, identifier=nil) |
|
170 | scm.entries(path, identifier) | |
|
170 | entries = scm.entries(path, identifier) | |
|
171 | load_entries_changesets(entries) | |
|
172 | entries | |
|
171 | 173 | end |
|
172 | 174 | |
|
173 | 175 | def branches |
@@ -380,6 +382,16 class Repository < ActiveRecord::Base | |||
|
380 | 382 | end |
|
381 | 383 | end |
|
382 | 384 | |
|
385 | def load_entries_changesets(entries) | |
|
386 | if entries | |
|
387 | entries.each do |entry| | |
|
388 | if entry.lastrev && entry.lastrev.identifier | |
|
389 | entry.changeset = find_changeset_by_name(entry.lastrev.identifier) | |
|
390 | end | |
|
391 | end | |
|
392 | end | |
|
393 | end | |
|
394 | ||
|
383 | 395 | private |
|
384 | 396 | |
|
385 | 397 | # Deletes repository data |
@@ -63,6 +63,8 class Repository::Bazaar < Repository | |||
|
63 | 63 | end |
|
64 | 64 | end |
|
65 | 65 | end |
|
66 | load_entries_changesets(entries) | |
|
67 | entries | |
|
66 | 68 | end |
|
67 | 69 | |
|
68 | 70 | def fetch_changesets |
@@ -66,6 +66,7 class Repository::Cvs < Repository | |||
|
66 | 66 | end |
|
67 | 67 | end |
|
68 | 68 | end |
|
69 | load_entries_changesets(entries) | |
|
69 | 70 | entries |
|
70 | 71 | end |
|
71 | 72 |
@@ -66,6 +66,7 class Repository::Darcs < Repository | |||
|
66 | 66 | end |
|
67 | 67 | end |
|
68 | 68 | end |
|
69 | load_entries_changesets(entries) | |
|
69 | 70 | entries |
|
70 | 71 | end |
|
71 | 72 |
@@ -44,10 +44,6 class Repository::Filesystem < Repository | |||
|
44 | 44 | false |
|
45 | 45 | end |
|
46 | 46 | |
|
47 | def entries(path=nil, identifier=nil) | |
|
48 | scm.entries(path, identifier) | |
|
49 | end | |
|
50 | ||
|
51 | 47 | def fetch_changesets |
|
52 | 48 | nil |
|
53 | 49 | end |
@@ -94,9 +94,9 class Repository::Git < Repository | |||
|
94 | 94 | end |
|
95 | 95 | |
|
96 | 96 | def entries(path=nil, identifier=nil) |
|
97 | scm.entries(path, | |
|
98 | identifier, | |
|
99 | options = {:report_last_commit => extra_report_last_commit}) | |
|
97 | entries = scm.entries(path, identifier, :report_last_commit => extra_report_last_commit) | |
|
98 | load_entries_changesets(entries) | |
|
99 | entries | |
|
100 | 100 | end |
|
101 | 101 | |
|
102 | 102 | # With SCMs that have a sequential commit numbering, |
@@ -29,12 +29,11 | |||
|
29 | 29 | :class => (entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(ent_name)}")%> |
|
30 | 30 | </td> |
|
31 | 31 | <td class="size"><%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td> |
|
32 | <% changeset = @repository.find_changeset_by_name(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %> | |
|
33 | 32 | <% if @repository.report_last_commit %> |
|
34 | <td class="revision"><%= link_to_revision(changeset, @repository) if changeset %></td> | |
|
33 | <td class="revision"><%= link_to_revision(entry.changeset, @repository) if entry.changeset %></td> | |
|
35 | 34 | <td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %></td> |
|
36 | <td class="author"><%= changeset.nil? ? h(Redmine::CodesetUtil.replace_invalid_utf8(entry.lastrev.author.to_s.split('<').first)) : h(changeset.author) if entry.lastrev %></td> | |
|
37 |
<td class="comments"><%=h truncate(changeset.comments, :length => 50) |
|
|
35 | <td class="author"><%= entry.changeset.nil? ? h(Redmine::CodesetUtil.replace_invalid_utf8(entry.lastrev.author.to_s.split('<').first)) : h(entry.changeset.author) if entry.lastrev %></td> | |
|
36 | <td class="comments"><%=h truncate(entry.changeset.comments, :length => 50) if entry.changeset %></td> | |
|
38 | 37 | <% end %> |
|
39 | 38 | </tr> |
|
40 | 39 | <% end %> |
@@ -301,7 +301,8 module Redmine | |||
|
301 | 301 | end |
|
302 | 302 | |
|
303 | 303 | class Entry |
|
304 | attr_accessor :name, :path, :kind, :size, :lastrev | |
|
304 | attr_accessor :name, :path, :kind, :size, :lastrev, :changeset | |
|
305 | ||
|
305 | 306 | def initialize(attributes={}) |
|
306 | 307 | self.name = attributes[:name] if attributes[:name] |
|
307 | 308 | self.path = attributes[:path] if attributes[:path] |
General Comments 0
You need to be logged in to leave comments.
Login now