/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: John Arbash Meinel
  • Date: 2010-03-25 12:32:24 UTC
  • mfrom: (5115 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5116.
  • Revision ID: john@arbash-meinel.com-20100325123224-km80yrpbn7cm0jcr
Merge bzr.dev to be ready for NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
602
602
            # already exists, but it should instead either remove it or make
603
603
            # a new backup directory.
604
604
            #
605
 
            # FIXME: bug 262450 -- the backup directory should have the same
606
 
            # permissions as the .bzr directory (probably a bug in copy_tree)
607
605
            old_path = self.root_transport.abspath('.bzr')
608
606
            new_path = self.root_transport.abspath(backup_dir)
609
607
            ui.ui_factory.note('making backup of %s\n  to %s' % (old_path, new_path,))
715
713
        """
716
714
        return None
717
715
 
718
 
    def get_branch_transport(self, branch_format):
 
716
    def get_branch_transport(self, branch_format, name=None):
719
717
        """Get the transport for use by branch format in this BzrDir.
720
718
 
721
719
        Note that bzr dirs that do not support format strings will raise
1383
1381
 
1384
1382
    def create_branch(self, name=None):
1385
1383
        """See BzrDir.create_branch."""
1386
 
        if name is not None:
1387
 
            raise errors.NoColocatedBranchSupport(self)
1388
 
        return self._format.get_branch_format().initialize(self)
 
1384
        return self._format.get_branch_format().initialize(self, name=name)
1389
1385
 
1390
1386
    def destroy_branch(self, name=None):
1391
1387
        """See BzrDir.destroy_branch."""
1449
1445
        raise errors.UnsupportedOperation(self.destroy_workingtree_metadata,
1450
1446
                                          self)
1451
1447
 
1452
 
    def get_branch_transport(self, branch_format):
 
1448
    def get_branch_transport(self, branch_format, name=None):
1453
1449
        """See BzrDir.get_branch_transport()."""
 
1450
        if name is not None:
 
1451
            raise errors.NoColocatedBranchSupport(self)
1454
1452
        if branch_format is None:
1455
1453
            return self.transport
1456
1454
        try:
1492
1490
    def open_branch(self, name=None, unsupported=False,
1493
1491
                    ignore_fallbacks=False):
1494
1492
        """See BzrDir.open_branch."""
1495
 
        if name is not None:
1496
 
            raise errors.NoColocatedBranchSupport(self)
1497
1493
        from bzrlib.branch import BzrBranchFormat4
1498
1494
        format = BzrBranchFormat4()
1499
1495
        self._check_supported(format, unsupported)
1500
 
        return format.open(self, _found=True)
 
1496
        return format.open(self, name, _found=True)
1501
1497
 
1502
1498
    def sprout(self, url, revision_id=None, force_new_repo=False,
1503
1499
               possible_transports=None, accelerator_tree=None,
1622
1618
 
1623
1619
    def create_branch(self, name=None):
1624
1620
        """See BzrDir.create_branch."""
1625
 
        if name is not None:
1626
 
            raise errors.NoColocatedBranchSupport(self)
1627
 
        return self._format.get_branch_format().initialize(self)
 
1621
        return self._format.get_branch_format().initialize(self, name=name)
1628
1622
 
1629
1623
    def destroy_branch(self, name=None):
1630
1624
        """See BzrDir.create_branch."""
1678
1672
        format = BranchFormat.find_format(self)
1679
1673
        return format.get_reference(self)
1680
1674
 
1681
 
    def get_branch_transport(self, branch_format):
 
1675
    def get_branch_transport(self, branch_format, name=None):
1682
1676
        """See BzrDir.get_branch_transport()."""
 
1677
        if name is not None:
 
1678
            raise errors.NoColocatedBranchSupport(self)
1683
1679
        # XXX: this shouldn't implicitly create the directory if it's just
1684
1680
        # promising to get a transport -- mbp 20090727
1685
1681
        if branch_format is None:
1774
1770
    def open_branch(self, name=None, unsupported=False,
1775
1771
                    ignore_fallbacks=False):
1776
1772
        """See BzrDir.open_branch."""
1777
 
        if name is not None:
1778
 
            raise errors.NoColocatedBranchSupport(self)
1779
1773
        format = self.find_branch_format()
1780
1774
        self._check_supported(format, unsupported)
1781
 
        return format.open(self, _found=True, ignore_fallbacks=ignore_fallbacks)
 
1775
        return format.open(self, name=name,
 
1776
            _found=True, ignore_fallbacks=ignore_fallbacks)
1782
1777
 
1783
1778
    def open_repository(self, unsupported=False):
1784
1779
        """See BzrDir.open_repository."""
1816
1811
    Once a format is deprecated, just deprecate the initialize and open
1817
1812
    methods on the format class. Do not deprecate the object, as the
1818
1813
    object will be created every system load.
 
1814
 
 
1815
    :cvar colocated_branches: Whether this formats supports colocated branches.
1819
1816
    """
1820
1817
 
1821
1818
    _default_format = None