Unhandled exception in bzr status

Keir Mierle keir at cs.utoronto.ca
Tue Jan 23 02:34:51 GMT 2007


I encountered the following error when I deleted a symlink and promoted it to a
real directory without first bzr rm'ing the symlink. I understand I did
something bad to my repository, but I think the error message should be more
helpful. I fixed the problem by moving the directory with the same name as the
symlink out of the way, and committing.

Steps to reproduce:

  cd
  mkdir bzrcrash
  mkdir wrk
  cd bzrcrash
  bzr init
  ln -s $HOME/wrk wrk
  bzr add wrk
  bzr ci -m"Added a symlink to a directory"

  # oops! I forgot wrk was a versioned symlink
  rm wrk

  # still ok
  bzr st

  mkdir wrk

  # this crashes
  bzr st

Resulting error:

bzr: ERROR: exceptions.AssertionError:

Traceback (most recent call last):
  File "/home/keir/wrk/bzr.dev/bzrlib/commands.py", line 650, in
run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/keir/wrk/bzr.dev/bzrlib/commands.py", line 612, in run_bzr
    ret = run(*run_argv)
  File "/home/keir/wrk/bzr.dev/bzrlib/commands.py", line 304, in
run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/keir/wrk/bzr.dev/bzrlib/commands.py", line 622, in ignore_pipe
    result = func(*args, **kwargs)
  File "/home/keir/wrk/bzr.dev/bzrlib/builtins.py", line 171, in run
    short=short)
  File "/home/keir/wrk/bzr.dev/bzrlib/status.py", line 139, in show_tree_status
    specific_files=specific_files)
  File "/home/keir/wrk/bzr.dev/bzrlib/tree.py", line 87, in changes_from
    include_root=include_root
  File "/home/keir/wrk/bzr.dev/bzrlib/decorators.py", line 38, in read_locked
    return unbound(self, *args, **kwargs)
  File "/home/keir/wrk/bzr.dev/bzrlib/tree.py", line 460, in compare
    specific_file_ids, include_root)
  File "/home/keir/wrk/bzr.dev/bzrlib/delta.py", line 187, in _compare_trees
    assert kind[0] == kind[1] or None in kind
AssertionError

bzr 0.15.0dev0 on python 2.4.4.candidate.1 (linux2)
arguments: ['/home/keir/bin/bzr', 'st']

** please send this report to bazaar-ng at lists.ubuntu.com

I'd volunteer to fix this, but I am not sure what bzr should do in this case.
Tell the user they must move the directory out of the way and commit the
deleted symlink?  Or perhaps list the symlink as deleted, and the directory as
unknown? I suspect the latter is the best option.

Keir



More information about the bazaar mailing list