summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.cz>2012-05-18 18:02:37 +0200
committerPetr Mladek <pmladek@suse.cz>2012-05-21 16:44:44 +0200
commit11f2d5842c45624f540becab4cc6833642e24b26 (patch)
treec1d1dab3288b6848d32cf50ff9b9c587228a4f1d
parentf1ea289d65d6704f5075b080b6a141c23984cb8e (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 Signed-off-by: Ivan Timofeev <timofeev.i.s@gmail.com> Change-Id: I39496f7d0cf5f7a116e7d3c506b76b4a3de1dee1
-rwxr-xr-xbin/lo-commit-stat14
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";
}
########################################################################