Repository branch initialization.
Robert Collins
robertc at robertcollins.net
Sun Jan 15 22:50:19 GMT 2006
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
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.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060116/85c4cdbd/attachment.pgp
More information about the bazaar
mailing list