summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
authorJohan Herland <johan@herland.net>2010-06-09 23:09:33 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2010-06-19 08:40:23 (UTC)
commiteac1b675414722ae90df75abc727b2795bc096f0 (patch) (unidiff)
tree4deb6c0ac103ab2f42750d6c7230d45366eb1732 /ui-shared.c
parentab42741c49d369e41c1e1915c6c024d79509f7d6 (diff)
downloadcgit-eac1b675414722ae90df75abc727b2795bc096f0.zip
cgit-eac1b675414722ae90df75abc727b2795bc096f0.tar.gz
cgit-eac1b675414722ae90df75abc727b2795bc096f0.tar.bz2
ui-patch: Apply path limit to generated patch
Also indicate in the comment section of the patch that a path limit was applied, too easily see when a generated patch is only partial. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 4fa506f..d5c4c10 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -343,99 +343,99 @@ void cgit_commit_link(char *name, const char *title, const char *class,
343 } 343 }
344 html("'>"); 344 html("'>");
345 html_txt(name); 345 html_txt(name);
346 html("</a>"); 346 html("</a>");
347} 347}
348 348
349void cgit_refs_link(const char *name, const char *title, const char *class, 349void cgit_refs_link(const char *name, const char *title, const char *class,
350 const char *head, const char *rev, const char *path) 350 const char *head, const char *rev, const char *path)
351{ 351{
352 reporevlink("refs", name, title, class, head, rev, path); 352 reporevlink("refs", name, title, class, head, rev, path);
353} 353}
354 354
355void cgit_snapshot_link(const char *name, const char *title, const char *class, 355void cgit_snapshot_link(const char *name, const char *title, const char *class,
356 const char *head, const char *rev, 356 const char *head, const char *rev,
357 const char *archivename) 357 const char *archivename)
358{ 358{
359 reporevlink("snapshot", name, title, class, head, rev, archivename); 359 reporevlink("snapshot", name, title, class, head, rev, archivename);
360} 360}
361 361
362void cgit_diff_link(const char *name, const char *title, const char *class, 362void cgit_diff_link(const char *name, const char *title, const char *class,
363 const char *head, const char *new_rev, const char *old_rev, 363 const char *head, const char *new_rev, const char *old_rev,
364 const char *path, int toggle_ssdiff) 364 const char *path, int toggle_ssdiff)
365{ 365{
366 char *delim; 366 char *delim;
367 367
368 delim = repolink(title, class, "diff", head, path); 368 delim = repolink(title, class, "diff", head, path);
369 if (new_rev && ctx.qry.head != NULL && strcmp(new_rev, ctx.qry.head)) { 369 if (new_rev && ctx.qry.head != NULL && strcmp(new_rev, ctx.qry.head)) {
370 html(delim); 370 html(delim);
371 html("id="); 371 html("id=");
372 html_url_arg(new_rev); 372 html_url_arg(new_rev);
373 delim = "&amp;"; 373 delim = "&amp;";
374 } 374 }
375 if (old_rev) { 375 if (old_rev) {
376 html(delim); 376 html(delim);
377 html("id2="); 377 html("id2=");
378 html_url_arg(old_rev); 378 html_url_arg(old_rev);
379 delim = "&amp;"; 379 delim = "&amp;";
380 } 380 }
381 if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) { 381 if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) {
382 html(delim); 382 html(delim);
383 html("ss=1"); 383 html("ss=1");
384 } 384 }
385 html("'>"); 385 html("'>");
386 html_txt(name); 386 html_txt(name);
387 html("</a>"); 387 html("</a>");
388} 388}
389 389
390void cgit_patch_link(const char *name, const char *title, const char *class, 390void cgit_patch_link(const char *name, const char *title, const char *class,
391 const char *head, const char *rev) 391 const char *head, const char *rev, const char *path)
392{ 392{
393 reporevlink("patch", name, title, class, head, rev, NULL); 393 reporevlink("patch", name, title, class, head, rev, path);
394} 394}
395 395
396void cgit_stats_link(const char *name, const char *title, const char *class, 396void cgit_stats_link(const char *name, const char *title, const char *class,
397 const char *head, const char *path) 397 const char *head, const char *path)
398{ 398{
399 reporevlink("stats", name, title, class, head, NULL, path); 399 reporevlink("stats", name, title, class, head, NULL, path);
400} 400}
401 401
402void cgit_self_link(char *name, const char *title, const char *class, 402void cgit_self_link(char *name, const char *title, const char *class,
403 struct cgit_context *ctx) 403 struct cgit_context *ctx)
404{ 404{
405 if (!strcmp(ctx->qry.page, "repolist")) 405 if (!strcmp(ctx->qry.page, "repolist"))
406 return cgit_index_link(name, title, class, ctx->qry.search, 406 return cgit_index_link(name, title, class, ctx->qry.search,
407 ctx->qry.ofs); 407 ctx->qry.ofs);
408 else if (!strcmp(ctx->qry.page, "summary")) 408 else if (!strcmp(ctx->qry.page, "summary"))
409 return cgit_summary_link(name, title, class, ctx->qry.head); 409 return cgit_summary_link(name, title, class, ctx->qry.head);
410 else if (!strcmp(ctx->qry.page, "tag")) 410 else if (!strcmp(ctx->qry.page, "tag"))
411 return cgit_tag_link(name, title, class, ctx->qry.head, 411 return cgit_tag_link(name, title, class, ctx->qry.head,
412 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL); 412 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL);
413 else if (!strcmp(ctx->qry.page, "tree")) 413 else if (!strcmp(ctx->qry.page, "tree"))
414 return cgit_tree_link(name, title, class, ctx->qry.head, 414 return cgit_tree_link(name, title, class, ctx->qry.head,
415 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, 415 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL,
416 ctx->qry.path); 416 ctx->qry.path);
417 else if (!strcmp(ctx->qry.page, "plain")) 417 else if (!strcmp(ctx->qry.page, "plain"))
418 return cgit_plain_link(name, title, class, ctx->qry.head, 418 return cgit_plain_link(name, title, class, ctx->qry.head,
419 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, 419 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL,
420 ctx->qry.path); 420 ctx->qry.path);
421 else if (!strcmp(ctx->qry.page, "log")) 421 else if (!strcmp(ctx->qry.page, "log"))
422 return cgit_log_link(name, title, class, ctx->qry.head, 422 return cgit_log_link(name, title, class, ctx->qry.head,
423 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, 423 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL,
424 ctx->qry.path, ctx->qry.ofs, 424 ctx->qry.path, ctx->qry.ofs,
425 ctx->qry.grep, ctx->qry.search, 425 ctx->qry.grep, ctx->qry.search,
426 ctx->qry.showmsg); 426 ctx->qry.showmsg);
427 else if (!strcmp(ctx->qry.page, "commit")) 427 else if (!strcmp(ctx->qry.page, "commit"))
428 return cgit_commit_link(name, title, class, ctx->qry.head, 428 return cgit_commit_link(name, title, class, ctx->qry.head,
429 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, 429 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL,
430 ctx->qry.path, 0); 430 ctx->qry.path, 0);
431 else if (!strcmp(ctx->qry.page, "patch")) 431 else if (!strcmp(ctx->qry.page, "patch"))
432 return cgit_patch_link(name, title, class, ctx->qry.head, 432 return cgit_patch_link(name, title, class, ctx->qry.head,
433 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, 433 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL,
434 ctx->qry.path); 434 ctx->qry.path);
435 else if (!strcmp(ctx->qry.page, "refs")) 435 else if (!strcmp(ctx->qry.page, "refs"))
436 return cgit_refs_link(name, title, class, ctx->qry.head, 436 return cgit_refs_link(name, title, class, ctx->qry.head,
437 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, 437 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL,
438 ctx->qry.path); 438 ctx->qry.path);
439 else if (!strcmp(ctx->qry.page, "snapshot")) 439 else if (!strcmp(ctx->qry.page, "snapshot"))
440 return cgit_snapshot_link(name, title, class, ctx->qry.head, 440 return cgit_snapshot_link(name, title, class, ctx->qry.head,
441 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, 441 ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL,