Repository branch initialization.

Jan Hudec bulb at ucw.cz
Mon Jan 16 06:48:51 GMT 2006


On Mon, Jan 16, 2006 at 09:50:19 +1100, Robert Collins wrote:
> On Sun, 2006-01-15 at 16:25 +0100, Jan Hudec wrote:
> > Hello All,
> > 
> > I have considered automatic creation of .bzrignore instead of always adding
> > the default ignore set to it and I bumped into following problem:
> > 
> > cmd_init real work is done in BzrBranch(path, init=True). That however does
> > not include a WorkingTree, which would, logically, be responsible for
> > creating default .bzrignore. The branch could instead create a revision (ugh)
> > adding that file, but ... yes, it would still need a WorkingTree to do
> > a revert. Dirty solution would of course be to simply create the file. But
> > the actual problem is how it should be done when repository branches are
> > introduced.
> 
> This is an interesting problem. The basic thing is 'how do we inject
> content into new branches.' 
> 
> Right now we start at revno 0 with no content. I think following that
> pattern will work well:
> 
> This is a 'checkout' refactoring: the sequence in cmd_init will become
> newbranch = Branch.initialize(".")
> WorkingTree.checkout(newbranch, ".")
> 
> the latter call will make a new working tree for branch 'newbranch' at
> path '.'. We can therefor tell either Branch or WorkingTree that an
> empty branch should follow some code path to add files. I would suggest
> that Branch be the logical place to put this logic.
> 
> 
> > Therefore I'd like to ask: What are the plans for UI for creating repository
> > branches and checkouts? (I have seen http://bazaar.canonical.com/BzrArchives,
> > but it does not say anything about the new command to create archives).
> 
> No UI changes are planned to fix the bug you are encountering. With

bug? There's no bug. There is just no obvious place to put this thing.

> repositories we have the concept of bzr branching *into* the repository.
> I think the question of 'how to create a new branch in an archive' is
> orthogonal to the code question above. We do need to answer the UI
> question though.

It's not completely orthogonal. It can affect whether we want to create
.bzrignore in WorkingTree or in BzrBranch. I would personally prefer to
create a non-versioned file in the initial checkout, so we don't create
an extra revision with the default .bzrignore contents. However the
question is then how will that work for archive branches. If archive
branches are only created by branch command and never by init, than we
can do the non-versioned file in initial checkout. But if archive
branches can be created by init, we need the aditional revision.

-- 
						 Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060116/be6b5b8d/attachment.pgp 


More information about the bazaar mailing list