Make "rename" command an alias for "mv"?

Martin Pool martinpool at gmail.com
Tue Oct 25 06:03:54 BST 2005


On 25/10/05, Michael Ellerman <michael at ellerman.id.au> wrote:

> What about stupid people like me, who *consistently* move files around and
> only later remember to "bzr rename" them? There's lots of stupid people out
> there, and if you ever manipulate your tree with a GUI file manager you'll
> have to do the bzr renaming later, so I think it should work.
>
> Currently I just have a local hack to rename, so that if the destination
> exists it doesn't do the move.
>
> We could try and be intelligent about it:
>
>   bzr rename A B
>
>   if exists(A) == exists(B):
>         raise Exception('Blerg')
>
>   if exists(A) and not exists(B):
>         bzr.rename(A, B)
>         move(A, B)
>
>   if not exists(A) and exists(B):
>         bzr.rename(A, B)
>         print 'Warning: You seem to have moved A to B already'

That sounds good to me.  Perhaps we also want an option which will
always rename only the inventory entry and not the file itself.  In
arch this was --id-only, it could also be --post-hoc (a bit obscure),
--fixup, or maybe there's something better.

--
Martin




More information about the bazaar mailing list