~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/reconfigure.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-06-10 08:15:19 UTC
  • mfrom: (3489.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080610081519-95unlj6ayptlh2uv
(mbp) Bump version to 1.6b3

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Reconfigure a bzrdir into a new tree/branch/repository layout"""
18
18
 
62
62
        self._create_tree = False
63
63
        self._create_repository = False
64
64
        self._destroy_repository = False
65
 
        self._repository_trees = None
66
65
 
67
66
    @staticmethod
68
67
    def to_branch(bzrdir):
141
140
            raise errors.AlreadyStandalone(bzrdir)
142
141
        return reconfiguration
143
142
 
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
 
 
159
143
    def _plan_changes(self, want_tree, want_branch, want_bound,
160
144
                      want_reference):
161
145
        """Determine which changes are needed to assume the configuration"""
318
302
            local_branch.bind(branch.Branch.open(bind_location))
319
303
        if self._destroy_repository:
320
304
            self.bzrdir.destroy_repository()
321
 
        if self._repository_trees is not None:
322
 
            repo.set_make_working_trees(self._repository_trees)