Rev 4017: (Jelmer) Point out bzr+ssh:// to the user when they use ssh://. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Feb 18 13:27:11 GMT 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4017
revision-id: pqm at pqm.ubuntu.com-20090218132708-okubrahz9exvae9r
parent: pqm at pqm.ubuntu.com-20090218094117-mum4jrw92j9ijj01
parent: jelmer at samba.org-20090218124823-acyczvvcfq9ztg3s
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2009-02-18 13:27:08 +0000
message:
  (Jelmer) Point out bzr+ssh:// to the user when they use ssh://.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/tests/test_transport.py testtransport.py-20050718175618-e5cdb99f4555ddce
  bzrlib/transport/__init__.py   transport.py-20050711165921-4978aa7ce1285ad5
  bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
    ------------------------------------------------------------
    revno: 4011.4.3
    revision-id: jelmer at samba.org-20090218124823-acyczvvcfq9ztg3s
    parent: jelmer at samba.org-20090218122204-1lc50dqq145kvd73
    parent: pqm at pqm.ubuntu.com-20090218094117-mum4jrw92j9ijj01
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: ssh-hints
    timestamp: Wed 2009-02-18 13:48:23 +0100
    message:
      Merge bzr.dev.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/shelf_ui.py             shelver.py-20081005210102-33worgzwrtdw0yrm-1
      bzrlib/smart/branch.py         branch.py-20061124031907-mzh3pla28r83r97f-1
      bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
      bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
      bzrlib/tests/branch_implementations/test_hooks.py test_hooks.py-20070129154855-blhpwxmvjs07waei-1
      bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
      bzrlib/tests/bzrdir_implementations/test_bzrdir.py test_bzrdir.py-20060131065642-0ebeca5e30e30866
      bzrlib/tests/per_repository/test_add_fallback_repository.py test_add_fallback_re-20080215040003-8w9n4ck9uqdxj18m-1
      bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
      bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
      bzrlib/tests/test_shelf_ui.py  test_shelf_ui.py-20081027155203-wtcuazg85wp9u4fv-1
      bzrlib/trace.py                trace.py-20050309040759-c8ed824bdcd4748a
      bzrlib/transport/http/_urllib2_wrappers.py _urllib2_wrappers.py-20060913231729-ha9ugi48ktx481ao-1
      bzrlib/win32utils.py           win32console.py-20051021033308-123c6c929d04973d
    ------------------------------------------------------------
    revno: 4011.4.2
    revision-id: jelmer at samba.org-20090218122204-1lc50dqq145kvd73
    parent: jelmer at samba.org-20090217143926-2r3pmqphk99j72ex
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: bzr.dev
    timestamp: Wed 2009-02-18 13:22:04 +0100
    message:
      Register ssh: rather than ssh://, avoid referring to smart server, which users may not be familiar with.
    modified:
      bzrlib/tests/test_transport.py testtransport.py-20050718175618-e5cdb99f4555ddce
      bzrlib/transport/__init__.py   transport.py-20050711165921-4978aa7ce1285ad5
      bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
    ------------------------------------------------------------
    revno: 4011.4.1
    revision-id: jelmer at samba.org-20090217143926-2r3pmqphk99j72ex
    parent: pqm at pqm.ubuntu.com-20090216172448-vj35mjoe463c3bk2
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: bzr.dev
    timestamp: Tue 2009-02-17 15:39:26 +0100
    message:
      Point out bzr+ssh:// to the user when they use ssh://.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/tests/test_transport.py testtransport.py-20050718175618-e5cdb99f4555ddce
      bzrlib/transport/__init__.py   transport.py-20050711165921-4978aa7ce1285ad5
      bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
=== modified file 'NEWS'
--- a/NEWS	2009-02-18 09:00:55 +0000
+++ b/NEWS	2009-02-18 12:48:23 +0000
@@ -30,6 +30,9 @@
       generation of a working tree in the new branch.
       (Daniel Watkins, John Klinger, #273993)
 
+    * Bazaar will now point out ``bzr+ssh://`` to the user when they 
+      use ssh://. (Jelmer Vernooij, #330535)
+
     * Support for GSSAPI authentication when using HTTP or HTTPS. 
       (Jelmer Vernooij)
 

=== modified file 'bzrlib/tests/test_transport.py'
--- a/bzrlib/tests/test_transport.py	2008-12-09 14:04:01 +0000
+++ b/bzrlib/tests/test_transport.py	2009-02-18 12:22:04 +0000
@@ -123,6 +123,19 @@
         finally:
             _set_protocol_handlers(saved_handlers)
 
+    def test_ssh_hints(self):
+        """Transport ssh:// should raise an error pointing out bzr+ssh://"""
+        try:
+            get_transport('ssh://fooserver/foo')
+        except UnsupportedProtocol, e:
+            e_str = str(e)
+            self.assertEquals('Unsupported protocol'
+                              ' for url "ssh://fooserver/foo":'
+                              ' bzr supports bzr+ssh to operate over ssh, use "bzr+ssh://fooserver/foo".', 
+                              str(e))
+        else:
+            self.fail('Did not raise UnsupportedProtocol')
+
     def test_LateReadError(self):
         """The LateReadError helper should raise on read()."""
         a_file = LateReadError('a path')

=== modified file 'bzrlib/transport/__init__.py'
--- a/bzrlib/transport/__init__.py	2008-12-24 07:37:37 +0000
+++ b/bzrlib/transport/__init__.py	2009-02-18 12:22:04 +0000
@@ -1879,3 +1879,7 @@
             register_netloc=True)
 register_lazy_transport('bzr+ssh://', 'bzrlib.transport.remote',
                         'RemoteSSHTransport')
+
+register_transport_proto('ssh:')
+register_lazy_transport('ssh:', 'bzrlib.transport.remote', 
+                        'HintingSSHTransport')

=== modified file 'bzrlib/transport/remote.py'
--- a/bzrlib/transport/remote.py	2008-12-04 17:12:46 +0000
+++ b/bzrlib/transport/remote.py	2009-02-18 12:22:04 +0000
@@ -580,6 +580,14 @@
             return redirected
 
 
+class HintingSSHTransport(transport.Transport):
+    """Simple transport that handles ssh:// and points out bzr+ssh://."""
+
+    def __init__(self, url):
+        raise errors.UnsupportedProtocol(url, 
+            'bzr supports bzr+ssh to operate over ssh, use "bzr+%s".' % url)
+
+
 def get_test_permutations():
     """Return (transport, server) permutations for testing."""
     ### We may need a little more test framework support to construct an




More information about the bazaar-commits mailing list