I've been working on the log-message-templates branch recently.
This branch was started by cmpilato a long time ago but for some
reason sat around untouched ever since. It's now been overhauled
by me with much help from Bert.
I believe the functionality is useful and complete. One user I have
in mind who would probably make use of this is the FreeBSD project.
They patch their Subversion clients to define a log message template
with the following content:
The patch is here:
With the changes on the log-message-templates branch, they can drop their
custom patch and add their log message template to an svn:log-template
I believe many other users might find this feature useful as well.
The current diff between the trunk and branch is this:
svn diff ^/subversion/trunk_at_1623990 ^/subversion/branches/log-message-templates_at_r1624055
Because there was quite a bit of back-and-forth on this branch
here's a quick overview of what the branch implements right now:
Introduce a new svn:log-template property. This is an inherited property
which can be used to define static log message templates to be inserted
into the default log message by the client.
This branch adds the following public API elements:
SVN_PROP_INHERITABLE_LOG_TEMPLATE: New property name.
svn_client_get_log_message_templates_for_commit_items(): New functions
which provide easy access to log templates defined for a given path
or URL, or a set of commit items.
For a given path, the svn:log-template property is always inherited
from the nearest ancestor which has the property set on itself.
For a given commit, however, the set of commit target paths is arbitrary,
so multiple templates may apply, each contributed by one or more paths
in the commit target list.
For example, with:
$ svn ci iota.txt epsilon/gamma.txt
we might see the following default log message:
--Log message template from '/'--
The root log message template.
This always applies since it is defined at the root of the repository.
--Log message template from 'trunk/epsilon'--
This is a template set on 'trunk/epsilon', which in this example
was contributed by the commit target epsilon/gamma.txt.
--This line, and those below, will be ignored--
The "--Log message template from --" line does not appear if only
a single template applies to the commit.
A rough overview of the files changed (see branch commit log for details):
(test_log_message_template): New test.
(svn_cl__make_log_msg_baton): Change 'config' hash parameter to a
client context 'ctx'. 'config' is still available as 'ctx->config'.
* subversion/svn/move-cmd.c, subversion/svn/copy-cmd.c,
subversion/svn/propedit-cmd.c: Adjust callers of svn_cl__make_log_msg_baton().
(log_msg_baton): Store entire client context instead of just the config hash.
(svn_cl__make_log_msg_baton): Adjust accordingly.
(svn_cl__get_log_message): Call the new API function
svn_client_get_log_message_templates_for_commit_items() to obtain
log templates and add the templates to the default log message.
(SVN_PROP_INHERITABLE_LOG_TEMPLATE): New property.
svn_client_get_log_message_templates_for_commit_items): New API functions.
svn_client_get_log_message_templates_for_commit_items): Provide convenient
functionality for clients wishing to support log message templates.
Received on 2014-09-10 19:06:47 CEST