~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/request.py

  • Committer: Vincent Ladeuil
  • Date: 2009-04-27 16:10:10 UTC
  • mto: (4310.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4311.
  • Revision ID: v.ladeuil+lp@free.fr-20090427161010-7swfzeagf63cpixd
Fix bug #367726 by reverting some default user handling introduced
while fixing bug #256612.

* bzrlib/transport/ssh.py:
(_paramiko_auth): Explicitly use getpass.getuser() as default
user.

* bzrlib/transport/ftp/_gssapi.py:
(GSSAPIFtpTransport._create_connection): Explicitly use
getpass.getuser() as default user.

* bzrlib/transport/ftp/__init__.py:
(FtpTransport._create_connection): Explicitly use
getpass.getuser() as default user.

* bzrlib/tests/test_sftp_transport.py:
(TestUsesAuthConfig.test_sftp_is_none_if_no_config)
(TestUsesAuthConfig.test_sftp_doesnt_prompt_username): Revert to
None as the default user.

* bzrlib/tests/test_remote.py:
(TestRemoteSSHTransportAuthentication): The really offending one:
revert to None as the default user.

* bzrlib/tests/test_config.py:
(TestAuthenticationConfig.test_username_default_no_prompt): Update
test (and some PEP8).

* bzrlib/smtp_connection.py:
(SMTPConnection._authenticate): Revert to None as the default
user.

* bzrlib/plugins/launchpad/account.py:
(_get_auth_user): Revert default value handling.

* bzrlib/config.py:
(AuthenticationConfig.get_user): Fix doc-string. Leave default
value handling to callers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
            continue
70
70
        else:
71
71
            return
72
 
    raise errors.BzrError('jail break: %r' % (abspath,))
 
72
    raise errors.JailBreak(abspath)
73
73
 
74
74
 
75
75
_install_hook()
176
176
            return client_path
177
177
        if not client_path.startswith('/'):
178
178
            client_path = '/' + client_path
 
179
        if client_path + '/' == self._root_client_path:
 
180
            return '.'
179
181
        if client_path.startswith(self._root_client_path):
180
182
            path = client_path[len(self._root_client_path):]
181
183
            relpath = urlutils.joinpath('/', path)
448
450
    'Branch.last_revision_info', 'bzrlib.smart.branch', 'SmartServerBranchRequestLastRevisionInfo')
449
451
request_handlers.register_lazy(
450
452
    'Branch.lock_write', 'bzrlib.smart.branch', 'SmartServerBranchRequestLockWrite')
451
 
request_handlers.register_lazy(
452
 
    'Branch.revision_history', 'bzrlib.smart.branch', 'SmartServerRequestRevisionHistory')
453
 
request_handlers.register_lazy(
454
 
    'Branch.set_last_revision', 'bzrlib.smart.branch', 'SmartServerBranchRequestSetLastRevision')
 
453
request_handlers.register_lazy( 'Branch.revision_history',
 
454
    'bzrlib.smart.branch', 'SmartServerRequestRevisionHistory')
 
455
request_handlers.register_lazy( 'Branch.set_config_option',
 
456
    'bzrlib.smart.branch', 'SmartServerBranchRequestSetConfigOption')
 
457
request_handlers.register_lazy( 'Branch.set_last_revision',
 
458
    'bzrlib.smart.branch', 'SmartServerBranchRequestSetLastRevision')
455
459
request_handlers.register_lazy(
456
460
    'Branch.set_last_revision_info', 'bzrlib.smart.branch',
457
461
    'SmartServerBranchRequestSetLastRevisionInfo')
459
463
    'Branch.set_last_revision_ex', 'bzrlib.smart.branch',
460
464
    'SmartServerBranchRequestSetLastRevisionEx')
461
465
request_handlers.register_lazy(
 
466
    'Branch.set_parent_location', 'bzrlib.smart.branch',
 
467
    'SmartServerBranchRequestSetParentLocation')
 
468
request_handlers.register_lazy(
462
469
    'Branch.unlock', 'bzrlib.smart.branch', 'SmartServerBranchRequestUnlock')
463
470
request_handlers.register_lazy(
464
471
    'BzrDir.cloning_metadir', 'bzrlib.smart.bzrdir',
479
486
    'BzrDir.find_repositoryV3', 'bzrlib.smart.bzrdir',
480
487
    'SmartServerRequestFindRepositoryV3')
481
488
request_handlers.register_lazy(
 
489
    'BzrDir.get_config_file', 'bzrlib.smart.bzrdir',
 
490
    'SmartServerBzrDirRequestConfigFile')
 
491
request_handlers.register_lazy(
482
492
    'BzrDirFormat.initialize', 'bzrlib.smart.bzrdir',
483
493
    'SmartServerRequestInitializeBzrDir')
484
494
request_handlers.register_lazy(
 
495
    'BzrDirFormat.initialize_ex', 'bzrlib.smart.bzrdir',
 
496
    'SmartServerRequestBzrDirInitializeEx')
 
497
request_handlers.register_lazy(
 
498
    'BzrDir.open', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir')
 
499
request_handlers.register_lazy(
485
500
    'BzrDir.open_branch', 'bzrlib.smart.bzrdir',
486
501
    'SmartServerRequestOpenBranch')
487
502
request_handlers.register_lazy(
551
566
    'stat', 'bzrlib.smart.vfs', 'StatRequest')
552
567
request_handlers.register_lazy(
553
568
    'Transport.is_readonly', 'bzrlib.smart.request', 'SmartServerIsReadonly')
554
 
request_handlers.register_lazy(
555
 
    'BzrDir.open', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir')