PDA

View Full Version : Subversion Extension: Problems



lch
12-16-2008, 12:04 PM
hello everybody!

i want to use the subversion extension in my deki wiki v8.08. i succesfully added the extension with a configuration like this:

path-to-svn: /usr/bin/svn
svn-uri: http://10.10.10.10:7770/se

on a dekiwiki page i want to show the subversion with: {{ svn.Table{path: "projectX", limit: "5"} }}

and get the following error message:


SVN error: svn: PROPFIND request failed on '/se'
svn: PROPFIND of '/se': 403 Forbidden (http://10.200.30.20:7770)

in a browser it works fine when going to http://10.10.10.10:7770/se/projectX
also on the console on the server where dekiwiki is running the svn command is working fine on all directorys. so i think the extension is having a problems with the backslashes and it looses the /projectX somewhere because the error message is just about "/se", and this is just the base directory where all svn projects are stored.. anyone experiencing the same problem or is having an idea why this is happening?

thanks in advance, lch

MaxM
12-16-2008, 06:11 PM
Whats the command line you used? The svn extension would run the svn client with something like

svn -xml --non-interactive --limit 5 http://10.10.10.10:7770/se projectX

Also try changing the svn-uri to http://10.10.10.10:7770/se/projectX
and don't enter a path parameter.

lch
12-18-2008, 06:42 AM
hello!

the command line i used to test svn was (and it worked fine):
svn list http://10.10.10.10:7770/se/projectX --username xyz --password xyz

i tried your svn command also, but i needed to modify it slightly to get it working:
svn info --xml --non-interactive http://10.10.10.10:7770/se/projectX

i just added the "info" part in my command and used a "/" before the project X. if i use it without the "/" i get the error message in my first post. so i tried, as you mentioned, to change my svn-uri to the full path to the svn repository - this solution would work..

but:
in my root directory http://10.10.10.10:7770/se are subdirectorys which are the svn repositorys.. i would need to add an extension for every repository in there with your solution.. thats why i want to use the parameter to access such a subdirectory with a repository..

if the plugin would just concat the svn-uri and the parameter from the svn.Table command with a "/" then it would work with just one subversion extension added.

maybe we could find a workaround for this :)

best regards and thanks in advance

MaxM
12-18-2008, 06:22 PM
but:
in my root directory http://10.10.10.10:7770/se are subdirectorys which are the svn repositorys.. i would need to add an extension for every repository in there with your solution.. thats why i want to use the parameter to access such a subdirectory with a repository..

if the plugin would just concat the svn-uri and the parameter from the svn.Table command with a "/" then it would work with just one subversion extension added.


Sounds like each of your projects is its own repository. This extension was designed to work with one repo as it always specifies the repository URI and then lists path separately. You may need to either load multiple svn extensions for your projects with different namespaces to identify each or make some code changes to the extension to concatenate the path without adding a space.

This is the source to the svn extension. Feel free to make your own changes and contribute a patch

https://svn.mindtouch.com/source/public/dekiwiki/trunk/src/services/DekiServices/Extension/SubversionService.cs

lch
12-19-2008, 08:30 AM
So i have changed the extension to my needs and i want to contribute a patch. It is now working with all my repositorys, but how do i contribute the patch? Never done that before, are there some guidelines or do i just have to checkin the file in the public deki wiki svn repository ?

Thanks in Advance

MaxM
12-19-2008, 06:11 PM
Glad you got it figured out. You can attach the patch here and I'll take a look. Is it backwards compatible for existing users? Stop by our irc channel to chat if you have a chance

lch
12-22-2008, 07:28 AM
Attached is the patch/modified file and it should be backwards compatible. I introduced another config-key "svn-uri-is-base-dir" which can be assigned with true or false. "true" indicates that the given svn-uri works as base directory for the repositorys and "false" indicates that the given svn-uri works as repository itself. I think that should do the trick. It works for me :)

SteveB
12-23-2008, 10:03 AM
lch,

Why did you change the SID? Looking at your code, it appears to be backwards compatible.

Also, there is a small typo in the new config parameter description. It should say "repositories."

Other than that, it looks good to me.

lch
12-23-2008, 11:10 AM
uh sorry.. i changed the SID for local testing purposes .. should i provide another patch or is this ok?

SteveB
12-23-2008, 03:42 PM
I'll leave the final review for MaxM since he wrote the original.

MaxM
12-24-2008, 11:04 PM
In your setup each top level dir is a separate repository and it just happens that they all use the same credentials. The original intent of the space separator was to enforce that each subversion extension instance thats associated with a specific repo and credentials only functions on that repo. Using the space separator also allows multiple subdirectories to be included in the log. ie:

svn log https://svn.mindtouch.com/source/public dekiwiki dream

which can be done by invoking the extension with


{{ svn.Table{path: "dekiwiki dream"} }}

Though I guess you'd be able to accomplish the same thing with your setting enabled by doing

{{ svn.Table{path: "public dekiwiki dream"} }}
and having the svn-uri be set to https://svn.mindtouch.com/source.

I don't mind merging it in but if possible lets come up with a more fitting name for the setting :)
Maybe
enforce-svn-uri
combine-svn-uri-and-path
split-svn-uri-and-path

what do you think?

lch
12-30-2008, 06:32 AM
Hey!

I just tried your suggestion but I had no luck with it :( I will give it some thought on how we could allow multiple subdirectories also when using the new property.

Regarding the naming of the property: combine-svn-uri-and-path
I think this would be the most fitting and meaningful name in this context.