Hey Folks,

I've managed to narrow it down some more. It appears to be a problem in 
scmtools/svn/pysvn.py.

    def _do_on_path(self, cb, path, revision=HEAD):
        if not path:
            raise FileNotFoundError(path, revision)

        try:
            # path == 
"src/cws/QMS/Entities/NonconformanceBase#cws-nativeentity#.cws"
            normpath = self.normalize_path(path)
            # normpath == 
"https://subversion.ourdomain.net/repos/bpm-spa/trunk/applications/qualitycenter/src/cws/QMS/Entities/NonconformanceBase#cws-nativeentity#.cws";

            # SVN expects to have URLs escaped. Take care to only
            # escape the path part of the URL.
            if self.client.is_url(normpath):
                pathtuple = urlsplit(normpath)
                path = pathtuple[2]
                if isinstance(path, six.text_type):
                    path = path.encode('utf-8', 'ignore')
                normpath = urlunsplit((pathtuple[0],
                                       pathtuple[1],
                                       quote(path),
                                       '', ''))

            # normpath == 
"https://subversion.ourdomain.net/repos/bpm-spa/trunk/applications/qualitycenter/src/cws/QMS/Entities/NonconformanceBase";
            normrev = self._normalize_revision(revision)
            return cb(normpath, normrev)


As you can see, it combines the path naively into a URL without escaping 
any characters, then tries to parse it as a URL to URL-escape the path 
portion of it, which obviously won't work.

I was able to fix my problem by changing the code as below. It didn't make 
any sense to me that it would parse it as a URL before escaping it, so I 
removed that whole section of the code and just encoded the file path 
before normalizing it.
    def _do_on_path(self, cb, path, revision=HEAD):
        if not path:
            raise FileNotFoundError(path, revision)

        try:
            normpath = self.normalize_path(quote(path.encode('utf-8', 
'ignore')))

            normrev = self._normalize_revision(revision)
            return cb(normpath, normrev)


If this makes sense, should I open a review with my proposed changes?

On Thursday, 22 August 2019 13:34:16 UTC-6, Rob Petti wrote:
>
> Hi Folks,
>
> We're having an issue with one of our SVN repositories right now. It 
> appears almost as if ReviewBoard can't handle files that contain "#" in 
> their names. I've attached a screenshot of the error. Of particular note is 
> that the error seems to suggest that it's truncating the filename from '#' 
> and erroneously trying to use that to locate the file in the repository.
>
> Would anyone know how to overcome this problem? Obviously we could work 
> around it by changing the file names, but this is a naming convention 
> that's required by our product and cannot be changed.
>
> Thanks!
> ~Rob
>

-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/reviewboard/533d838b-61ab-4263-a1c6-2dbd3a0b61e7%40googlegroups.com.

Reply via email to