Skip to content

Commit

Permalink
Notice that the import details are inside of the Log Message
Browse files Browse the repository at this point in the history
So properly detect and handle them.
  • Loading branch information
afresh1 committed Mar 30, 2014
1 parent 50c7daa commit f808250
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions commits-to-twitter.pl
Expand Up @@ -262,17 +262,12 @@ sub parse_changelog {
$_ = decode('UTF-8', readline $fh) || last;
chomp;

if (/^\s*(CVSROOT|Module name|Changes by|Release Tags):\s+(.*)$/) {
if (/^\s*(CVSROOT|Module name|Changes by):\s+(.*)$/) {
$commit{$1} = $2;
next;
}
next unless $commit{CVSROOT}; # first thing should be CVSROOT

if (/^\s*N\s+(.*)\/([^\/]+)/) {
push @{ $commit{'Imported files'}{$1} }, $2;
next;
}

if (/^(Update of)\s+(.*)\/([^\/]+)$/) {
$commit{'Updated files'}{$2} = [$3];
next;
Expand Down Expand Up @@ -309,17 +304,25 @@ sub parse_changelog {
}

if (/^Log [Mm]essage:/) {
my $importing = 0;
while (<$fh>) {
if (my ($k, $v) = /^(CVSROOT):\s+(.*)$/) {
$finish_commit->();
$commit{$k} = $v;
last
}
if (my ($k, $v) = /^\s*(Vendor Tag):\s+(.*)$/) {
if (my ($k, $v) = /^\s*(Vendor Tag|Release Tags):\s+(.*)$/) {
$commit{$k} = $v;
$commit{'Log message'} =~ s/\s*Status:\s*$//ms;
last;
$importing = 1;
next;
}
if ($importing && m{^\s*[UCN]\s+[^/]*/(.*)/([^/]+)\b$}) {
push @{ $commit{'Imported files'}{$1} }, $2;
next;
}
$commit{'Log message'} .= $_;
}
}
Expand Down

0 comments on commit f808250

Please sign in to comment.