Pergunta

I am using the SharpSVN API to interact with Subversion repositories created with VisualSVN Server software.

I know that it is possible to set custom properties to revisions but I'm wondering if we can do the same for a repository.

For example my repository has a name that I can retrieve using the SharpSvn.SvnUriTarget class, but I'd like to also set a description to it and being able to get it using some code.

I tried to call the SharpSvn.SvnClient.SetProperty method on the repository url but I'm getting an error ("This argument is not a valid path. A Uri was specified").

If it's not possible to create custom properties for a repository, I'm thinking about creating the properties for the first revision, and then always looking for the revision number 1 and getting the properties from there if they exist.

Would you have better ideas?

Foi útil?

Solução

Subversion defines two kinds of properties: node properties (attached to a file or directory) and revision properties.

Revision properties can be changed without a commit (but require a server hook to edit after creating the revision), while revision properties are only changed via a commit.

It really depends on what you are doing, what works best. E.g. svnsync stores some revision properties on r0 to keep track of its state, while TortoiseSVN extensively uses directory properties for its state. This last variant allows different projects in the same repository to use different values.

With Subversion 1.8 retrieving properties on 'an ancestor directory' became much cheaper as we implemented an optimized (network) api for that. (Available in SharpSvn as SvnClient.InheritedPropertyList())

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top