Tweak changelog generation not to skip commits since last tag

This commit is contained in:
Alex Young
2014-02-25 16:35:51 +00:00
parent 6f540ce238
commit 2fa1ce8e6b
2 changed files with 34 additions and 7 deletions

View File

@@ -55,12 +55,12 @@ maketask :clean
file "debian/changelog" => ".hg/last-message.txt" do file "debian/changelog" => ".hg/last-message.txt" do
latesttag_cmd = "hg log -l1 --template '{latesttag}'" latesttag_cmd = "hg log -l1 --template '{latesttag}'"
latesttag = `#{latesttag_cmd}`.strip latesttag = `#{latesttag_cmd}`.strip
log_cmd = "hg log -r #{latesttag}:0 --style xml" log_cmd = "hg log --style xml"
projname = "flexnbd" projname = "flexnbd"
File.open("debian/changelog", "w") do |changelog| File.open("debian/changelog", "w") do |changelog|
IO.popen( log_cmd, "r" ) do |io| IO.popen( log_cmd, "r" ) do |io|
listener = HGChangelog::Listener.new changelog, projname listener = HGChangelog::Listener.new changelog, projname, latesttag
REXML::Document.parse_stream io, listener REXML::Document.parse_stream io, listener
io.close io.close
end end
@@ -94,7 +94,10 @@ BEGIN {
end end
def to_s def to_s
template = <<-TEMPLATE if @lines.empty?
""
else
template = <<-TEMPLATE
<%= @projname %> (<%= @tag %>-<%= @rev %>) stable; urgency=low <%= @projname %> (<%= @tag %>-<%= @rev %>) stable; urgency=low
<% for line in @lines -%> <% for line in @lines -%>
@@ -103,9 +106,10 @@ BEGIN {
-- <%= @author_name %> <<%= @email %>> <%= render_date %> -- <%= @author_name %> <<%= @email %>> <%= render_date %>
TEMPLATE TEMPLATE
ERB.new(template, nil, "-").result(binding) ERB.new(template, nil, "-").result(binding)
end
end end
def render_date def render_date
@@ -116,9 +120,10 @@ BEGIN {
class Listener class Listener
def initialize out, projname def initialize out, projname, start_tag
@out = out @out = out
@projname = projname @projname = projname
@start_tag = start_tag
end end
def method_missing(sym,*args,&blk) def method_missing(sym,*args,&blk)
@@ -128,6 +133,9 @@ BEGIN {
case name case name
when "logentry" when "logentry"
@rev = attrs['revision'] @rev = attrs['revision']
if !@entry # first time; collect stuffs for everything since last tag
@entry = ChangelogEntry.new @projname, @start_tag, @rev
end
when "author" when "author"
@email = attrs['email'] @email = attrs['email']
when "tag" when "tag"
@@ -149,7 +157,9 @@ BEGIN {
when "author" when "author"
@author_name = @text @author_name = @text
when "tag" when "tag"
@entry = ChangelogEntry.new @projname, @text, @rev if @text != "tip" # again, we want to skip the first one
@entry = ChangelogEntry.new @projname, @text, @rev
end
when "msg" when "msg"
@message = @text @message = @text
when "date" when "date"

17
debian/changelog vendored
View File

@@ -1,3 +1,20 @@
flexnbd (0.1.1-435) stable; urgency=low
* proxy: Turn on TCP_CORK
* proxy: Turn on TCP_NODELAY for the proxy->upstream leg
* client: cork/uncork around NBD_REQUEST_READ responses
* sockutil: Add a tcp_cork helper
* Remove a compile-time optional selection of O_DIRECT (was never used)
* Call srand() to make sure request handles are properly randomised
* Merge
* Add some build-depends which make doc needs
* Remove unreachable code to make -Wunreachable-code on clang useful.
* Depend on either libev4 or libev3, whichever is available
* Add asciidoc as a Build-Depends
* Update Rakefile to generate debian/changelog.
-- nick <nick@bytemark.co.uk> Tue, 25 Feb 2014 16:00:48 +0000
flexnbd (0.1.1-422) stable; urgency=low flexnbd (0.1.1-422) stable; urgency=low
* Update the Makefile to work with dpkg-buildpackage * Update the Makefile to work with dpkg-buildpackage