Comment 19 for bug 304134

Revision history for this message
Wesley J. Landaker (wjl) wrote : Re: KeyError when updating lightweight bzr-svn checkout

Here is a shorter reproduction recipe:

svnadmin create repos
svn co file://`pwd`/repos svn-wc
cd svn-wc/
svn mkdir parent
svn commit -m "Added parent."
svn mkdir peer
svn commit -m "Added peer"
echo "A" > peer/file
svn add peer/file
svn commit -m "Added file"
svn up
echo "B" > peer/file
svn mv peer/ parent/child
svn commit -m "Made peer a child, with mods."
svn up
bzr up # works
cd parent/
svn up
bzr up # crashes
bzr: ERROR: exceptions.KeyError: u'child/file'

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 1184, in run
    tree = WorkingTree.open_containing(dir)[0]
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree.py", line 333, in open_containing
    return control.open_workingtree(), relpath
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 819, in open_workingtree
    return SvnWorkingTree(self, self.local_path, self.open_branch())
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 114, in __init__
    self._update_base_revnum(max_rev)
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 542, in _update_base_revnum
    self.read_working_inventory()
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 413, in read_working_inventory
    add_dir_to_inv(u"", rootwc, None)
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 375, in add_dir_to_inv
    (id, revid) = find_ids(entry, rootwc)
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 352, in find_ids
    relpath)
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 279, in path_to_file_id
    entry = self.basis_tree().id_map[rp.decode("utf-8")]
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 534, in basis_tree
    self.base_tree = SvnBasisTree(self)
  File "/home/wjlanda/.bazaar/plugins/svn/tree.py", line 232, in __init__
    workingtree.branch.mapping)
  File "/home/wjlanda/.bazaar/plugins/svn/repository.py", line 451, in get_fileid_map
    return self.fileid_map.get_map(revmeta.get_foreign_revid(), mapping)
  File "/home/wjlanda/.bazaar/plugins/svn/fileids.py", line 304, in get_map
    self.actual.update_map(map, revid, idmap, changes)
  File "/home/wjlanda/.bazaar/plugins/svn/fileids.py", line 202, in update_map
    delta[inv_p] = map[inv_p][0]
KeyError: u'child/file'

bzr 1.11rc1 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'up']
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]
  netrc_credential_store /usr/lib/python2.5/site-packages/bzrlib/plugins/netrc_credential_store [unknown]
  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.5rc1]
  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.