~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-03-02 20:45:08 UTC
  • mfrom: (5051.3.9 named-branches)
  • Revision ID: pqm@pqm.ubuntu.com-20100302204508-4j07g2h9wj49o494
(Jelmer) Add name argument to BzrDir.create_branch(),
        BzrDir.destroy_branch() and BzrDir.open_branch().

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
        self._ensure_real()
243
243
        self._real_bzrdir.destroy_repository()
244
244
 
245
 
    def create_branch(self):
 
245
    def create_branch(self, name=None):
 
246
        if name is not None:
 
247
            raise errors.NoColocatedBranchSupport(self)
246
248
        # as per meta1 formats - just delegate to the format object which may
247
249
        # be parameterised.
248
250
        real_branch = self._format.get_branch_format().initialize(self)
259
261
        self._next_open_branch_result = result
260
262
        return result
261
263
 
262
 
    def destroy_branch(self):
 
264
    def destroy_branch(self, name=None):
263
265
        """See BzrDir.destroy_branch"""
264
266
        self._ensure_real()
265
 
        self._real_bzrdir.destroy_branch()
 
267
        self._real_bzrdir.destroy_branch(name=name)
266
268
        self._next_open_branch_result = None
267
269
 
268
270
    def create_workingtree(self, revision_id=None, from_branch=None):
318
320
        """See BzrDir._get_tree_branch()."""
319
321
        return None, self.open_branch()
320
322
 
321
 
    def open_branch(self, _unsupported=False, ignore_fallbacks=False):
322
 
        if _unsupported:
 
323
    def open_branch(self, name=None, unsupported=False,
 
324
                    ignore_fallbacks=False):
 
325
        if unsupported:
323
326
            raise NotImplementedError('unsupported flag support not implemented yet.')
 
327
        if name is not None:
 
328
            raise errors.NoColocatedBranchSupport(self)
324
329
        if self._next_open_branch_result is not None:
325
330
            # See create_branch for details.
326
331
            result = self._next_open_branch_result