[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Subversion repository] Update of previous commit messages



On Wed, 03 Mar 2010 21:45:30 +0100, Franck Joncourt wrote:

> The Subversion repository at svn.debian.org (/svn/pkg-perl) now allows users to
> update their commit messages afterwards.

Merci bien !
 
>  $ svn propset -r 53490 --revprop svn:log "my msg without mistake"

Since I won't remember this command, I've wrapped it in a small shell
script (attached just in case ...).
 
Cheers,
gregor
 
-- 
 .''`.   http://info.comodo.priv.at/ -- GPG Key IDs: 0x8649AA06, 0x00F3CFE4
 : :' :  Debian GNU/Linux user, admin, & developer - http://www.debian.org/
 `. `'   Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe
   `-    NP: Sting: If you love somebody
#!/bin/bash

# svn-amend
# change svn commit messages retro-actively
# Copyright 2010, gregor herrmann <gregoa@debian.org>
# Released under the GNU GPL version 2 (or later)

set -eu

# helpers

usage() {
	echo "Usage: $(basename $0) REVISION \"NEW MESSAGE\""
}

die() {
	echo "E: $1"
	usage
	exit 1
}

#checks

[ -d ".svn" ] || die "$PWD doesn't look like a subversion working directory."

if [ "$#" = "1" ] ; then 
	[ "$1" = "-h" ] && usage && exit 0
fi

[ "$#" = "2" ] || die "Wrong number of arguments."

# main

REV="$1"
MSG="$2"

[[ "$REV" =~ ^[0-9]+$ ]] || die "REVISION must be a number (without leading 'r')."

read -n 1 -p "Change commit message for r${REV} to \"${MSG}\"? y/N " PROMPT
if [ "$PROMPT" = "y" ]; then
	echo
	svn propset -r "$REV" --revprop svn:log "$MSG"
fi

Attachment: signature.asc
Description: Digital signature


Reply to: