| 583 | } |
| 584 | |
| 585 | int show_range_diff(const char *range1, const char *range2, |
| 586 | struct range_diff_options *range_diff_opts) |
| 587 | { |
| 588 | int res = 0; |
| 589 | |
| 590 | struct string_list branch1 = STRING_LIST_INIT_DUP; |
| 591 | struct string_list branch2 = STRING_LIST_INIT_DUP; |
| 592 | unsigned int include_merges = range_diff_opts->include_merges; |
| 593 | |
| 594 | if (range_diff_opts->left_only && range_diff_opts->right_only) |
| 595 | res = error(_("options '%s' and '%s' cannot be used together"), "--left-only", "--right-only"); |
| 596 | |
| 597 | if (!res && read_patches(range1, &branch1, range_diff_opts->log_arg, include_merges)) |
| 598 | res = error(_("could not parse log for '%s'"), range1); |
| 599 | if (!res && read_patches(range2, &branch2, range_diff_opts->log_arg, include_merges)) |
| 600 | res = error(_("could not parse log for '%s'"), range2); |
| 601 | |
| 602 | if (!res) { |
| 603 | find_exact_matches(&branch1, &branch2); |
| 604 | get_correspondences(&branch1, &branch2, |
| 605 | range_diff_opts->creation_factor, |
| 606 | range_diff_opts->max_memory); |
| 607 | output(&branch1, &branch2, range_diff_opts); |
| 608 | } |
| 609 | |
| 610 | string_list_clear(&branch1, 1); |
| 611 | string_list_clear(&branch2, 1); |
| 612 | |
| 613 | return res; |
| 614 | } |
| 615 | |
| 616 | int is_range_diff_range(const char *arg) |
| 617 | { |
no test coverage detected