[MERGE][0.14] Allow 'bzr push' to push onto existing dir

John Arbash Meinel john at arbash-meinel.com
Tue Jan 9 20:06:50 GMT 2007

Hash: SHA1

I'm looking into fixing:

By suggestion, I changed how I'm doing it. While working on this, I'm
concerned that our api isn't quite what we want. But since I'm trying to
get this merged for 0.14 I did it in a minimally invasive manner, and it
is set up to be refactored easily.

Basically this code changes the 'cmd_push' logic so that if there is a
target BzrDir it will attempt to reuse the target repository and create
a Branch on demand. Note that it won't create a target WorkingTree,
mostly because the logic for that is quite a bit trickier. We can't just
use sprout() or clone() because both of those want to create the BzrDir.
And I don't feel like implementing 90% of them again.

It also changes the 'create_prefix' loop, to be (IMO) cleaner, since
transport.mkdir('.') works just fine rather than trying to clone to the
parent and pop off the child directory name, etc.

It also adds '--use-existing' which allows you to 'bzr push' onto a
directory that already exists, but that has no control directory
already. (I also thought to call it --use-existing-dir).

This should reduce a lot of the errors reported by users of Launchpad.
Since the changes should allow resuming a push if it gets ^C in the
middle of transfer.

There still is a small need for a command that can move the remote
directory out of the way, or that can nuke the remote .bzr (or rename
it) and then push over what used to be there. Because there are still
potential race conditions that can leave something that isn't
recognizable by bzr. (If you ^C after .bzr/branch is made but before
.bzr/branch/format is written, etc)

I'd like to get feedback on this, since it would be really nice to get
this into 0.14, and that means getting quick feedback.

Since it only adds functionality (nothing is deprecated), I think it can
still qualify as bug-fixes and get merged after the freeze.

Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_push_alt.patch
Type: text/x-patch
Size: 11606 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070109/03832488/attachment-0001.bin 

More information about the bazaar mailing list