Assertion error comitting to bzr-svn checkout with custom layout

Bug #306629 reported by Wesley J. Landaker
2
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Medium
Jelmer Vernooij

Bug Description

With bzr 1.10 and bzr-svn 0.5 branch HEAD, I made an svn repository, added trunk/tags/branches, branched trunk with bzr, then added branches and tags directives to subversion.conf, then tried to push from bzr back to svn and it fails with an AssertionError.

This should illustrate:

$ rm -rf ~/.bazaar/subversion.conf # only on a test account(!)
$ rm -rf ~/.bazaar/svn-cache/
$ mkdir /tmp/bzr-svn-test/
$ cd /tmp/bzr-svn-test
$ svnadmin create svn-repos
$ svn co file://`pwd`/svn-repos svn-co
Checked out revision 0.
$ cd svn-co
$ svn mkdir trunk tags branches
A trunk
A tags
A branches
$ svn commit -m "Initial skeleton"
Adding branches
Adding tags
Adding trunk

Committed revision 1.
$ cd ..
$ bzr co svn-repos/trunk
Initialising Subversion metadata cache in /home/wjlanda/.bazaar/svn-cache/26f751e9-dedb-4d3a-8103-8794d7e6138c
$ cd trunk
$ vi ~/.bazaar/subversion.conf
$ cat ~/.bazaar/subversion.conf
[26f751e9-dedb-4d3a-8103-8794d7e6138c]
locations = file:///tmp/bzr-svn-test/svn-repos
branches = trunk;branches/*
tags = tags/*
$ touch file
$ bzr add
added file
$ bzr commit -m "Added file"
Committing to: /tmp/bzr-svn-test/svn-repos/trunk
added file
bzr: ERROR: exceptions.AssertionError:

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 2435, in run
    exclude=safe_relpath_files(tree, exclude))
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 235, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line 202, in commit
    *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commit.py", line 404, in commit
    revision_id=self.rev_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 1021, in fetch
    find_ghosts=find_ghosts)
  File "/home/wjlanda/.bazaar/plugins/svn/commit.py", line 1064, in fetch
    self.copy_content(revision_id=revision_id, pb=pb)
  File "/home/wjlanda/.bazaar/plugins/svn/commit.py", line 1015, in copy_content
    while not self.target.has_revision(revision_id):
  File "/home/wjlanda/.bazaar/plugins/svn/repository.py", line 504, in has_revision
    foreign_revid, _ = self.lookup_revision_id(revision_id, project=project)
  File "/home/wjlanda/.bazaar/plugins/svn/repository.py", line 614, in lookup_revision_id
    return self.revmap.get_branch_revnum(revid, layout, project)
  File "/home/wjlanda/.bazaar/plugins/svn/revids.py", line 204, in get_branch_revnum
    for entry_revid, branch, min_revno, max_revno, mapping in self.actual.discover_fileprop_revids(layout, last_checked, fileprops_to_revnum, project):
  File "/home/wjlanda/.bazaar/plugins/svn/revids.py", line 82, in discover_fileprop_revids
    assert isinstance(branch, str)
AssertionError

bzr 1.10 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'commit', '-m', 'Added file']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.10]
  cvsps_import /usr/lib/python2.5/site-packages/bzrlib/plugins/cvsps_import [unknown]
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.96.0.dev.1]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  loom /usr/lib/python2.5/site-packages/bzrlib/plugins/loom [1.4dev]
  rebase /usr/lib/python2.5/site-packages/bzrlib/plugins/rebase [0.3]
  search /usr/lib/python2.5/site-packages/bzrlib/plugins/search [1.6.0.dev.3]
  stats /usr/lib/python2.5/site-packages/bzrlib/plugins/stats [unknown]
  svn /home/wjlanda/.bazaar/plugins/svn [0.5.0.rc.1]
  upload /usr/lib/python2.5/site-packages/bzrlib/plugins/upload [0.1]
*** 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.

Revision history for this message
Wesley J. Landaker (wjl) wrote :

Same thing happens if you branch instead of checkout, but then it only fails when you try to push or svn-push (both fail with the essentially the same backtrace as above).

BTW, this is sort of a regression from 0.4.x, but only when trying to use a custom layout. I didn't explicitly say above, but if you get rid of the "branches =" and "tags =" lines, it works as expected.

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

Thanks, reproduced + fixed here.

Changed in bzr-svn:
assignee: nobody → jelmer
importance: Undecided → Medium
milestone: none → 0.5.0
status: New → 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.