~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/controldir.py

  • Committer: Martin von Gagern
  • Date: 2011-06-01 12:53:56 UTC
  • mto: This revision was merged to the branch mainline in revision 6009.
  • Revision ID: martin.vgagern@gmx.net-20110601125356-lwozv2vecea6hxfz
Change from no_decorate to classify as name for the argument.

The command line switch remains as --no-classify, to keep backwards
compatibility.  Users are free to include --no-classify in an alias, and
still use --classify to change back.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    revision as _mod_revision,
32
32
    transport as _mod_transport,
33
33
    ui,
34
 
    urlutils,
35
34
    )
36
35
from bzrlib.push import (
37
36
    PushResult,
75
74
        return self.user_transport.base
76
75
 
77
76
 
 
77
 
78
78
class ControlDir(ControlComponent):
79
79
    """A control directory.
80
80
 
145
145
        """Destroy the repository in this ControlDir."""
146
146
        raise NotImplementedError(self.destroy_repository)
147
147
 
148
 
    def create_branch(self, name=None, repository=None,
149
 
                      append_revisions_only=None):
 
148
    def create_branch(self, name=None, repository=None):
150
149
        """Create a branch in this ControlDir.
151
150
 
152
151
        :param name: Name of the colocated branch to create, None for
153
152
            the default branch.
154
 
        :param append_revisions_only: Whether this branch should only allow
155
 
            appending new revisions to its history.
156
153
 
157
154
        The controldirs format will control what branch format is created.
158
155
        For more control see BranchFormatXX.create(a_controldir).
196
193
        """
197
194
        raise NotImplementedError(self.destroy_workingtree_metadata)
198
195
 
199
 
    def find_branch_format(self, name=None):
200
 
        """Find the branch 'format' for this bzrdir.
201
 
 
202
 
        This might be a synthetic object for e.g. RemoteBranch and SVN.
203
 
        """
204
 
        raise NotImplementedError(self.find_branch_format)
205
 
 
206
196
    def get_branch_reference(self, name=None):
207
197
        """Return the referenced URL for the branch in this controldir.
208
198
 
276
266
        except errors.NotBranchError:
277
267
            return False
278
268
 
279
 
    def _get_selected_branch(self):
280
 
        """Return the name of the branch selected by the user.
281
 
 
282
 
        :return: Name of the branch selected by the user, or None.
283
 
        """
284
 
        branch = self.root_transport.get_segment_parameters().get("branch")
285
 
        if branch is not None:
286
 
            branch = urlutils.unescape(branch)
287
 
        return branch
288
 
 
289
269
    def has_workingtree(self):
290
270
        """Tell if this controldir contains a working tree.
291
271
 
681
661
    def is_supported(self):
682
662
        """Is this format supported?
683
663
 
684
 
        Supported formats must be openable.
 
664
        Supported formats must be initializable and openable.
685
665
        Unsupported formats may not support initialization or committing or
686
666
        some other features depending on the reason for not being supported.
687
667
        """
688
668
        return True
689
669
 
690
 
    def is_initializable(self):
691
 
        """Whether new control directories of this format can be initialized.
692
 
        """
693
 
        return self.is_supported()
694
 
 
695
670
    def check_support_status(self, allow_unsupported, recommend_upgrade=True,
696
671
        basedir=None):
697
672
        """Give an error or warning on old formats.