问题描述
我在 SVN 的注释中犯了一个错误.签到后可以编辑吗?
I put a mistake into a comment in SVN. Can I edit this after checkin?
推荐答案
提交消息是 "unversioned properties" 并且可以使用 svn propset 命令,例如
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'
这是在修订版 25 上设置名为svn:log"的修订版属性
This is setting the revision property called "svn:log" on revision 25
因为这些是未版本化的,除非您提供 pre-revprop-change 钩子脚本.
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.
这是一个典型的脚本,来自我系统上的/var/lib/svn/hooks/pre-revprop-change:
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
这会记录对 svn:log 修订版属性的更改,并允许使用 exit 0 进行编辑,使用 exit 1 拒绝任何其他修订版属性更改.有关 Windows 等效项,请参阅 patmortech 的答案.
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.
这篇关于我可以返回并编辑有关 SVN 签入的评论吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!