diff options
author | Petr Mladek <pmladek@suse.cz> | 2012-05-18 18:02:37 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-05-18 18:08:24 +0200 |
commit | dd15b51ddaf4a143d494076a6dd554a059d91489 (patch) | |
tree | 69bb5258b55b9844d0fd5caf829bc3d4bdfb6002 /bin/lo-commit-stat | |
parent | b47213604b69df85837b504917caf550c008459f (diff) |
lo-commit-stat: problem with wide character in bug title
+ do not check for "-" in the bug title; it might be also wide character
in some cases
+ show result when looking for bug titles
+ sort bugs when loolking for bug titles and printing bug numbers
Change-Id: I39496f7d0cf5f7a116e7d3c506b76b4a3de1dee1
Diffstat (limited to 'bin/lo-commit-stat')
-rwxr-xr-x | bin/lo-commit-stat | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat index a14eb3ef1cba..a61b32641747 100755 --- a/bin/lo-commit-stat +++ b/bin/lo-commit-stat @@ -283,7 +283,7 @@ sub print_stat($$) sub get_bug_name($$) { my ($bug, $summary) = @_; - print "$bug\n"; + print "$bug: "; $bug =~ m/(?:(\w*)\#+(\d+))/; # fdo#12345 my $bugzilla = $1; # fdo @@ -296,9 +296,12 @@ sub get_bug_name($$) $ua->env_proxy; my $response = $ua->get($url); if ($response->is_success) { - my $title = $response->title(); - if ( $title =~ s/^Bug \d+ – // ) { + my $title = $response->title; + if ( $title =~ s/^Bug \d+ . // ) { + print "$title\n"; return $title; + } else { + print "warning: not found; using commit message\n"; } } } @@ -324,7 +327,8 @@ sub print_bugs($$) } # try to replace summaries with bug names from bugzilla - foreach my $bug ( keys %bugs) { + print "Getting bug titles:\n"; + foreach my $bug ( sort { $a cmp $b } keys %bugs) { $bugs{$bug}{'summary'} = get_bug_name($bug, $bugs{$bug}{'summary'}); } @@ -355,7 +359,7 @@ sub print_bugnumbers($$) } } - printf $log join ("\n", keys %bugs) . "\n"; + printf $log join ("\n", sort { $a cmp $b } keys %bugs) . "\n"; } ######################################################################## |