Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
383 views
in Technique[技术] by (71.8m points)

tortoisesvn - Can I go back and edit comments on an SVN checkin?

I put a mistake into a comment in SVN. Can I edit this after checkin?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Commit messages are "unversioned properties" and can be changed with the svn propset command, for example

$ svn propset --revprop -r 25 svn:log "Journaled about trip to New York."
property 'svn:log' set on repository revision '25'

This is setting the revision property called "svn:log" on revision 25

Configuring subversion to allow revision property changes

Because these are unversioned, a default installation of subversion won't let you modify these properties unless you provide a pre-revprop-change hook script.

Here's a typical script, from /var/lib/svn/hooks/pre-revprop-change on my system:

#!/bin/sh

REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"

if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then 
  echo "$1 $2 $3 $4 $5" >> /var/lib/svn/logchanges.log
  exit 0; 
fi

echo "Changing revision properties other than svn:log is prohibited" >&2
exit 1

This logs changes to svn:log revision properties, and allows the edit by using exit 0, any other revision property change is denied by using exit 1. See patmortech's answer for a Windows equivalent.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...