M
M
Maxim2012-09-25 06:40:00
subversion
Maxim, 2012-09-25 06:40:00

Need working example of changing svn:log in svn pre-commit hook

Need a working example of changing svn:log in svn pre-commit hook in any language.
A more general example of changing anything from the TXN would also work.

Google gives a million proofs that this is possible, but does not give a single example.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ivnik, 2012-09-25
@maxout

For example here: svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/log-police.py
Look for the fix_rev function:

def fix_rev(fs, revnum):
  "Fix up the log message for revision REVNUM in FS.  See fix_log_message()."
  log_message = svn.fs.svn_fs_revision_prop(fs, revnum, 'svn:log')
  if log_message is not None:
    new_message = fix_log_message(log_message)
    if new_message != log_message:
      svn.fs.svn_fs_change_rev_prop(fs, revnum, "svn:log", new_message)

In general, you can take “aptitude install subversion-tools”
and there will be different scripts (including this one)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question