2287: Subversion repository that requires username/password cannot be neither saved, nor accessed

stro****@gmai***** (Google Code) (Is this you? Claim this profile.)
Dec. 24, 2012
What version are you running?

1.6.1

What's the URL of the page containing the problem?


What steps will reproduce the problem?
1. Trying to add new SVN repo with user name and empty password
2. Save of this repo fails, reporting authorization error
3. Manual change of reviewboard.db to save the repo details
   leads to similar authorization errors on reviews posting
   (post-review -d reports 'Login to the SCM server failed.')

Indeed I detected the root cause: it is not set "callback_get_login"
member of SVN client object defined in standard pysvn library used by svn.py of review board. The fix is attached.
import logging
import os
import re
import urllib
import urlparse
try:
    from pysvn import ClientError, Revision, opt_revision_kind
except ImportError:
    pass
from django.utils.translation import ugettext as _
from reviewboard.diffviewer.parser import DiffParser
from reviewboard.scmtools import sshutils
from reviewboard.scmtools.certs import Certificate
from reviewboard.scmtools.core import SCMTool, HEAD, PRE_CREATION, UNKNOWN
from reviewboard.scmtools.errors import SCMError, \
                                        FileNotFoundError, \
                                        UnverifiedCertificateError, \
                                        RepositoryNotFoundError
# Register these URI schemes so we can handle them properly.
sshutils.ssh_uri_schemes.append('svn+ssh')
sshutils.register_rbssh('SVN_SSH')
class SVNCertificateFailures:
    """SVN HTTPS certificate failure codes.
    These map to the various SVN HTTPS certificate failures in li
import logging
import os
import re
import urllib
import urlparse
try:
    from pysvn import ClientError, Revision, opt_revision_kind
except ImportError:
    pass
from django.utils.translation import ugettext as _
from reviewboard.diffviewer.parser import DiffParser
from reviewboard.scmtools import sshutils
from reviewboard.scmtools.certs import Certificate
from reviewboard.scmtools.core import SCMTool, HEAD, PRE_CREATION, UNKNOWN
from reviewboard.scmtools.errors import SCMError, \
                                        FileNotFoundError, \
                                        UnverifiedCertificateError, \
                                        RepositoryNotFoundError
# Register these URI schemes so we can handle them properly.
sshutils.ssh_uri_schemes.append('svn+ssh')
sshutils.register_rbssh('SVN_SSH')
class SVNCertificateFailures:
    """SVN HTTPS certificate failure codes.
    These map to the various SVN HTTPS certificate failures in li
88,91d87
<         def get_login(*args):
<             return True, repository.username, repository.password, False
<         self.client.callback_get_login = get_login
< 
283,285d278
<         def get_login(*args):
<             return True, username, password, False
<             
293d285
<         client.callback_get_login = get_login
296,297d287
<             logging.debug("SVN: Try to get repository information for %s: user='%s', pass='%s'" %
<                           (path, username, password))
david
#1 david
The new hosting services code should address this.
  • +Fixed
  • +Component-SCMTools