debug:
-.PHONY: ChangeLog.xml ChangeHistory.xml $(SVN_INFO_FILE)
+.PHONY: ChangeLog.xml ChangeHistory.xml
RELEASE-NOTES.html: RELEASE-NOTES.xml NEWS.xml
$(XINCLUDE) $< > RELEASE-NOTES-TMP.xml
else
ifeq ($(PDF_MAKER),dblatex)
$(XSLT) RELEASE-NOTES-TMP.xml $(STRIP_NS) RELEASE-NOTES-STRIPPED-TMP.xml \
- -$(DBLATEX) $(DBLATEX_FLAGS) \
+ && $(DBLATEX) $(DBLATEX_FLAGS) \
-p $(DBX_STYLE) \
-o $@ \
RELEASE-NOTES-STRIPPED-TMP.xml
$(MAKE) -C $(dir $(MARKUP_XSL))
NEWS.xml: ChangeLog.xml
- $(XSLT) $< $(SVNLOG2DOCBOOK) $@ \
- repositoryRoot="$(REPOSITORY_ROOT)" \
- distroParentUrl="$(DISTRO_PARENT_URL)" \
- distro="$(DISTRO)" \
+ $(XSLT) $< $(GITLOG2DOCBOOK) $@ \
previous-release="$(PREVIOUS_RELEASE)" \
release-version="$(RELVER)" \
element.file="$(DOCBOOK_ELEMENTS)" \
$(NEWSFILE): NEWS.html
$(BROWSER) $(BROWSER_OPTS) $< > $@
-$(SVN_INFO_FILE):
- $(SVN) $(SVN_OPTS) info --xml \
- | $(XMLLINT) $(XMLLINT_OPTS) --format - > $@
-
-ChangeLog.xml: $(SVN_INFO_FILE)
- $(SVN) $(SVN_OPTS) log --xml --verbose \
- -r HEAD:$(PREVIOUS_REVISION) \
- $(DISTRO_PARENT_URL) \
- $(DISTRO) $(DISTRIB_CHANGELOG_INCLUDES) \
- | $(XMLLINT) $(XMLLINT_OPTS) --format - > $@
+ChangeLog.xml:
+ python $(repo_dir)/releasetools/changelog.py > $@
ChangeHistory.xml.zip: ChangeHistory.xml
$(ZIP) $(ZIP_OPTS) $@ $<
# ChangeHistory.xml holds the whole change history for the module,
# including all subdirectories
ChangeHistory.xml:
- $(SVN) $(SVN_OPTS) log --xml --verbose > $@
+ python $(repo_dir)/releasetools/changelog.py all > $@
.CatalogManager.properties.example:
cp -p $(CATALOGMANAGER) .CatalogManager.properties.example
announce: $(ANNOUNCE_CHANGES) .announcement-text
$(RELEASE_ANNOUNCE) "$(DISTRO_TITLE)" "$(RELVER)" .announcement-text $< "$(ANNOUNCE_RECIPIENTS)"
-tag:
-ifeq (,$(shell git status --porcelain))
-ifneq (,$(shell svn info $(REPOSITORY_ROOT)/tags/$(TAG)/$(DISTRO) 2>/dev/null))
- $(SVN) $(SVN_OPTS) delete -m "deleting the $(DISTRO) $(ZIPVER) tag" \
- $(REPOSITORY_ROOT)/tags/$(TAG)/$(DISTRO)
-endif
-ifeq (,$(shell svn info $(REPOSITORY_ROOT)/tags/$(TAG) 2>/dev/null))
- $(SVN) $(SVN_OPTS) mkdir -m "creating the $(ZIPVER) tag" \
- $(REPOSITORY_ROOT)/tags/$(TAG)
-endif
- $(SVN) $(SVN_OPTS) copy -m "tagging the $(DISTRO) $(ZIPVER) release" \
- -r $(REVISION) $(DISTRO_URL) $(REPOSITORY_ROOT)/tags/$(TAG)/$(DISTRO)
-else
- @echo "Unversioned or uncommitted files found. Before tagging/uploading"
- @echo "the release, either delete the following files, add them to the"
- @echo "repository, or add them to the svn:ignore properties for their"
- @echo "parent directories."
- @echo
- @svn status
-endif
-
release-clean: clean $(RELEASE_CLEAN_TARGETS)
$(RM) TERMS.xml
$(RM) $(NEWSFILE)
$(RM) ChangeHistory.xml
$(RM) ChangeHistory.xml.zip
$(RM) ChangeLog.xml
- $(RM) $(SVN_INFO_FILE)
$(RM) RELEASE-NOTES.txt
$(RM) RELEASE-NOTES.html
$(RM) RELEASE-NOTES.fo
MARKUP_XSL=$(repo_dir)/releasetools/modified-markup.xsl
endif
-# stylesheet used in taking XML output from "svn log" and using it
-# to generate NEWS file(s) and releases notes
-ifneq ($(shell uname -s | grep -i cygwin),)
-ifeq ($(XSLTENGINE),saxon)
-SVNLOG2DOCBOOK=../releasetools/svnlog2docbook.xsl
-else
-SVNLOG2DOCBOOK=$(repo_dir)/releasetools/svnlog2docbook.xsl
-endif
-else
-SVNLOG2DOCBOOK=$(repo_dir)/releasetools/svnlog2docbook.xsl
-endif
-
-SVN_INFO_FILE=.svninfo.xml
+GITLOG2DOCBOOK=$(repo_dir)/releasetools/gitlog2docbook.xsl
PREVIOUS_RELEASE=$(shell $(XSLTPROC) --stringparam get PreviousRelease VERSION.xsl VERSION.xsl | $(GREP) $(GREPFLAGS) -v "xml version=")
DISTRO_TITLE=$(shell $(XSLTPROC) --stringparam get DistroTitle VERSION.xsl VERSION.xsl | $(GREP) $(GREPFLAGS) -v "xml version=")
-REPOSITORY_ROOT=$(shell if [ -f $(SVN_INFO_FILE) ]; then $(XSLTPROC) --stringparam expression //root $(EVALXPATH) $(SVN_INFO_FILE) | $(GREP) $(GREPFLAGS) -v "xml version="; fi)
-DISTRO_URL=$(shell if [ -f $(SVN_INFO_FILE) ]; then $(XSLTPROC) --stringparam expression //url $(EVALXPATH) $(SVN_INFO_FILE) | $(GREP) $(GREPFLAGS) -v "xml version="; fi)
-REVISION=$(shell if [ -f $(SVN_INFO_FILE) ]; then $(XSLTPROC) --stringparam expression //commit/@revision $(EVALXPATH) $(SVN_INFO_FILE) | $(GREP) $(GREPFLAGS) -v "xml version="; fi)
-DISTRO_PARENT_URL=$(dir $(basename $(DISTRO_URL)))
-
# stylesheet for stripping DB5 namespace
STRIP_NS=common/stripns.xsl
XMLLINT_OPTS=--noent
XINCLUDE=$(XMLLINT) $(XMLLINT_OPTS) --xinclude
-SVN=svn
-SVN_OPTS=
-
SED=sed
SED_OPTS=
--- /dev/null
+#!/usr/bin/env python
+
+import subprocess
+import xml.etree.ElementTree as ET
+import sys
+
+all = len(sys.argv) == 2 and sys.argv[-1] == 'all'
+
+GIT_COMMIT_FIELDS = ['id', 'author_name', 'author_email', 'date', 'message', 'paths']
+GIT_LOG_FORMAT = ['%H', '%an', '%ae', '%ad', '%s']
+#
+# git's --format specifier doesn't cover the list of files (which can be generated
+# with '--name-only' and '--name-status'.
+# To be able to identify that path list we inject a '001e' character at the very
+# beginning of each entry. Then, the list of paths is the last chunk of each entry
+# following an empty line.
+GIT_LOG_FORMAT = '%x1e' + '%x1f'.join(GIT_LOG_FORMAT)
+command = ['git', 'log', '--format=%s' % GIT_LOG_FORMAT, '--name-only']
+if not all:
+ # Determine the last release tag and limit history to then.
+ release = ['git', 'describe', '--tags', '--match', 'release/*', '--abbrev=0']
+ out = subprocess.check_output(release)
+ out = out.strip()
+ command.append('%s..HEAD'%out.decode(encoding='UTF-8'))
+out = subprocess.check_output(command)
+out = out.decode(encoding='UTF-8')
+entries = out.strip('\n\x1e').split('\x1e')
+entries = [row.strip().split('\x1f') for row in entries]
+# separate paths from message
+for entry in entries:
+ t = entry[-1].rsplit('\n\n', 1)
+ entry[-1] = t[0]
+ entry.append(len(t) == 2 and t[1].split('\n') or '')
+entries = [dict(zip(GIT_COMMIT_FIELDS, entry)) for entry in entries]
+
+builder = ET.TreeBuilder()
+builder.start('log', {})
+for e in entries:
+ builder.start('logentry', {'revision':e['id']})
+ builder.start('author', {})
+ builder.data(e['author_name'])
+ builder.end('author')
+ builder.start('date', {})
+ builder.data(e['date'])
+ builder.end('date')
+ builder.start('msg', {})
+ builder.data(e['message'])
+ builder.end('msg')
+ builder.start('paths', {})
+ for p in e['paths']:
+ builder.start('path', {})
+ builder.data(p)
+ builder.end('path')
+ builder.end('paths')
+ builder.end('logentry')
+builder.end('log')
+root = builder.close()
+print(ET.tostring(root, encoding='utf-8'))
<xsl:import href="./modified-markup.xsl" />
<xsl:include href="../xsl/lib/lib.xsl" />
- <!-- * RepositoryRoot is the same as what "svn info" shows -->
- <xsl:param name="repositoryRoot"/>
- <!-- * distroParentUrl is what "svn info" shows as "url"/URL for the parent -->
- <!-- * of the distro dir -->
- <xsl:param name="distroParentUrl"/>
- <xsl:param name="distroParentDir">
- <xsl:value-of select="substring-after($distroParentUrl,$repositoryRoot)"/>
- </xsl:param>
-
<!-- * name of main distro this changelog is for-->
- <xsl:param name="distro"/>
+ <xsl:param name="distro">xsl</xsl:param>
<!-- * file containing DocBook XSL stylesheet param names -->
<xsl:param name="param.file"/>
<para><emphasis role="strong">Note:</emphasis> This
document lists changes only since the <xsl:value-of
select="$previous-release"/> release.
- If you instead want a record of the complete list of
- changes for the codebase over its entire history, you
- can obtain one by running the following commands:
- <xsl:text>
</xsl:text>
-<screen
-><xsl:text> </xsl:text><code>svn checkout <xsl:value-of select="concat($distroParentUrl,$distro)"/></code>
-<xsl:text>
</xsl:text>
-<xsl:text> </xsl:text><code>svn log --xml --verbose <xsl:value-of select="$distro"/> > ChangeHistory.xml</code></screen></para>
- <xsl:text>
</xsl:text>
+ </para>
</abstract>
<xsl:text>
</xsl:text>
</info>
<!-- * for changed files in the $dirname subsection of the distro -->
<!-- * OR in the $dirname sibling of the distro -->
<xsl:if test="logentry[paths/path[
- starts-with(.,concat($distroParentDir,$distro,'/',$dirname,'/'))
- or starts-with(.,concat($distroParentDir,$dirname,'/'))]]
+ starts-with(.,concat($distro,'/',$dirname,'/'))
+ or starts-with(.,concat($dirname,'/'))]]
">
<sect2>
<!-- * the ID on each Sect2 is the release version plus the -->
<xsl:for-each
select="
logentry[paths/path[
- starts-with(.,concat($distroParentDir,$distro,'/',$dirname,'/'))
- or starts-with(.,concat($distroParentDir,$dirname,'/'))]]
+ starts-with(.,concat($distro,'/',$dirname,'/'))
+ or starts-with(.,concat($dirname,'/'))]]
">
<!-- * each Lisitem corresponds to a single commit -->
<listitem>
<!-- * that we are currently formatting -->
<xsl:for-each select="
paths/path[
- starts-with(.,concat($distroParentDir,$distro,'/',$dirname,'/'))
- or starts-with(.,concat($distroParentDir,$dirname,'/'))]
+ starts-with(.,concat($distro,'/',$dirname,'/'))
+ or starts-with(.,concat($dirname,'/'))]
">
<!-- * for each changed file we list, we don't want to show -->
<!-- * its whole repository path back to the repository -->
<xsl:variable name="pathprefix">
<xsl:choose>
<!-- * first case, changed file is in a subdir of distro -->
- <xsl:when test="contains(.,(concat($distroParentDir,$dirname,'/')))">
- <xsl:value-of select="concat($distroParentDir,$dirname,'/')"/>
+ <xsl:when test="contains(.,(concat($dirname,'/')))">
+ <xsl:value-of select="concat($dirname,'/')"/>
</xsl:when>
<!-- * other case, changed file is in a sibling dir of distro -->
<xsl:otherwise>
- <xsl:value-of select="concat($distroParentDir,$distro,'/',$dirname,'/')"/>
+ <xsl:value-of select="concat($distro,'/',$dirname,'/')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
-: Makefile 9654 2012-10-28 22:54:32Z stefan $
+export repo_dir ?= $(abspath ../)
include $(repo_dir)/buildtools/Makefile.incl
include $(repo_dir)/releasetools/Variables.mk
</abstract>
</info>
+<section condition="snapshot" xml:id="current">
+ <xi:include href="NEWS.xml" xpointer="xmlns(d=http://docbook.org/ns/docbook) xpointer(/d:article/d:section/*)"/>
+</section>
<section xml:id="V1.79.1">
<title>Release Notes: 1.79.1</title>
<para>The following is a list of changes that have been made