bzr diff -r submit: on subversion branch fails

Bug #187162 reported by Ross Burton
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
Unassigned
Bazaar Subversion Plugin
Invalid
Low
Unassigned

Bug Description

When I try to get a diff from submit: on a svn branch, it fails:

$ bzr diff -r submit: src/Writer.cpp
Using parent branch http://svn.gnome.org/svn/gnome-web-photo/trunk/
bzr: ERROR: exceptions.AttributeError: 'NoneType' object has no attribute 'base'

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 806, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 762, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 772, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 1506, in run
    old_tree, new_tree, specific_files, extra_trees = \
  File "/usr/lib/python2.4/site-packages/bzrlib/diff.py", line 411, in _get_trees_to_diff
    old_tree = _get_tree_to_diff(old_revision_spec, working_tree, branch)
  File "/usr/lib/python2.4/site-packages/bzrlib/diff.py", line 449, in _get_tree_to_diff
    revision = spec.in_store(branch)
  File "/usr/lib/python2.4/site-packages/bzrlib/revisionspec.py", line 225, in in_history
    return self._match_on_and_check(branch, revs)
  File "/usr/lib/python2.4/site-packages/bzrlib/revisionspec.py", line 207, in _match_on_and_check
    info = self._match_on(branch, revs)
  File "/usr/lib/python2.4/site-packages/bzrlib/revisionspec.py", line 730, in _match_on
    return self._find_revision_info(branch, submit_location)
  File "/usr/lib/python2.4/site-packages/bzrlib/revisionspec.py", line 647, in _find_revision_info
    graph = branch.repository.get_graph(other_branch.repository)
  File "/usr/lib/python2.4/site-packages/bzrlib/repository.py", line 1720, in get_graph
    if (other_repository is not None and
AttributeError: 'NoneType' object has no attribute 'base'

bzr 1.1.0.candidate.1 on python 2.4.4.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'diff', '-r', 'submit:', 'src/Writer.cpp']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_GB.UTF-8'
plugins:
  gnulog /home/ross/.bazaar/plugins/gnulog.pyc [unknown]
  launchpad /usr/lib/python2.4/site-packages/bzrlib/plugins/launchpad [unknown]
  multiparent /usr/lib/python2.4/site-packages/bzrlib/plugins/multiparent.pyc [unknown]
  rebase /usr/lib/python2.4/site-packages/bzrlib/plugins/rebase [0.3.0]
  svn /usr/lib/python2.4/site-packages/bzrlib/plugins/svn [0.4.6]

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 187162] [NEW] bzr diff -r submit: on subversion branch fails

  affects bzr
  status invalid

  affects bzr-svn
  status triaged
  importance low

Confirmed here. Thanks for the bug report.
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

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

The code in question is doing:

        if (other_repository is not None and
            other_repository.bzrdir.transport.base !=
            self.bzrdir.transport.base):
            parents_provider = graph._StackedParentsProvider(
                [parents_provider, other_repository._make_parents_provider()])

I think it would be reasonable to change this to:

  if (other_repository is not None and
      not self.has_same_location(other_repository):
      ...

which should avoid this problem.

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 187162] Re: bzr diff -r submit: on subversion branch fails

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John A Meinel wrote:
> The code in question is doing:
>
> if (other_repository is not None and
> other_repository.bzrdir.transport.base !=
> self.bzrdir.transport.base):
> parents_provider = graph._StackedParentsProvider(
> [parents_provider, other_repository._make_parents_provider()])
>
> I think it would be reasonable to change this to:
>
> if (other_repository is not None and
> not self.has_same_location(other_repository):
> ...
>
> which should avoid this problem.

I was thinking the same thing.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHn6R80F+nu1YWqI0RAjOnAJ4nFiNq7ZQCUf+q19AQF2Gpd2QKtgCfeNRy
022rhn4QApk2bQg0QA4h3LE=
=1EQz
-----END PGP SIGNATURE-----

Jelmer Vernooij (jelmer)
Changed in bzr:
status: New → Invalid
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
milestone: none → 0.4.8
Jelmer Vernooij (jelmer)
Changed in bzr:
importance: Undecided → Low
status: Invalid → Triaged
Changed in bzr-svn:
status: Triaged → Invalid
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

  status fixcommitted

--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Changed in bzr:
status: Triaged → Fix Committed
John A Meinel (jameinel)
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.