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

Martin Pool mbp at canonical.com
Mon Jan 15 02:48:35 GMT 2007


On 10 Jan 2007, John Arbash Meinel <john at arbash-meinel.com> wrote:
> Alexander Belchenko wrote:
> > John Arbash Meinel ?8H5B:
> >> I'm looking into fixing:
> >>   https://launchpad.net/bugs/45504
> >>   https://launchpad.net/bugs/53340
> >>   https://launchpad.net/bugs/30576
> > 
> >> 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.
> > 
> > I have a question: how your code differentiate between incomplete
> > target standalone branch without repository and incomplete branch
> > in shared repository?
> 
> I'm not sure how you are defining an "incomplete target standalone branch".
> 
> What is happening today is that we start copying the repository data
> across before we create the .bzr/branch directory and supporting
> information.
> 
> Which means that we have a .bzr/repository but no .bzr/branch.
> 
> So this patch changes it so that when that is seen, it will continue
> copying data into .bzr/repository (using remote_repo.fetch(local_repo)),
> and then create a Branch (with local_branch.clone(remote_bzrdir))

So this doesn't distinguish between

 a: something that was meant to be a branch+repo, but where the branch 
 data never got created

 b: something that was intended to be a repo without a branch

I think someone else suggested that we should create an empty
(no-revisions) branch object before populating the repo.  Would that
work?

> >> 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).
> > 
> > --use-existing-dir is longer but more clear, IMO.
> 
> If others agree, I'm fine with that.

Fine with me too.
-- 
Martin



More information about the bazaar mailing list