[MERGE] Make 'mv a b' work for already renamed directories, like it does for files

James Westby jw+debian at jameswestby.net
Sun Jan 27 11:56:09 GMT 2008


On Sun, 2008-01-27 at 12:18 +0100, Lukáš Lalinský wrote:
> Hi all,
> 
> this is a fix for https://bugs.launchpad.net/bzr/+bug/107967. If you
> have manually renamed file from 'a' to 'b', 'bzr mv a b' works just
> fine. But if you do the same with directories, it tries to move 'a' into
> 'b' (rename to 'b/a'), which obviously doesn't work because 'b' is not
> versioned.
> 
> Lukas
> 

> +            from_id = tree.path2id(rel_names[0])
> +            if (not osutils.lexists(names_list[0]) and
> +                from_id and inv.get_file_kind(from_id) ==
> "directory"):
> +                into_existing = False

from_id is not None is usually preferred.


> 
>          if self._inventory is not None:
>              update_inventory = True
>              inv = self.inventory
> +            to_dir_id = to_entry[0][2]
>              to_dir_ie = inv[to_dir_id]
> -            to_dir_id = to_entry[0][2]

Was this code path unreachable before your change. or has there just
been no bug filed about it?

Thanks,

James





More information about the bazaar mailing list