pulling a previously branched SVN repo with no local commits causes a "branches have diverged" error

Bug #306288 reported by Gary Wilson
2
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Medium
Jelmer Vernooij

Bug Description

Original branch was done with bzr-svn 0.4.16. Using r1970, a bzr pull now causes a "branches have diverged" error. If I attempt to merge instead, I get an AttributeError. I tried creating a fresh shared repo and branching the SVN repo, and appear to be getting the same AttributeError:

$ bzr branch svn+https://myrepo
The svn+ syntax is deprecated, use https://myrepo instead.
bzr: ERROR: exceptions.AttributeError: 'NoneType' object has no attribute 'uuid'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 893, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 839, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 539, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 981, in run
    source_branch=br_from)
  File "/home/gdub/.bazaar/plugins/svn/remote.py", line 65, in sprout
    return super(SvnRemoteAccess, self).sprout(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/bzrdir.py", line 1128, in sprout
    result, revision_id=_mod_revision.NULL_REVISION)
  File "/home/gdub/.bazaar/plugins/svn/branch.py", line 528, in sprout
    self.copy_content_into(result, revision_id=revision_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 753, in copy_content_into
    self.tags.merge_to(destination.tags)
  File "/usr/lib/python2.5/site-packages/bzrlib/tag.py", line 211, in merge_to
    source_dict = self.get_tag_dict()
  File "/home/gdub/.bazaar/plugins/svn/tags.py", line 101, in get_tag_dict
    revnum=self.branch._revnum)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/home/gdub/.bazaar/plugins/svn/repository.py", line 672, in find_tags
    layout=layout, mapping=mapping, from_revnum=0, to_revnum=revnum)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/home/gdub/.bazaar/plugins/svn/repository.py", line 630, in find_tags_between
    entries = list(self._revmeta_provider.iter_all_changes(layout, mapping.is_branch_or_tag, to_revnum, from_revnum, project=project, pb=pb))
  File "/home/gdub/.bazaar/plugins/svn/revmeta.py", line 1000, in iter_all_changes
    for kind, item in browser:
  File "/home/gdub/.bazaar/plugins/svn/revmeta.py", line 643, in next
    return self.it()
  File "/home/gdub/.bazaar/plugins/svn/revmeta.py", line 749, in next
    ret = self._iter.next()
  File "/home/gdub/.bazaar/plugins/svn/revmeta.py", line 828, in do
    revmeta = process_new_rev(bp, mb, revnum, paths, revprops)
  File "/home/gdub/.bazaar/plugins/svn/revmeta.py", line 767, in process_new_rev
    c._set_direct_lhs_parent_revmeta(revmeta)
  File "/home/gdub/.bazaar/plugins/svn/revmeta.py", line 246, in _set_direct_lhs_parent_revmeta
    self._direct_lhs_parent_revmeta != parent_revmeta):
  File "/home/gdub/.bazaar/plugins/svn/revmeta.py", line 117, in __cmp__
    (other.uuid, other.revnum, other.branch_path))
AttributeError: 'NoneType' object has no attribute 'uuid'

bzr 1.10 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'branch', 'svn+https://myrepo']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.10]
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.95.0.final.1]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  rebase /usr/lib/python2.5/site-packages/bzrlib/plugins/rebase [0.3]
  svn /home/gdub/.bazaar/plugins/svn [0.5.0.exp.0]

Revision history for this message
Gary Wilson (gary-wilson) wrote :

FYI, I get no errors when branching to a fresh shared repo using 0.4.16.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Any chance you can try again, but with the 0.5 branch rather than trunk?

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This should be fixed in the 0.5 branch. Please reopen if it still occurs.

Changed in bzr-svn:
assignee: nobody → jelmer
importance: Undecided → Medium
milestone: none → 0.5.0
status: New → Fix Committed
status: Fix Committed → Fix Released
Revision history for this message
Gary Wilson (gary-wilson) wrote :

OK, using 0.5 r2270 I now seem to get a segmentation fault for bzr-svn commands, both branch and svn-import fail.

I don't know if this is relevant, but during testing I was attempting to branch two different SVN repos at the same time and received this traceback for one of them:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 893, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 839, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 539, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 981, in run
    source_branch=br_from)
  File "/home/gdub/.bazaar/plugins/svn/remote.py", line 65, in sprout
    return super(SvnRemoteAccess, self).sprout(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/bzrdir.py", line 1117, in sprout
    result_repo.fetch(source_repository, revision_id=revision_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 1021, in fetch
    find_ghosts=find_ghosts)
  File "/home/gdub/.bazaar/plugins/svn/fetch.py", line 910, in fetch
    needed = revisionfinder.find_until(foreign_revid, mapping, find_ghosts, pb=nested_pb)
  File "/home/gdub/.bazaar/plugins/svn/fetch.py", line 758, in find_until
    needed = check_revid(foreign_revid, mapping, project)
  File "/home/gdub/.bazaar/plugins/svn/fetch.py", line 744, in check_revid
    if self.needs_fetching(revmeta, mapping):
  File "/home/gdub/.bazaar/plugins/svn/fetch.py", line 694, in needs_fetching
    return not self.target.has_revision(revmeta.get_revision_id(mapping))
  File "/home/gdub/.bazaar/plugins/svn/revmeta.py", line 589, in get_revision_id
    self.revnum, self.revnum, mapping.name)
  File "/home/gdub/.bazaar/plugins/svn/revids.py", line 320, in insert_revid
    (min_revnum, max_revnum, revid, branch, mapping))
OperationalError: database is locked

I wasn't aware that bzr-svn used a sqlite database, do I need to try deleting that and testing again?

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.