Roland Bauerschmidt wrote:
> I have thought about that before. However, I meant to implement it this
> way: Parse debian/changelog locally, and use new entries as default for
> Subversion's changelog. It would prevent debian/changelog to be
> cluttered with entries such as "forgot to add file foo last time; really
> add it now". (Yes, you could also clean debian/changelog up before
> uploading.)

I've done this for years using the attached script (which will work with
both svn and cvs (less well), and can also tag releases).

-- 
see shy jo
#!/bin/sh -e
# Commit changes, using the current changelog as the message.
# If $1 is "release", the package is also tagged for release.

if [ -d CVS ]; then
        PROG=cvs
elif [ -d .svn ]; then
        PROG=svn 
else
        echo "not in a cvs or subversion directory" >&2
        exit 1
fi
echo "Committing with $PROG ..."

if [ "$1" = "release" ] && [ -e debian/changelog ]; then
        if head -1 debian/changelog | grep -q UNRELEASED; then
                echo "Changelog says it's UNRELEASED, bud."
                exit 1
        fi
        version=`dpkg-parsechangelog | grep Version: | cut -f 2 -d ' '`

        $PROG commit -m "releasing version $version"
elif [ "$PROG" = svn ]; then
        # use new part of changelog as commit entry
        MSG=$(svn diff debian/changelog | grep '^\+  ' | sed 's/^+//')
        if [ -n "$MSG" ]; then
                $PROG commit -m "$(svn diff debian/changelog | grep '^\+  ' | 
sed 's/^+//')"
        else
                $PROG commit -m "`dpkg-parsechangelog | grep '^  '`"
        fi
else
        # cvs is too slow for that
        $PROG commit -m "`dpkg-parsechangelog | grep '^  '`"
fi

if [ "$1" = "release" ]; then
        # Generate the tag. This is compatable with the tag cvs-buildpackage
        # uses except for debian native packages.
        newversion=`expr $version : '[0-9]:\(.*\)'` 2>/dev/null || true
        if [ "$newversion" ]; then
                version=$newversion
        fi
        if [ -d CVS ]; then
                # escape tag for cvs
                if [ "`expr $version : '.*-.*'`" -gt 0 ]; then
                        tag="debian_version_$version"
                else
                        tag="version_$version"
                fi
                tag=`echo "$tag" | tr . _`
                cvs tag -f $tag
        elif [ -d .svn ]; then
                tag="$version"
                echo "svn copy $(svnpath) $(svnpath tags)/$tag"
                if ! svn copy $(svnpath) $(svnpath tags)/$tag -m "tagging 
version $version"; then
                        echo "svn mkdir $(svnpath tags)"
                        svn mkdir "$(svnpath tags)" -m "create tag subdirectory"
                        echo "svn copy $(svnpath) $(svnpath tags)/$tag"
                        svn copy $(svnpath) $(svnpath tags)/$tag -m "tagging 
version $version"
                fi
        fi
fi

Attachment: signature.asc
Description: Digital signature

Reply via email to