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
latesttag_cmd = "hg log -l1 --template '{latesttag}'"
latesttag = `#{latesttag_cmd}`.strip
log_cmd = "hg log -r #{latesttag}:0 --style xml"
log_cmd = "hg log --style xml"
projname = "flexnbd"
File.open("debian/changelog", "w") do |changelog|
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
io.close
end
@@ -94,6 +94,9 @@ BEGIN {
end
def to_s
if @lines.empty?
""
else
template = <<-TEMPLATE
<%= @projname %> (<%= @tag %>-<%= @rev %>) stable; urgency=low
@@ -107,6 +110,7 @@ BEGIN {
ERB.new(template, nil, "-").result(binding)
end
end
def render_date
DateTime.parse(@date).rfc2822
@@ -116,9 +120,10 @@ BEGIN {
class Listener
def initialize out, projname
def initialize out, projname, start_tag
@out = out
@projname = projname
@start_tag = start_tag
end
def method_missing(sym,*args,&blk)
@@ -128,6 +133,9 @@ BEGIN {
case name
when "logentry"
@rev = attrs['revision']
if !@entry # first time; collect stuffs for everything since last tag
@entry = ChangelogEntry.new @projname, @start_tag, @rev
end
when "author"
@email = attrs['email']
when "tag"
@@ -149,7 +157,9 @@ BEGIN {
when "author"
@author_name = @text
when "tag"
if @text != "tip" # again, we want to skip the first one
@entry = ChangelogEntry.new @projname, @text, @rev
end
when "msg"
@message = @text
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
* Update the Makefile to work with dpkg-buildpackage