[PRIVATELY FIXED] SVN Repositories with Spaces (%20)

Former SVN Browser
dave.barker
Posts: 4
Joined: Wed Dec 17, 2008 10:47 pm

[PRIVATELY FIXED] SVN Repositories with Spaces (%20)

Postby dave.barker » Thu Jan 08, 2009 10:00 am

I have had an issue with repositories with spaces, we have a multi-repository setup here and the repositories without spaces works fine but repositories with spaces do not work and fail with an invalid location error.

After much dramas with Marven (You guys are using Maven 1 and not 2) and the POM file does not correctly build the WAR file! After these were fixed I managed to work out what the issue is.

-- now this is where you hand over the cash :wink:

Ok; well maybe not the cash but hopefully it helps someone out there:

The file DataProvider.java has the following lines in the connect() method:

Code: Select all

           if (ConfigurationProvider.getInstance().isMultiRepositoryMode()) {
              SVNURL s = this.repository.getRepositoryRoot(true);
              if (url.equals(s.toString())) {
                 this.repository.setLocation(SVNURL.parseURIDecoded(url), false);
              } else if (url.indexOf(s.toString() + "/") != -1) {               
                 this.repository.setLocation(SVNURL.parseURIDecoded(url), false);
              } else {
                 throw new DataProviderException("Incorrect location");
              }                                            
           }


The issue here is that the SVNURL class toString() method is returning a Encoded string (not decoded) which is what the URL that is being passed in is! So the above code will attempt to compare "My%20Repository" with "My Repository" and guess what they are not equal and therfore we drop out with an incorrect location.

So the fix is the SVNURL has a method called toDecodedString() so all we need to do is replace the toString() with toDecodedString() in the if statement above and it magically works! So the code would look something like (with some extra debug that I put in to try and work out what is going on). This issue could also be affecting any characters that are encoded that may be in a repository name (i18n characters?):

Code: Select all

           if (ConfigurationProvider.getInstance().isMultiRepositoryMode()) {
              SVNURL s = this.repository.getRepositoryRoot(true);
              if (url.equals(s.toDecodedString())) {
                 this.repository.setLocation(SVNURL.parseURIDecoded(url), false);
              } else if (url.indexOf(s.toDecodedString() + "/") != -1) {               
                 this.repository.setLocation(SVNURL.parseURIDecoded(url), false);
              } else {
                 throw new DataProviderException("Incorrect location:\nURL = '" + url +
                  "'\nDECODED URL = '" + SVNURL.parseURIDecoded(url) + "'" +
                  "\nROOT = '" + s.toDecodedString() + "'"); //CHANGE: Need to know what the URL is.
              }                                            
           }


Hope this helps someone out there, I think svnwebclient is pretty good its a bit of a learning curve and it is not well documented but you can with some effort get it to work :lol:

Dave.
Last edited by dave.barker on Tue Feb 22, 2011 4:13 pm, edited 1 time in total.

dave.barker
Posts: 4
Joined: Wed Dec 17, 2008 10:47 pm

Re: [FIXED] SVN Repositories with Spaces (%20)

Postby dave.barker » Tue Feb 22, 2011 4:13 pm

So after a year and a bit this has still not been officially fixed and this forum has dried up

Polarion where are you!?

NickEntin
Posts: 472
Joined: Tue Oct 24, 2006 10:27 am
Location: Polarion Software GmbH, Stuttgart
Contact:

Re: [PRIVATELY FIXED] SVN Repositories with Spaces (%20)

Postby NickEntin » Fri Mar 04, 2011 10:50 am

Hi Dave,
Thanks for the reminder! ;-)

Now it's fixed in the code and will be published soon (alone with next Service Release of Polarion) in Polarion product and in standalone SVNWebClient.

But the sources are already updated.

Best regards,
Nick

dave.barker
Posts: 4
Joined: Wed Dec 17, 2008 10:47 pm

Re: [PRIVATELY FIXED] SVN Repositories with Spaces (%20)

Postby dave.barker » Mon Mar 07, 2011 5:17 am

Glad to hear that this has been fixed, have you upgraded maven too?

Cheers & Thanks

Dave


Return to “Polarion SVN Web Client”

Who is online

Users browsing this forum: No registered users and 2 guests