[RFC] Bug 440952: "be more helpful when attempting to branch a shared repo"

John Arbash Meinel john at arbash-meinel.com
Fri Oct 9 18:41:19 BST 2009


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


...

> So I've tried putting the logic into BzrDir.  Since BzrDir.open_branch()
> is abstract, I had to modify BzrDirMeta1.open_branch() (which was
> straightforward), BzrDirPreSplitOut.open_branch() (which was not, and I
> don't know how to excercise it), and RemoteBrank.open_branch() (where I
> got a bit lost).  Since implementations of BzrDir.open_branch must do
> this test, which is a bit fragile, I looked into trying to refactor a
> common BzrDir.open_branch() that looked something like:

Well, you don't need to modify BzrDirPreSplitOut because in those you
cannot have a repository without a branch. Thus, it doesn't gain you
anything.


> 
>     def open_branch(self, unsupported=False, ignore_fallbacks=False):
>        try:
>             format = self.find_branch_format()
>             self._check_supported(format, unsupported)
>             return format.open(self, _found=True,
> ignore_fallbacks=ignore_fallbacks)
>         except errors.NotBranchError, e:
>             # check if repository and provide indication
> 
> This moved find_branch_format() from BzrMetaDir1 to BzrDir, but looked
> pretty straight-forward.  I'm not RemoteBranch-savvy to refactor
> RemoteBranch.open_branch() to fit, so I just stuck in the test at the
> appropriate location.
> 
> This approach causes two additional test failures as it increments the
> number of messages sent to the HPSS.
> 
> This branch is up separately at lp:~slyguy/bzr/bug-440952-bzrdir
> 
> Brian.
> 

When moving this up to this level, we have to think about how it will
effect things like bzr-svn/hg/git.

I wonder about just having RemoteBzrDir.open_branch() just serialize the
extra information over the wire, so that we don't have to make extra
hpss calls. Given how hard Andrew and Robert have been working on that
sort of thing, I don't think we want to regress at this point.

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

iEYEARECAAYFAkrPdb8ACgkQJdeBCYSNAAOhTwCglP59ivYYI72tBTyTdnc9FKPE
TtUAn0jF+i0FB79Uha+l5E/4wwURBXkt
=kVnx
-----END PGP SIGNATURE-----



More information about the bazaar mailing list