# HG changeset patch # User Steve Losh # Date 1267662723 18000 # Node ID 85b4ae69ded250bb5c1b8aa8c55b1fe0defd5c20 # Parent ddea94e8e13869d70d5e41c3429d3448717e18af Use the new annotated diff functionality to fix the changeset web UI. diff -r ddea94e8e138 -r 85b4ae69ded2 review/web_templates/changeset.html --- a/review/web_templates/changeset.html Wed Mar 03 18:55:40 2010 -0500 +++ b/review/web_templates/changeset.html Wed Mar 03 19:32:03 2010 -0500 @@ -38,7 +38,7 @@

Files

- {% for filename, diff in rcset.diffs().iteritems() %} + {% for filename in rcset.files() %}
   ↓ @@ -77,97 +77,69 @@
+
- {% set max_line = diff['max'] %} - {% set content = diff['content'] %} - {% set line_level_comments = rcset.line_level_comments(filename) %} - {% set previous_n = -1 %} + {% set annotated_diff = rcset.annotated_diff(filename) %} + {# We need to ignore the first item from this generator, because + we don't care about providing a line-number prefix (for now!). #} + {% set ignore_this_variable = annotated_diff.next() %} - {% for n, line in content %} - {% if n - 1 < previous_n %} - {% set skipped_count = n - previous_n %} - {% if previous_n == -1 %} - {% set skipped_count = skipped_count - 1 %} - {% endif %} + {% for line in annotated_diff %} + {% if line['skipped'] %} - + + + {% for comment in line['comments'] %} + + {% endfor %} + {% else %} + + + {% for comment in line['comments'] %} + + {% endfor %} + + + + {% endif %} - - {% for comment in utils['skipped_comments'](n, previous_n, line_level_comments) %} - - {% endfor %} - - - - - - {% for comment in utils['line_comments'](n, line_level_comments) %} - - {% endfor %} - - - - - - {% set previous_n = n %} {% endfor %} - - {% if previous_n < max_line %} - - - - - {% for comment in utils['skipped_comments_end'](previous_n, max_line, line_level_comments) %} - - {% endfor %} - {% endif %}
… skipped {{ skipped_count }} lines …… skipped {{ line['skipped'] }} lines …
+
+
+ +
{{ comment.message|escape }}
+
+
{{ line['content'][1:]|escape }}
+
+
+ +
{{ comment.message }}
+
+
+
+
+ + +
+
+ +
+ + +
+
-
-
- -
{{ comment.message }}
-
-
{{ line[1:] }}
-
-
- -
{{ comment.message }}
-
-
-
-
- - -
-
- -
- - -
-
… skipped {{ max_line - previous_n }} lines …
-
-
- -
{{ comment.message }}
-
-