Page MenuHomePhabricator

Support Subversion revprops
Open, LowPublic

Description

Subversion has a concept of "revision properties", which you can edit like this:

$ svn propedit --revprop -r <revision> <propertyname> <repositoryuri>
$ svn propset --revprop ...

These properties are not version controlled, so Subversion rejects these changes by default, emitting an error message like this:

svn: E165006: Repository has not been enabled to accept revision propchanges;
ask the administrator to create a pre-revprop-change hook

Two common use cases for revision properties are:

  • Using svnsync to mirror an existing repository, which makes some set of revprop changes as a side effect of operation (which changes?)
  • Editing svn:log to change rewrite commit messages.

To allow these changes to go through, we need to install a hook which authorizes them. The easiest way to do this is to install a trivial exit 0; hook to allow them unconditionally, but this would allow any user to change them at any time, which is potentially dangerous and undesirable. For example, it would let any user rewrite any log message at any time. It would probably be better to consider these to be "dangerous changes" and allow them only if the repository allows dangerous changes.

Better still would be to consider them "ref" changes like Git and Mercurial changes. This would allow Herald rules to execute on them, although this is significantly more complex than simply allowing them.

In the short term, we can do this:

  • Install the hook.
  • Exit 0 (allow changes) if dangerous changes are enabled on the repository.
  • Exit nonzero (prevent changes) with a message if dangerous changes are disabled.

In the longer term, we can potentially do something more sophisticated, treat these more like refs in Git and Mercurial, and expose them to Herald.