[MERGE] Allow changing --[no-]trees with reconfigure (bug 145033)
Aaron Bentley
aaron at aaronbentley.com
Mon Feb 16 14:12:41 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
bb:approve
Sorry it took so many iterations to get here.
Marius Kruger wrote:
> 2009/2/9 Aaron Bentley <aaron at aaronbentley.com
> <mailto:aaron at aaronbentley.com>>
>
> Marius Kruger wrote:
> > Actually, considering the change is just
> > Repository.set_make_working_trees, it might be simpler to just
> invoke it
> > directly.
> >
> >
> > done.
>
> No, I meant not using Reconfigure at all. If you're using Reconfigure,
> then the change should be caused by apply.
>
>
> ok. Because Reconfigure gives other advantages like checking if we
> have a repository present, I chose to keep on using it.
> So I moved the actual change to apply() again.
Okay.
> === modified file 'bzrlib/errors.py'
> --- bzrlib/errors.py 2009-02-11 00:29:57 +0000
> +++ bzrlib/errors.py 2009-02-15 23:29:29 +0000
> @@ -2744,6 +2744,18 @@
> _fmt = "'%(display_url)s' is already standalone."
>
>
> +class AlreadyWithTrees(BzrDirError):
> +
> + _fmt = ("Shared repository '%(display_url)s' already creates "
> + "working trees.")
Nitpick: The second line should be indented by one more space so that
it's inside the parenthesis. Where reasonable, all code contained by a
given parenthesis should begin at the same column.
There are a few other cases of this in the patch. Nothing that would
prevent merging, though. (And indeed, I didn't even notice before.)
> === modified file 'bzrlib/reconfigure.py'
> --- bzrlib/reconfigure.py 2008-04-24 04:58:42 +0000
> +++ bzrlib/reconfigure.py 2009-02-15 23:15:17 +0000
> @@ -140,6 +141,21 @@
> raise errors.AlreadyStandalone(bzrdir)
> return reconfiguration
>
> + @classmethod
> + def set_repository_trees(klass, bzrdir, with_trees):
> + """Adjust a repository's working tree presence default"""
> + reconfiguration = klass(bzrdir)
> + if not reconfiguration.repository.is_shared():
> + raise errors.ReconfigurationNotSupported(reconfiguration.bzrdir)
> + if with_trees and reconfiguration.repository.make_working_trees():
> + raise errors.AlreadyWithTrees(bzrdir)
> + elif (not with_trees and
> + not reconfiguration.repository.make_working_trees()):
Nitpick: the last line is indented two spaces too far. See above.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmZdFMACgkQ0F+nu1YWqI1cnQCeP0aYrb6zkQMV7ySwkCMwdEgV
WrsAn1TSGo461KXRJ03J/ooL/iKHAYnK
=HrxO
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list