Make "rename" command an alias for "mv"?
Michael Ellerman
michael at ellerman.id.au
Tue Oct 25 02:30:06 BST 2005
On Tue, 25 Oct 2005 09:26, John Arbash Meinel wrote:
> Well, as long as there is a reason for having the different commands,
> and there is mv, I don't really care.
>
> I could see it this way:
>
> bzr rename A B
> B must be the final name of A, it must not already exist
> bzr move A B
> B must be a directory which already exists
> bzr mv A B
> B can either be a directory or a non-existent filename
>
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'
cheers
--
Michael Ellerman
IBM OzLabs
email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051025/8312e4c8/attachment.pgp
More information about the bazaar
mailing list