~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/controldir.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-01 19:18:09 UTC
  • mfrom: (6459 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6460.
  • Revision ID: jelmer@samba.org-20120201191809-xn340a5i5v4fqsfu
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
        """Create a branch in this ControlDir.
164
164
 
165
165
        :param name: Name of the colocated branch to create, None for
166
 
            the default branch.
 
166
            the user selected branch or "" for the active branch.
167
167
        :param append_revisions_only: Whether this branch should only allow
168
168
            appending new revisions to its history.
169
169
 
175
175
    def destroy_branch(self, name=None):
176
176
        """Destroy a branch in this ControlDir.
177
177
 
178
 
        :param name: Name of the branch to destroy, None for the default 
179
 
            branch.
 
178
        :param name: Name of the branch to destroy, None for the 
 
179
            user selected branch or "" for the active branch.
 
180
        :raise NotBranchError: When the branch does not exist
180
181
        """
181
182
        raise NotImplementedError(self.destroy_branch)
182
183
 
302
303
    def _get_selected_branch(self):
303
304
        """Return the name of the branch selected by the user.
304
305
 
305
 
        :return: Name of the branch selected by the user, or None.
 
306
        :return: Name of the branch selected by the user, or "".
306
307
        """
307
308
        branch = self.root_transport.get_segment_parameters().get("branch")
308
309
        if branch is None:
778
779
        return controldir._get_tree_branch()
779
780
 
780
781
    @classmethod
781
 
    def open_containing_tree_or_branch(klass, location):
 
782
    def open_containing_tree_or_branch(klass, location,
 
783
            possible_transports=None):
782
784
        """Return the branch and working tree contained by a location.
783
785
 
784
786
        Returns (tree, branch, relpath).
787
789
        raised
788
790
        relpath is the portion of the path that is contained by the branch.
789
791
        """
790
 
        controldir, relpath = klass.open_containing(location)
 
792
        controldir, relpath = klass.open_containing(location,
 
793
            possible_transports=possible_transports)
791
794
        tree, branch = controldir._get_tree_branch()
792
795
        return tree, branch, relpath
793
796