[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Change prevprops in pre-commit

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Mon, 8 Sep 2014 15:22:25 +0100

Philip Martin wrote:
> Sergey Azarkevich <azarkevich_at_gmail.com> writes:
>
>>  I see in pre-commit hook template that changing revisions properties in
>>  transaction are allowed.
>>  But I can't find way for it (I want change svn:author to more readable).
>>
>>  Is here way for this with svn, svnadmin, svnlook ... or other standard
>>  tool? Or I should use Subversion API and write simple tool?
>
> I think we should provide command line support for setting txnprops.
> The code is simple enough, the iterface is a bit harder.  There was was
> some debate on IRC as to whether it should be
>
>    svnlook propset -t txn
>
> or
>
>    svnadmin settxnprop -t txn

or

   svnadmin setrevprop -t txn

is another reasonable option.

> For svnlook it means adding a write subcommand to a program that at
> present is read-only.  If we add "-r REV" support to be consistent
> with
> other subcommands then we would then need further options to run/bypass
> hooks. This would then overlap with the existing "svnadmin
> setrevprop".
>
> For svnadmin it means that a pre-commit needs to use different programs
> for reading and writing txnprops rather than just using svnlook, and the
> name new name "settxnprop" is a different pattern from the existing
> "propget" name.
>
> We will probably need some way to delete txnprops as well.  There is
> currently a new-in-1.9 "svnadmin delrevprop" to delete revision
> properties, so either "svnlook propdel" or "svnadmin
> deltxnprop".

or, again, "svnadmin delrevprop -t TXN ...".

> Or perhaps the new subcommand to set txnprops should allow a way to
> delete as well?

For reference, the rev-prop/txn-prop commands currently available in 'svnadmin' and 'svnlook' are:

svnadmin
   setlog     -r REV [--bypass-hooks] FILE
   setrevprop -r REV [--use-pre|post-revprop-change-hook] NAME FILE
   delrevprop -r REV [--use-pre|post-revprop-change-hook] NAME  # new for 1.9

svnlook
   author   [-t TXN|-r REV]
   date     [-t TXN|-r REV]
   log      [-t TXN|-r REV]
   propget  [-t TXN|-r REV] --revprop NAME
   proplist [-t TXN|-r REV] --revprop

Notice that there is already a lot of inconsistency in the commands and their options.

'svnlook' has so far been read-only, as the name 'svnlook' implies. That could change, although some people may be uncomfortable with that.

An option to use or bypass the hooks is needed for commands that write to a rev-prop, but not applicable when writing to a txn-prop nor when reading any properties.

The 'svn' program can also read/write rev-props, but it cannot access txn-props, and can't bypass the hooks.

Note also that the commands for setting and querying locks are distributed between 'svnadmin' and 'svnlook' in a non-obvious way too. I mention this because locks are another of the three  main sorts of user data in a repository, along with the versioned trees and rev-props. If we are going to make a decision about the user interface for reading and writing revprops, we might want to give some consideration to the UI for locks at the same time.

- Julian
Received on 2014-09-08 16:29:38 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.