Merge lp:~lifeless/bzr/loomsupport into lp:bzr
| Status: | Merged |
|---|---|
| Approved by: | John A Meinel on 2010-06-18 |
| Approved revision: | no longer in the revision history of the source branch. |
| Merged at revision: | 5308 |
| Proposed branch: | lp:~lifeless/bzr/loomsupport |
| Merge into: | lp:bzr |
| Diff against target: |
208 lines (+124/-5) 4 files modified
NEWS (+6/-0) bzrlib/branch.py (+57/-4) bzrlib/tests/per_branch/__init__.py (+1/-1) bzrlib/tests/test_branch.py (+60/-0) |
| To merge this branch: | bzr merge lp:~lifeless/bzr/loomsupport |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| John A Meinel | 2010-06-18 | Needs Fixing on 2010-06-18 | |
|
Review via email:
|
|||
Commit Message
A lazy-load support glue for Branch formats.
Description of the Change
This is an alternative implementation of lazy format objects. It seemed
simpler to me than another custom registry subclass (needed to handle the
network name stuff properly), and this permits slightly cleaner backwards
compatability code in loom than otherwise.
| Robert Collins (lifeless) wrote : | # |
loom uses it - could I point at the loom use as a reference?
I mean, I'd love to move the old branch formats to be lazy too, but
that seems non trivial.
| Robert Collins (lifeless) wrote : | # |
As there wasn't any followup to my query, I'm going to land this pretty much as is. I'll change the test suite example to use a constant string, and add a pointer to loom.
| Robert Collins (lifeless) wrote : | # |
sent to pqm by email
- 5308. By Canonical.com Patch Queue Manager <email address hidden> on 2010-06-20
-
(lifeless) A lazy-load support glue for Branch formats. (Robert Collins)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Collins wrote:
> Robert Collins has proposed merging lp:~lifeless/bzr/loomsupport into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
>
> This is an alternative implementation of lazy format objects. It seemed
> simpler to me than another custom registry subclass (needed to handle the
> network name stuff properly), and this permits slightly cleaner backwards
> compatability code in loom than otherwise.
>
+ # registered as factories. rmatFactory) : format_ registry. register( format. get_format_ string( ), format) format_ registry. register( format. get_format_ string( ),
+ if isinstance(format, MetaDirBranchFo
+
network_
+ else:
+ network_
+ format.__class__)
^- This looks a bit odd.
I believe I understand why you are doing it, but it really makes me wonder.
Why are we passing in instances if what we want is factories...
I think if we add this, we should register at least a couple formats
lazily, so that people have examples to pick from.
Right now, the only example is in the test suite, and it is particularly ).get_format_ string( )" which certainly isn't
bad, because it uses "Class(
how you would use it in production. (If you had an instance of the
class, you would just register it directly...)
review: needsfixing
merge: approve
John enigmail. mozdev. org/
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkw bgMoACgkQJdeBCY SNAAN1qgCgm1mof +1ZMB20NZu+ b+jTDpHn +XR0X7zWyv/ ISo5sw
D2QAniOCiIaL9OZ
=k8Nv
-----END PGP SIGNATURE-----