Merge lp:~lifeless/bzr/loomsupport into lp:bzr
Proposed by
Robert Collins
Status: | Merged |
---|---|
Approved by: | John A Meinel |
Approved revision: | no longer in 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 | Needs Fixing | ||
Review via email: mp+27903@code.launchpad.net |
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.
To post a comment you must log in.
-----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-----