~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/reconfigure.py

  • Committer: Aaron Bentley
  • Date: 2007-09-14 14:45:55 UTC
  • mto: This revision was merged to the branch mainline in revision 2826.
  • Revision ID: abentley@panoramicfeedback.com-20070914144555-3rynerknpoivm2xv
Documentation updates from review

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
 
56
56
    @staticmethod
57
57
    def to_branch(bzrdir):
 
58
        """Return a Reconfiguration to convert this bzrdir into a branch
 
59
 
 
60
        :param bzrdir: The bzrdir to reconfigure
 
61
        :raise errors.AlreadyBranch: if bzrdir is already a branch
 
62
        :raise errors.ReconfigurationNotSupported: if bzrdir does not contain
 
63
            a branch or branch reference
 
64
        """
58
65
        reconfiguration = Reconfigure(bzrdir)
59
66
        reconfiguration._plan_changes(want_tree=False, want_branch=True,
60
67
                                      want_bound=False)
64
71
 
65
72
    @staticmethod
66
73
    def to_tree(bzrdir):
 
74
        """Return a Reconfiguration to convert this bzrdir into a tree
 
75
 
 
76
        :param bzrdir: The bzrdir to reconfigure
 
77
        :raise errors.AlreadyTree: if bzrdir is already a tree
 
78
        :raise errors.ReconfigurationNotSupported: if bzrdir does not contain
 
79
            a branch or branch reference
 
80
        """
67
81
        reconfiguration = Reconfigure(bzrdir)
68
82
        reconfiguration._plan_changes(want_tree=True, want_branch=True,
69
83
                                      want_bound=False)
73
87
 
74
88
    @staticmethod
75
89
    def to_checkout(bzrdir, bound_location=None):
 
90
        """Return a Reconfiguration to convert this bzrdir into a checkout
 
91
 
 
92
        :param bzrdir: The bzrdir to reconfigure
 
93
        :param bound_location: The location the checkout should be bound to.
 
94
        :raise errors.AlreadyCheckout: if bzrdir is already a checkout
 
95
        :raise errors.ReconfigurationNotSupported: if bzrdir does not contain
 
96
            a branch or branch reference
 
97
        """
76
98
        reconfiguration = Reconfigure(bzrdir, bound_location)
77
99
        reconfiguration._plan_changes(want_tree=True, want_branch=True,
78
100
                                      want_bound=True)
145
167
        raise errors.NoBindLocation(self.bzrdir)
146
168
 
147
169
    def apply(self, force=False):
 
170
        """Apply the reconfiguration
 
171
 
 
172
        :param force: If true, the reconfiguration is applied even if it will
 
173
            destroy local changes.
 
174
        :raise errors.UncommittedChanges: if the local tree is to be destroyed
 
175
            but contains uncommitted changes.
 
176
        :raise errors.NoBindLocation: if no bind location was specified and
 
177
            none could be autodetected.
 
178
        """
148
179
        if not force:
149
180
            self._check()
150
181
        if self._create_repository: