1

我希望我的程序员在将文件锁定在他们的工作副本中时总是放一条消息(即svn lock tree.jpg -m "reason for locking")有没有办法让预锁定挂钩知道一条消息是否已放置以及它是什么?

4

1 回答 1

1

hooks/pre-lock.tmpl在您的存储库中查找。在我的例子中,它包含以下信息,表明锁定注释是第 4 个参数:

# PRE-LOCK HOOK
#
# The pre-lock hook is invoked before an exclusive lock is
# created.  Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-lock' (for which
# this file is a template), with the following ordered arguments:
#
#   [1] REPOS-PATH   (the path to this repository)
#   [2] PATH         (the path in the repository about to be locked)
#   [3] USER         (the user creating the lock)
#   [4] COMMENT      (the comment of the lock)
#   [5] STEAL-LOCK   (1 if the user is trying to steal the lock, else 0)

...
于 2012-05-03T08:04:03.737 回答