Project

General

Profile

Defect #3087 » commit_update_parent_project.patch

Patch against 2731 for issue #3087 - Lincoln Stoll, 2009-05-11 02:02

View differences:

app/models/changeset.rb (working copy)
80 80
    # status and optional done ratio applied
81 81
    fix_status = IssueStatus.find_by_id(Setting.commit_fix_status_id)
82 82
    done_ratio = Setting.commit_fix_done_ratio.blank? ? nil : Setting.commit_fix_done_ratio.to_i
83
    
83
    project_list = [repository.project] + repository.project.ancestors    
84

  
84 85
    kw_regexp = (ref_keywords + fix_keywords).collect{|kw| Regexp.escape(kw)}.join("|")
85 86
    return if kw_regexp.blank?
86 87
    
......
90 91
      # find any issue ID in the comments
91 92
      target_issue_ids = []
92 93
      comments.scan(%r{([\s\(,-]|^)#(\d+)(?=[[:punct:]]|\s|<|$)}).each { |m| target_issue_ids << m[1] }
93
      referenced_issues += repository.project.issues.find_all_by_id(target_issue_ids)
94
      #referenced_issues += repository.project.issues.find_all_by_id(target_issue_ids)
95
      project_list.each {|project| referenced_issues += project.issues.find_all_by_id(target_issue_ids)}
94 96
    end
95 97
    
96 98
    comments.scan(Regexp.new("(#{kw_regexp})[\s:]+(([\s,;&]*#?\\d+)+)", Regexp::IGNORECASE)).each do |match|
97 99
      action = match[0]
98 100
      target_issue_ids = match[1].scan(/\d+/)
99
      target_issues = repository.project.issues.find_all_by_id(target_issue_ids)
101
      target_issues = []
102
      project_list.each {|project| target_issues += project.issues.find_all_by_id(target_issue_ids)}
103
      #target_issues = repository.project.issues.find_all_by_id(target_issue_ids)
100 104
      if fix_status && fix_keywords.include?(action.downcase)
101 105
        # update status of issues
102 106
        logger.debug "Issues fixed by changeset #{self.revision}: #{issue_ids.join(', ')}." if logger && logger.debug?
app/views/issues/_changesets.rhtml (working copy)
1 1
<% changesets.each do |changeset| %>
2 2
    <div class="changeset <%= cycle('odd', 'even') %>">
3 3
    <p><%= link_to("#{l(:label_revision)} #{changeset.revision}",
4
                :controller => 'repositories', :action => 'revision', :id => @project, :rev => changeset.revision) %><br />
4
                :controller => 'repositories', :action => 'revision', :id => changeset.repository.project, :rev => changeset.revision) %><br />
5 5
        <span class="author"><%= authoring(changeset.committed_on, changeset.author) %></span></p>
6 6
    <%= textilizable(changeset, :comments) %>
7 7
    </div>
(1-1/2)