pull tracebacks on a lighweight checkout of bzr:// or bzr+ssh:// branch

Bug #238149 reported by Gustavo Carneiro
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Unassigned

Bug Description

gjc@dark-tower:pybindgen$ /usr/bin/bzr pull -rrevno:429 lp:pybindgen
bzr: ERROR: exceptions.AttributeError: 'NoneType' object has no attribute 'report'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 846, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 669, in run
    result.report(self.outf)
AttributeError: 'NoneType' object has no attribute 'report'

bzr 1.5 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'pull', '-rrevno:429', 'lp:pybindgen']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  builddeb /usr/lib/python2.5/site-packages/bzrlib/plugins/builddeb [0.92.0dev0]
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.5.0]
  email /usr/lib/python2.5/site-packages/bzrlib/plugins/email [unknown]
  gnulog /home/gjc/.bazaar/plugins/gnulog.py [unknown]
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.93.0]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  pqm /usr/lib/python2.5/site-packages/bzrlib/plugins/pqm [1.0.0dev0]
  rebase /usr/lib/python2.5/site-packages/bzrlib/plugins/rebase [0.3.0]
*** 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.

If I do the same on a full branch, it works:

gjc@dark-tower:trunk$ /usr/bin/bzr pull -rrevno:429 lp:pybindgen
No revisions to pull.

Only in lighweight checkouts is this failing.

Revision history for this message
John A Meinel (jameinel) wrote :

Something does seem funny here. Specifically, I see:

if tree_to is not None:
    change_reporter = delta._ChangeReporter(
        unversioned_filter=tree_to.is_ignored)
    result = tree_to.pull(branch_from, overwrite, revision_id,
                          change_reporter,
                          possible_transports=possible_transports)

And in WT.pull I see:
count = self.branch.pull(source, overwrite, stop_revision,
                         possible_transports=possible_transports)
...
return count

So the variable shouldn't be "count" but it should still be a result object.

Actually, I found it. The problem is that RemoteBranch.pull doesn't return the Result object:

def pull(self, source, overwrite=False, stop_revision=None,
         **kwargs):
    # FIXME: This asks the real branch to run the hooks, which means
    # they're called with the wrong target branch parameter.
    # The test suite specifically allows this at present but it should be
    # fixed. It should get a _override_hook_target branch,
    # as push does. -- mbp 20070405
    self._ensure_real()
    self._real_branch.pull(
        source, overwrite=overwrite, stop_revision=stop_revision,
        **kwargs)

The fix is trivial:
=== modified file 'bzrlib/remote.py'
--- bzrlib/remote.py 2008-06-04 07:29:35 +0000
+++ bzrlib/remote.py 2008-06-07 18:51:19 +0000
@@ -1516,7 +1516,7 @@
         # fixed. It should get a _override_hook_target branch,
         # as push does. -- mbp 20070405
         self._ensure_real()
- self._real_branch.pull(
+ return self._real_branch.pull(
             source, overwrite=overwrite, stop_revision=stop_revision,
             **kwargs)

Revision history for this message
John A Meinel (jameinel) wrote :

This needs a test, but otherwise should be easy

Changed in bzr:
importance: Undecided → High
milestone: none → 1.6
status: New → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.