author | Lars Hjemli <hjemli@gmail.com> | 2010-06-22 14:16:12 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2010-06-22 14:16:12 (UTC) |
commit | 6f92f332e6a9ee3e16051bda9fe148607af67f65 (patch) (unidiff) | |
tree | 49cb7d145fbf40793b220efdc92cd80ab2c6ca05 /ui-diff.c | |
parent | 37a24e4e39737edaa5cdde501346a65eeb280e63 (diff) | |
parent | d20313e3daf855ee5d4808e050f54614c200d7b1 (diff) | |
download | cgit-6f92f332e6a9ee3e16051bda9fe148607af67f65.zip cgit-6f92f332e6a9ee3e16051bda9fe148607af67f65.tar.gz cgit-6f92f332e6a9ee3e16051bda9fe148607af67f65.tar.bz2 |
Merge branch 'jh/context-lines'
Conflicts:
cgit.c
cgit.h
-rw-r--r-- | ui-diff.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -128,5 +128,5 @@ static void inspect_filepair(struct diff_filepair *pair) | |||
128 | lines_removed = 0; | 128 | lines_removed = 0; |
129 | cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, &new_size, | 129 | cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, &new_size, |
130 | &binary, count_diff_lines); | 130 | &binary, 0, count_diff_lines); |
131 | if (files >= slots) { | 131 | if (files >= slots) { |
132 | if (slots == 0) | 132 | if (slots == 0) |
@@ -157,5 +157,5 @@ void cgit_print_diffstat(const unsigned char *old_sha1, | |||
157 | const unsigned char *new_sha1, const char *prefix) | 157 | const unsigned char *new_sha1, const char *prefix) |
158 | { | 158 | { |
159 | int i; | 159 | int i, save_context = ctx.qry.context; |
160 | 160 | ||
161 | html("<div class='diffstat-header'>"); | 161 | html("<div class='diffstat-header'>"); |
@@ -164,4 +164,12 @@ void cgit_print_diffstat(const unsigned char *old_sha1, | |||
164 | if (prefix) | 164 | if (prefix) |
165 | htmlf(" (limited to '%s')", prefix); | 165 | htmlf(" (limited to '%s')", prefix); |
166 | html(" ("); | ||
167 | ctx.qry.context = (save_context > 0 ? save_context : 3) << 1; | ||
168 | cgit_self_link("more", NULL, NULL, &ctx); | ||
169 | html("/"); | ||
170 | ctx.qry.context = (save_context > 3 ? save_context : 3) >> 1; | ||
171 | cgit_self_link("less", NULL, NULL, &ctx); | ||
172 | ctx.qry.context = save_context; | ||
173 | html(" context)"); | ||
166 | html("</div>"); | 174 | html("</div>"); |
167 | html("<table summary='diffstat' class='diffstat'>"); | 175 | html("<table summary='diffstat' class='diffstat'>"); |
@@ -289,5 +297,5 @@ static void filepair_cb(struct diff_filepair *pair) | |||
289 | } | 297 | } |
290 | if (cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, | 298 | if (cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, |
291 | &new_size, &binary, print_line_fn)) | 299 | &new_size, &binary, ctx.qry.context, print_line_fn)) |
292 | cgit_print_error("Error running diff"); | 300 | cgit_print_error("Error running diff"); |
293 | if (binary) { | 301 | if (binary) { |