@@ -84,7 +84,7 module Redmine | |||
|
84 | 84 | end |
|
85 | 85 | end |
|
86 | 86 | return nil if $? && $?.exitstatus != 0 |
|
87 | entries.sort_by_name | |
|
87 | entries.compact.sort_by_name | |
|
88 | 88 | end |
|
89 | 89 | |
|
90 | 90 | def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}) |
@@ -149,14 +149,21 module Redmine | |||
|
149 | 149 | |
|
150 | 150 | private |
|
151 | 151 |
|
|
152 | # Returns an Entry from the given XML element | |
|
153 | # or nil if the entry was deleted | |
|
152 | 154 | def entry_from_xml(element, path_prefix) |
|
155 | modified_element = element.elements['modified'] | |
|
156 | if modified_element.elements['modified_how'].text.match(/removed/) | |
|
157 | return nil | |
|
158 | end | |
|
159 | ||
|
153 | 160 | Entry.new({:name => element.attributes['name'], |
|
154 | 161 | :path => path_prefix + element.attributes['name'], |
|
155 | 162 | :kind => element.name == 'file' ? 'file' : 'dir', |
|
156 | 163 | :size => nil, |
|
157 | 164 | :lastrev => Revision.new({ |
|
158 | 165 | :identifier => nil, |
|
159 |
:scmid => |
|
|
166 | :scmid => modified_element.elements['patch'].attributes['hash'] | |
|
160 | 167 | }) |
|
161 | 168 | }) |
|
162 | 169 | end |
@@ -49,6 +49,12 class RepositoryDarcsTest < Test::Unit::TestCase | |||
|
49 | 49 | assert_equal 6, @repository.changesets.count |
|
50 | 50 | end |
|
51 | 51 | |
|
52 | def test_deleted_files_should_not_be_listed | |
|
53 | entries = @repository.entries('sources') | |
|
54 | assert entries.detect {|e| e.name == 'watchers_controller.rb'} | |
|
55 | assert_nil entries.detect {|e| e.name == 'welcome_controller.rb'} | |
|
56 | end | |
|
57 | ||
|
52 | 58 | def test_cat |
|
53 | 59 | @repository.fetch_changesets |
|
54 | 60 | cat = @repository.cat("sources/welcome_controller.rb", 2) |
General Comments 0
You need to be logged in to leave comments.
Login now