[BUG] renaming + kind change == assertion failure

John Arbash Meinel john at arbash-meinel.com
Mon Oct 1 22:30:11 BST 2007


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

If you do this:

  bzr init test
  cd test
  touch a
  bzr add a
  bzr commit -m "added a"
  rm a
  mkdir a

At this point, 'bzr status' works correctly and tells you that you
changed a file into a directory.

'bzr diff' gives no output, which is incorrect, but it isn't crashing.

However, if you do:

  bzr mv a b

Then 'bzr status' tells you that 'a' was renamed and modified. But 'bzr
diff' fails with an assertion error inside 'inventory.py' (shown later)

I don't think this is a specific regression, but it is something
incomplete with our current "show_diff_trees()" code.

John
=:->



=== renamed directory 'a' => 'd'
bzr: ERROR: exceptions.AssertionError:

Traceback (most recent call last):
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/commands.py", line 802, in
run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/commands.py", line 758, in
run_bzr
    ret = run(*run_argv)
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/commands.py", line 492, in
run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/commands.py", line 768, in
ignore_pipe
    result = func(*args, **kwargs)
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/builtins.py", line 1506,
in run
    old_label=old_label, new_label=new_label)
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/diff.py", line 344, in
diff_cmd_helper
    extra_trees=extra_trees)
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/diff.py", line 378, in
show_diff_trees
    path_encoding=path_encoding)
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/diff.py", line 447, in
_show_diff_trees
    text_modified, kind, to_file, diff_file)
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/diff.py", line 512, in
_maybe_diff_file_or_symlink
    new_tree, to_file)
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/inventory.py", line 156,
in diff
    assert self.kind == to_entry.kind
AssertionError

bzr 0.92.0.dev.0 on python 2.5.1.final.0 (linux2)
arguments: ['/home/jameinel/bin/bzr', 'diff']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'

  affects /products/bzr
  status triaged
  importance medium
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHAWbjJdeBCYSNAAMRAghSAJ9kqN1Dap0XW7k2AAftKeQwxK0T6ACgq3pa
+QVJZSUfFfi+WbeokJIQ9OU=
=4wmK
-----END PGP SIGNATURE-----



More information about the bazaar mailing list