[MERGE] Implement reconfigure --standalone and --sharing

John Arbash Meinel john at arbash-meinel.com
Wed Apr 9 09:32:23 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron Bentley wrote:
| Hi all,
|
| This patch allows reconfigure to convert a branch to be standalone, or
| to use a shared repository.  I've termed a
| branch-that-uses-a-shared-repository a "sharing" branch, because it
| shares its repository with other branches.
|
| Aaron

- --shared sounds better and conforms to our general parameters better. (We
generally use the past tense/adjective form.) However, it may be more confusing
than --sharing.

Maybe --share-repository makes it clear that you are telling the branch to share
the repository rather than any of the other permutations?

At the moment Optparse allows them to pass any prefix that is unique, so they
could use '--share-repo' or '--share' for those who don't want to type a lot.
(Though we've discussed disabling that for clarity and api consistency)

This is certainly a desirable feature, as many people have asked how to do it
without doing another 'bzr branch' into the shared repo. (Technically you could
do, bzr branch existing temp; rm -rf temp existing/.bzr/repository but that is a
bit of surgery we shouldn't recommend.)

You are doing a whole-repository fetch, rather than a just-branch fetch here:
+            elif self.local_branch is not None and not self._destroy_branch:
+                up = self.local_branch.bzrdir.root_transport.clone('..')
+                up_bzrdir = bzrdir.BzrDir.open_containing_from_transport(up)[0]
+                new_repo = up_bzrdir.find_repository()
+                new_repo.fetch(self.repository)

I'm not sure that we are planning on preserving the whole-repository fetch api
in the future. (Because we are trying to get rid of calls to things like
'.all_revision_ids()').

If they were doing a branch+rename/rm stuff, then doing
'new_repo.fetch(self.repository, self.last_revision())' is valid. It is true
that the fetch might miss some unreferenced revisions, but if there are
unreferenced revisions in the branch, where could they have come from? Maybe a
pending merge in the working tree?

Anyway, I would *like* us to only to a partial fetch if possible (it will
probably be considerably faster to not have to figure out all the revisions
which are already present.)

We should at least test the behavior we end up chosing. By adding an
unreferenced revision into the standalone branch repository, and then doing the
reconfigure and assert whether or not the revision is in the result.

We should also go the other way. So if you turn a branch into a standalone
branch, I think it really *should* filter at that point.

BB:tweak

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/H8XJdeBCYSNAAMRAlWDAJ4v8rS7yHDVlAVMvCtG/PbcUkk2ngCgiIep
Z6U7s34XnVxcOnyQLqrWeZg=
=1J0z
-----END PGP SIGNATURE-----




More information about the bazaar mailing list