more idiomatic perl

master
Joey Hess 2010-04-04 12:23:12 -04:00
parent 2a15f94159
commit c9af069b59
1 changed files with 2 additions and 4 deletions

View File

@ -83,15 +83,13 @@ sub bzr_log ($) {
} }
elsif ($line =~ /^(modified|added|renamed|renamed and modified|removed):/) { elsif ($line =~ /^(modified|added|renamed|renamed and modified|removed):/) {
$key = "files"; $key = "files";
unless (defined($info{$key})) { $info{$key} = ""; } $info{$key} = "" unless defined $info{$key};
} }
elsif (defined($key) and $line =~ /^ (.*)/) { elsif (defined($key) and $line =~ /^ (.*)/) {
$info{$key} .= "$1\n"; $info{$key} .= "$1\n";
} }
elsif ($line eq "------------------------------------------------------------\n") { elsif ($line eq "------------------------------------------------------------\n") {
if (keys %info) { push @infos, {%info} if keys %info;
push (@infos, {%info});
}
%info = (); %info = ();
$key = undef; $key = undef;
} }