Converting standalone branch to inside-repo branch?
John Arbash Meinel
john at arbash-meinel.com
Fri Sep 21 19:47:43 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hendy Irawan wrote:
> Andrew Cowie wrote:
>> On Wed, 2007-09-12 at 18:15 +0200, Nicholas Allen wrote:
>>
>>> Perhaps it would be nice if init-repo could detect there were
>>> existing branches under it and ask the user if they want to move the
>>> history into the shared repo.
>>
>> I ran into this the other day. I agree it would be a cool feature.
>>
>> You might run into the problem of it being too jealous
>>
>> - if you accidentally do `bzr init-repository` in /, you're in for a
>> ride; and
>>
>> - how many levels down do you go, in the case where people are nesting
>> branches in (empty) convenience directories [ie we have
>> repository/mainline and repository/hackers/person1/branches and
>> repository/hackers/person2/branches, both hackers and person{1,2} are
>> empty not branches not "repos"]
>>
>> still, seems like it could just work, ie "if there are no .bzr
>> directories in directories immediately below this one, then don't worry
>> about looking for branches' revisions to pull up, just make the new repp
>> and get on with it.
>>
>>
> I'd totally agree with one-level deep (i.e. directly below the repo).
> I'm not sure if anyone would need a two-level deep branch inside a repo,
> but this can be provided via an option.
I use at least 2 levels deep. Primarily because when you have 272
branches, you need some way of organizing them.
http://bzr.arbash-meinel.com/branches/bzr
I currently sort by the approximate bzr version that things will be
merged in. Obviously not everything makes it into the exact revision,
but it is kind of like sorting by date (especially since we are doing
pretty good at time-based releases). But it allows them to have slightly
more meaning.
I also have use cases where I don't want branches being stored in a
shared repository. Specifically, I will create temporary branches that
I'm throwing away (to test what happens when you run bzr commands), or I
am explicitly trying out a new disk format, and it would be bad to have
my data intermingled. For that I actually do:
bzr init-repo temp
rm temp/.bzr/repository/shared-storage
Which creates a "barrier" repository. When bzr searches for a containing
repo, it will find this one, and then see that it isn't meant to share
storage, and will stop.
I don't think I've created a shared repository after the fact, and
wanted it to not include the sub branches. But I could see accidentally
creating something in $HOME and suddenly all of my standalone branches
are in shared storage.
Maybe a separate command for "bzr absorb-children" ?
It might be a decent option for the "bzr convert" command that was
discussed (convert it into a shared repository).
The other way to do it (unless fetch has since been broken) is:
cd repo
bzr fetch original existing_branch_in_repo
rm -rf original/.bzr/repository
That way you at least get to keep all your configuration settings for
"original".
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG9BHPJdeBCYSNAAMRAqTVAKCvrBlj5LoWtl+LnaGLEDeVyZevRACfQ8NT
5qPajCp4YfVp9L/9XSKMzcw=
=cJKy
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list