diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-09-18 13:14:28 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-09-25 20:12:52 +0100 |
commit | 15e42009c4fb4694a4774ee5bc380ae66697cc79 (patch) | |
tree | 1e0b5082b8466350d50b8b609e413121fc34fdef /dgit | |
parent | 860fb101ec10956b4f0d309a00815aff48cffd85 (diff) |
Changelog handling: Provide commit_getclogp (nfc)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -879,6 +879,19 @@ sub parsechangelog { return $c; } +sub commit_getclogp ($) { + # Returns the parsed changelog hashref for a particular commit + my ($objid) = @_; + our %commit_getclogp_memo; + my $memo = $commit_getclogp_memo{$objid}; + return $memo if $memo; + mkpath '.git/dgit'; + my $mclog = ".git/dgit/clog-$objid"; + runcmd shell_cmd "exec >$mclog", @git, qw(cat-file blob), + "$objid:debian/changelog"; + $commit_getclogp_memo{$objid} = parsechangelog("-l$mclog"); +} + sub must_getcwd () { my $d = getcwd(); defined $d or fail "getcwd failed: $!"; @@ -1787,14 +1800,9 @@ END } sub mergeinfo_getclogp ($) { - my ($mi) = @_; # Ensures thit $mi->{Clogp} exists and returns it - return $mi->{Clogp} if $mi->{Clogp}; - my $mclog = ".git/dgit/clog-$mi->{Commit}"; - mkpath '.git/dgit'; - runcmd shell_cmd "exec >$mclog", @git, qw(cat-file blob), - "$mi->{Commit}:debian/changelog"; - $mi->{Clogp} = parsechangelog("-l$mclog"); + my ($mi) = @_; + $mi->{Clogp} = commit_getclogp($mi->{Commit}); } sub mergeinfo_version ($) { |