You are here: Home > Latest news from Darcs > Fixes Darcs reporter failure to retrieve author names

Revision 20080307210128-9043f-5edc9a...

Fixes Darcs reporter failure to retrieve author names

app/reporters/darcs_reporter.rb
test/unit/darcs_reporter_test.rb

Changes to darcs_reporter.rb

41
  end
  end
41
42
  
  
42
43
  def author_from_darcs_id(id)
  def author_from_darcs_id(id)
43
44
    md = id.match(/@/)
    id.sub(/@.*$/, '')
44
45
    return md.pre_match if md
 
46
  end
  end
45
47
  
  
46
48
  def time_from_darcs_date(date)
  def time_from_darcs_date(date)
47
52 more lines
101
    return remain, diff
    return remain, diff
100
102
  end
  end
101
103
102
104
end
end
103

Changes to darcs_reporter_test.rb

140
    assert changes[1].diff.match(/@@ -76,6 \+76,17 @@/)
    assert changes[1].diff.match(/@@ -76,6 \+76,17 @@/)
140
141
    assert changes[1].diff.match(/^\+\t\tmultiplexer.addOutput\(output\);/)
    assert changes[1].diff.match(/^\+\t\tmultiplexer.addOutput\(output\);/)
141
142
    assert changes[1].diff.match(/Writer multiplexer = new MultiplexedWriter\(outputs\);\n\n/)
    assert changes[1].diff.match(/Writer multiplexer = new MultiplexedWriter\(outputs\);\n\n/)
142
 
  end
143
143
144
 
  def test_accepts_author_identifiers_that_are_not_email_addresses
145
 
    assert_equal 'thiago.arrais',
146
 
                 @reporter.author_from_darcs_id('thiago.arrais@gmail.com')
147
 
    assert_equal 'tbasouza',
148
 
                 @reporter.author_from_darcs_id('tbasouza')
149
144
  end
  end
150
145
  
  
151
146
end
end
152