Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 78F8E100DF for ; Wed, 31 Jul 2013 15:25:46 +0000 (UTC) Received: (qmail 80430 invoked by uid 500); 31 Jul 2013 15:25:46 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 79929 invoked by uid 500); 31 Jul 2013 15:25:40 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 79909 invoked by uid 99); 31 Jul 2013 15:25:38 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jul 2013 15:25:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 14F6C831774; Wed, 31 Jul 2013 15:25:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: djc@apache.org To: dev@couchdb.apache.org Message-Id: <9b97caa41d2d4f7f90db1edb6f9a1354@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: Replace discuss_release.sh with discuss_release.py, works with changelog.rst. Date: Wed, 31 Jul 2013 15:25:38 +0000 (UTC) Updated Branches: refs/heads/master 72852311c -> 8b986880e Replace discuss_release.sh with discuss_release.py, works with changelog.rst. Project: http://git-wip-us.apache.org/repos/asf/couchdb-admin/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-admin/commit/8b986880 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-admin/tree/8b986880 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-admin/diff/8b986880 Branch: refs/heads/master Commit: 8b986880ef7813ea67a93abe02d73b5d86289265 Parents: 7285231 Author: Dirkjan Ochtman Authored: Wed Jul 31 17:25:15 2013 +0200 Committer: Dirkjan Ochtman Committed: Wed Jul 31 17:25:15 2013 +0200 ---------------------------------------------------------------------- email/discuss_release.py | 94 ++++++++++++++++++++++++++++++++++++ email/discuss_release.sh | 107 ----------------------------------------- email/discuss_release.txt | 10 ++-- 3 files changed, 97 insertions(+), 114 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-admin/blob/8b986880/email/discuss_release.py ---------------------------------------------------------------------- diff --git a/email/discuss_release.py b/email/discuss_release.py new file mode 100755 index 0000000..875ba36 --- /dev/null +++ b/email/discuss_release.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python + +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# This script is for use by committers. +# +# It should be used in accordance with the project release procedure. +# +# cf. http://wiki.apache.org/couchdb/Release_Procedure + +from docutils import core +import sys, os, tempfile + +EMAIL_TPL = 'discuss_release.txt' + +def red(s): + return '\033[1;31m%s\033[0m' % s + +def get_section(doc_path, version): + + version_info = version.split('.') + if version_info[2] == '0': + branch = '.'.join(version_info[:2]) + '.x Branch' + start = lambda x: x.startswith(branch) + end = lambda x: x.rstrip().endswith('.x Branch') + else: + start = lambda x: x.startswith('Version ' + version) + end = lambda x: x.startswith('Version ') + + state, lines = 0, [] + with open(doc_path) as f: + for ln in f: + #print state, ln, start(ln), end(ln) + #raw_input('') + if state == 0 and start(ln): + state = 1 + elif state == 1 and end(ln): + break + if state: + lines.append(ln) + + if version_info[2] == '0': + return ''.join(lines[7:]).rstrip() + else: + return ''.join(lines[3:]).rstrip() + +def main(cache, branch, version): + + dir = os.path.dirname(os.path.abspath(__file__)) + with open(os.path.join(dir, EMAIL_TPL)) as f: + tpl = f.read() + + print red('Parsing documentation') + changelog_fn = os.path.join(cache, 'branch', branch, 'changelog.rst') + changelog = get_section(changelog_fn, version) + + tpl = tpl.replace('%VERSION%', version) + tpl = tpl.replace('%CHANGELOG%', changelog) + print 'Email text:' + print tpl + print 'Send the email to: dev@couchdb.apache.org' + +if __name__ == '__main__': + + if len(sys.argv) < 2: + print 'Usage: discuss_release.py ' + sys.exit(0) + + if not os.path.isdir(sys.argv[1]): + print 'error: no cache directory' + sys.exit(1) + + cache = sys.argv[1] + if len(sys.argv) < 3: + print 'error: no branch' + sys.exit(1) + + branch = sys.argv[2] + if len(sys.argv) < 4: + print 'error: no version' + sys.exit(1) + + version = sys.argv[3] + main(cache, branch, version) http://git-wip-us.apache.org/repos/asf/couchdb-admin/blob/8b986880/email/discuss_release.sh ---------------------------------------------------------------------- diff --git a/email/discuss_release.sh b/email/discuss_release.sh deleted file mode 100755 index 2db7d71..0000000 --- a/email/discuss_release.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh -e - -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -# This script is for use by committers. -# -# It should be used in accordance with the project release procedure. -# -# cf. http://wiki.apache.org/couchdb/Release_Procedure - -GIT_URL="https://git-wip-us.apache.org/repos/asf?p=couchdb.git;a=blob_plain;" - -EMAIL_TPL=discuss_release.txt - -if test -n "$1"; then - cache_dir=$1 -else - echo "error: no cache directory" - exit 1 -fi - -if test -n "$2"; then - branch=$2 -else - echo "error: no branch" - exit 1 -fi - -if test -n "$3"; then - version=$3 -else - echo "error: no version" - exit 1 -fi - -log () { - printf "\033[1;31m$1\033[0m\n" -} - -cd `dirname $0` - -basename=`basename $0` - -tmp_dir=`mktemp -d /tmp/$basename.XXXXXX` || exit 1 - -log "Parsing documentation..." - -email_in_file=$tmp_dir/email.txt.in - -cat $EMAIL_TPL > $email_in_file - -python < $email_file - -echo "Email text written to:" $email_file - -echo "Send the email to: dev@couchdb.apache.org" - -echo "Files in: $tmp_dir" http://git-wip-us.apache.org/repos/asf/couchdb-admin/blob/8b986880/email/discuss_release.txt ---------------------------------------------------------------------- diff --git a/email/discuss_release.txt b/email/discuss_release.txt index a44204a..ef7c979 100644 --- a/email/discuss_release.txt +++ b/email/discuss_release.txt @@ -9,14 +9,10 @@ I would like to propose that we release Apache CouchDB %VERSION%. The project aims to produce time-based releases. If your favourite feature is not ready for this version, it can be included in the next version. However, if you know of anything that should block the release, please speak up now. -The %VERSION% NEWS entry as it stands: +The %VERSION% changelog as it stands: -%NEWS% +%CHANGELOG% -The %VERSION% CHANGES entry as it stands: - - %CHANGES% - -Are these accurate? Please double check any work you may have done and make sure that the corresponding NEWS and CHANGES entries are up-to-date. +Are these accurate? Please double check any work you may have done and make sure that the corresponding changelog entries are up-to-date. Thanks,