converting standalone branches to shared ones...

Erik Bågfors zindar at gmail.com
Mon Feb 20 08:22:13 GMT 2006


2006/2/20, Robert Collins <robertc at robertcollins.net>:
> Say you have a standalone branch underneath a repository, and you want
> to make it use the repository for storage...
>
> The following will do it:
>
> $ bzr upgrade --format=metadir
> $ python
> >>> import bzrlib.repository
> >>> this_repo = bzrlib.repository.Repository.open('.')
> >>> shared_repo = bzrlilb.repository.Repository.open_containing('..')
> >>> assert shared_repo.is_shared()
> >>> shared_repo.fetch(this_repo)
> >>> this_repo.bzrdir.get_repository_transport.delete_tree('.')
> >>> ^D
>
>
> I'd like to make this available from the console ui... any suggestions
> where?

Well, should you ever have a standalone branch under a repo location?

I almost think that this should be done with
cd /path/to/repo
mv branch /tmp
bzr branch /tmp/branch branch

This would move it out of the repo location, and when you branch it
back, it will find that it's under a repo location and store it in the
repo.

/Erik




More information about the bazaar mailing list