bzr mv doesn't gracefully handle symlinks to directories in paths

Bug #66964 reported by Aaron Bentley
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Aaron Bentley

Bug Description

bzr mv attempts to find the children of a symlink when decoding a source path. This is probably a more general bug.

It seems as though we should
1. Give a better error (with traceback) when path2id attempts to find the children of a symlink
2. Determine the real path of source and target in 'bzr mv' before attempting to do path2id.

~$ bzr init foo
abentley@troll:~$ cd foo
abentley@troll:~/foo$ mkdir bar
abentley@troll:~/foo$ ln -s bar baz
abentley@troll:~/foo$ touch baz/qux
abentley@troll:~/foo$ bzr add
added bar
added baz
added bar/qux
abentley@troll:~/foo$ bzr mv baz/qux ./qux
bzr: ERROR: exceptions.AttributeError: children

Traceback (most recent call last):
  File "/home/abentley/bzr/dev/bzrlib/commands.py", line 623, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/abentley/bzr/dev/bzrlib/commands.py", line 585, in run_bzr
    ret = run(*run_argv)
  File "/home/abentley/bzr/dev/bzrlib/commands.py", line 291, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/abentley/bzr/dev/bzrlib/builtins.py", line 451, in run
    tree.rename_one(rel_names[0], rel_names[1])
  File "/home/abentley/bzr/dev/bzrlib/mutabletree.py", line 34, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/home/abentley/bzr/dev/bzrlib/workingtree.py", line 1075, in rename_one
    file_id = inv.path2id(from_rel)
  File "/home/abentley/bzr/dev/bzrlib/inventory.py", line 1207, in path2id
    cie = parent.children[f]
AttributeError: children

bzr 0.12.0dev0 on python 2.4.1.final.0 (linux2)
arguments: ['/home/abentley/bin/bzr', 'mv', 'baz/qux', './qux']

** please send this report to <email address hidden>

Aaron Bentley (abentley)
Changed in bzr:
assignee: nobody → aaron-bentley
status: Unconfirmed → Fix Committed
John A Meinel (jameinel)
Changed in bzr:
importance: Undecided → Medium
Revision history for this message
Wouter van Heyst (larstiq) wrote :

merged into bzr.dev r2098

Changed in bzr:
status: Fix Committed → 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.