remove issues with other milstones

This commit is contained in:
Petr Korolev 2014-12-22 15:14:01 +02:00
parent 135c48a494
commit e6bb728355
2 changed files with 27 additions and 4 deletions

View File

@ -243,6 +243,29 @@ module GitHubChangelogGenerator
filtered_issues = delete_by_time(@issues, :closed_at, newer_tag_time, older_tag_time)
end
#delete excess irrelevant issues (according milestones)
filtered_issues.select!{ |issue|
if issue.milestone.nil?
true
else
#check, that this milestone in tag list:
milestone_is_tag = @all_tags.find{|tag|
tag.name == issue.milestone.title
}
if milestone_is_tag.nil?
true
else
issue.milestone.title == newer_tag_name
end
end
}
#add missed issues (according milestones)
self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time)
end

View File

@ -10,10 +10,10 @@ module GitHubChangelogGenerator
merge = "#{@options[:merge_prefix]}#{encapsulated_title} [\\##{pull_request[:number]}](#{pull_request.html_url})"
if @options[:author]
if !pull_request.user.nil?
merge += " ([#{pull_request.user.login}](#{pull_request.user.html_url}))\n\n"
else
if pull_request.user.nil?
merge += " ({Null user})\n\n"
else
merge += " ([#{pull_request.user.login}](#{pull_request.user.html_url}))\n\n"
end
else
merge += "\n\n"