~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/remote.py

  • Committer: Martin Pool
  • Date: 2008-04-24 07:22:53 UTC
  • mto: This revision was merged to the branch mainline in revision 3415.
  • Revision ID: mbp@sourcefrog.net-20080424072253-opmjij7xfy38w27f
Remove every assert statement from bzrlib!

Depending on the context they are:

 * turned into an explicit if/raise of either AssertionError 
   or something more specific -- particularly where they protect
   programming interfaces, complex invariants, or data file integrity
 * removed, if they're redundant with a later check, not protecting
   a meaningful invariant
 * turned into a selftest method on tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
457
457
    """
458
458
 
459
459
    def _build_medium(self):
460
 
        assert self.base.startswith('bzr://')
461
460
        return medium.SmartTCPClientMedium(self._host, self._port), None
462
461
 
463
462
 
469
468
    """
470
469
 
471
470
    def _build_medium(self):
472
 
        assert self.base.startswith('bzr+ssh://')
473
471
        # ssh will prompt the user for a password if needed and if none is
474
472
        # provided but it will not give it back, so no credentials can be
475
473
        # stored.
491
489
    """
492
490
 
493
491
    def __init__(self, base, _from_transport=None, http_transport=None):
494
 
        assert ( base.startswith('bzr+http://') or base.startswith('bzr+https://') )
495
 
 
496
492
        if http_transport is None:
497
493
            # FIXME: the password may be lost here because it appears in the
498
494
            # url only for an intial construction (when the url came from the