/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/reconfigure.py

  • Committer: Jelmer Vernooij
  • Date: 2009-02-25 14:36:59 UTC
  • mfrom: (4048 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4049.
  • Revision ID: jelmer@samba.org-20090225143659-vx6cbqtmyicuzfyf
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
        self._create_tree = False
63
63
        self._create_repository = False
64
64
        self._destroy_repository = False
 
65
        self._repository_trees = None
65
66
 
66
67
    @staticmethod
67
68
    def to_branch(bzrdir):
140
141
            raise errors.AlreadyStandalone(bzrdir)
141
142
        return reconfiguration
142
143
 
 
144
    @classmethod
 
145
    def set_repository_trees(klass, bzrdir, with_trees):
 
146
        """Adjust a repository's working tree presence default"""
 
147
        reconfiguration = klass(bzrdir)
 
148
        if not reconfiguration.repository.is_shared():
 
149
            raise errors.ReconfigurationNotSupported(reconfiguration.bzrdir)
 
150
        if with_trees and reconfiguration.repository.make_working_trees():
 
151
            raise errors.AlreadyWithTrees(bzrdir)
 
152
        elif (not with_trees
 
153
              and not reconfiguration.repository.make_working_trees()):
 
154
            raise errors.AlreadyWithNoTrees(bzrdir)
 
155
        else:
 
156
            reconfiguration._repository_trees = with_trees
 
157
        return reconfiguration
 
158
 
143
159
    def _plan_changes(self, want_tree, want_branch, want_bound,
144
160
                      want_reference):
145
161
        """Determine which changes are needed to assume the configuration"""
302
318
            local_branch.bind(branch.Branch.open(bind_location))
303
319
        if self._destroy_repository:
304
320
            self.bzrdir.destroy_repository()
 
321
        if self._repository_trees is not None:
 
322
            repo.set_make_working_trees(self._repository_trees)