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

John A Meinel john at arbash-meinel.com
Mon Oct 24 02:58:06 BST 2005


Robert Widhopf-Fenk wrote:
> I was wondering why there are three commands which can do
> renames and if there was any special voodoo in "rename" and
> "move", but beside a TODO note I can not see a need to have
> them as a commands of their own instead of an alias to "mv".

I would agree with this. The "move into a directory without renaming"
was a little bit odd.
Though I would make sure that "bzr mv A doc/" would still work, without
actually trying to rename A to doc, just move it as a subdirectory.

>
> While it is slow to invoke bzr for each rename it makes more
> sense to me to have something more generic solving the
> slowness, e.g. a "bzr command-pipe" for feeding in a set of
> commands which will be processed within one run of bzr and
> can be used right from the shell without writing python code.

Well, I wrote a plugin called "bzr service" which spawns an instance
which communicates over a socket.

>
> This would improve speed of all batched bzr commands.
>
> BTW is it save to do several commands within one bzr run,
> e.g. having a plugin combining several commands into a
> single one?

In general it should be fine. I believe the only global state is stuff
like the transports, etc. And those should stay resident.
bzrlib is supposed to be designed as a library, so it should be re-entrant.

>
> Some programs do not behave well here due to globals not
> having their startup values anymore after running the first
> command.
>
> Robert.

My branch is available from:
http://bzr.arbash-meinel.com/plugins/service/

It should be updated to use named pipes, or named sockets, rather than
just using a TCP port.

But that specific code is designed to have an ultra lightweight C front
end, which just calls into the in-memory bzrlib service, and writes the
results out.

On my machines it takes approximately 0.6-1.1s just to run "bzr root".
With bzr already loaded, it takes between 0.1 and 0.3 seconds, which is
a pretty noticeable speedup.

You're welcome to use it as a starting point. Though you certainly don't
have to.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051023/fee3dea6/attachment.pgp 


More information about the bazaar mailing list