# HG changeset patch # User Steve Losh # Date 1255038765 14400 # Node ID 62c8ba974c19949bee9babe580cde6bbe60f8853 # Parent 789e5765c9ff940d20949e7d5889fb216a7a9a8f Strip even more from the diffs Mercurial gives us. diff -r 789e5765c9ff -r 62c8ba974c19 review/api.py --- a/review/api.py Wed Oct 07 23:38:30 2009 -0400 +++ b/review/api.py Thu Oct 08 17:52:45 2009 -0400 @@ -234,11 +234,12 @@ opts=patch.diffopts(self.ui, opts)) # patch.diff will give us back a generator with two items - # the first is the diff header, which we don't care about + # the first is the diff --git header, which we don't care about d.next() - # the second is the diff's contents, which is what we want - diffs[filename] = d.next() + # the second is the diff's contents, which is what we want, + # minus the header + diffs[filename] = '\n'.join(d.next().splitlines()[3:]) return diffs diff -r 789e5765c9ff -r 62c8ba974c19 review/extension_ui.py --- a/review/extension_ui.py Wed Oct 07 23:38:30 2009 -0400 +++ b/review/extension_ui.py Thu Oct 08 17:52:45 2009 -0400 @@ -119,7 +119,7 @@ for comment in file_level_comments: _print_comment(comment) - content = diffs[filename].splitlines()[2:] + content = diffs[filename].splitlines() line_level_comments = filter( lambda c: filename == c.filename and c.lines, rcset.comments diff -r 789e5765c9ff -r 62c8ba974c19 review/tests/sample_data.py --- a/review/tests/sample_data.py Wed Oct 07 23:38:30 2009 -0400 +++ b/review/tests/sample_data.py Thu Oct 08 17:52:45 2009 -0400 @@ -1,9 +1,9 @@ log = [ - { 'file_one': 'hello\nworld', + { 'file_one': 'hello\nworld\nfirst\ncommit', 'file_two': 'this is another test file', }, { 'file_one': 'hello again\nworld\nfoo\nbar', - 'file_three': 'this is a new file\nfor testing', - 'test_dir/test_file': 'this file is inside\nof a directory', + 'file_three': 'this is a new file\nfor testing\npurposes\nonly', + 'test_dir/test_file': 'this file is inside\nof a directory\n\nponies!', }, ] \ No newline at end of file