Bug in smart server client for bzr+https://

John Ferlito johnf at inodes.org
Sun Feb 24 11:43:33 GMT 2008


There was a regression in the changes in revision 3104.4.4 which
caused bzr+https:// to stop working. Patch below.

=== modified file 'bzrlib/smart/client.py'
--- bzrlib/smart/client.py  2008-01-24 03:21:43 +0000
+++ bzrlib/smart/client.py  2008-02-24 11:38:40 +0000
@@ -87,7 +87,8 @@
         anything but path, so it is only safe to use it in requests sent over
         the medium from the matching transport.
         """
-        if self._shared_connection.base.startswith('bzr+http://'):
+        base = self._shared_connection.base
+        if base.startswith('bzr+http://') or base.startswith('bzr+https://'):
             medium_base = self._shared_connection.base
         else:
             medium_base = urlutils.join(self._shared_connection.base, '/')

After applying this patch an update progresses further until hitting
the stack trace below.

The following patch fixes the problem but I'm not quite sure its the right
place to fix it

=== modified file 'bzrlib/transport/http/_urllib.py'
--- bzrlib/transport/http/_urllib.py    2007-12-20 16:36:44 +0000
+++ bzrlib/transport/http/_urllib.py    2008-02-24 11:42:54 +0000
@@ -48,6 +48,7 @@
             self._opener = _from_transport._opener
         else:
             self._opener = self._opener_class()
+        self._remote_is_at_least_1_2 = True
 
     def _perform(self, request):
         """Send the request to the server and handles common errors.



bzr: ERROR: exceptions.AttributeError: 'HttpTransport_urllib' object has no attribute '_remote_is_at_least_1_2'

Traceback (most recent call last):
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/commands.py", line 834, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/commands.py", line 790, in run_bzr
    ret = run(*run_argv)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/builtins.py", line 990, in run
    accelerator_tree)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/branch.py", line 783, in create_checkout
    checkout_branch.pull(self, stop_revision=revision_id)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/branch.py", line 1727, in pull
    run_hooks=run_hooks)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/branch.py", line 1526, in pull
    self.update_revisions(source, stop_revision, overwrite=overwrite)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/branch.py", line 1478, in update_revisions
    self.fetch(other, stop_revision)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/branch.py", line 286, in fetch
    pb=nested_pb)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/repository.py", line 949, in fetch
    return inter.fetch(revision_id=revision_id, pb=pb, find_ghosts=find_ghosts)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/repository.py", line 2960, in fetch
    pb=pb, find_ghosts=find_ghosts)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/fetch.py", line 109, in __init__
    self.__fetch()
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/fetch.py", line 135, in __fetch
    search = self._revids_to_fetch()
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/fetch.py", line 208, in _revids_to_fetch
    find_ghosts=self.find_ghosts)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/decorators.py", line 127, in read_locked
    return unbound(self, *args, **kwargs)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/repository.py", line 871, in search_missing_revision_ids
    revision_id, find_ghosts)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/decorators.py", line 127, in read_locked
    return unbound(self, *args, **kwargs)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/repository.py", line 2431, in search_missing_revision_ids
    return self._walk_to_common_revisions([revision_id])
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/repository.py", line 2385, in _walk_to_common_revisions
    next_revs, ghosts = searcher.next_with_ghosts()
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/graph.py", line 572, in next_with_ghosts
    self._advance()
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/graph.py", line 582, in _advance
    found, ghosts, next, parents = self._do_query(self._next_query)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/graph.py", line 605, in _do_query
    parent_map = self._parents_provider.get_parent_map(revisions)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/remote.py", line 803, in get_parent_map
    parent_map = self._get_parent_map(missing_revisions)
  File "/home/johnf/tmp/bzr.bugfixes/bzrlib/remote.py", line 837, in _get_parent_map
    if not medium._remote_is_at_least_1_2:
AttributeError: 'HttpTransport_urllib' object has no attribute '_remote_is_at_least_1_2'

bzr 1.3.0.dev.0 on python 2.5.2.alpha.0 (linux2)
arguments: ['../bzr', 'co', 'bzr+https://bzr.team.vquence.com/sysadmin/tools/amazon-ami']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_AU.UTF-8'
plugins:
  launchpad            /home/johnf/tmp/bzr.bugfixes/bzrlib/plugins/launchpad [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.



-- 
John
http://www.inodes.org/



More information about the bazaar mailing list