/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/branch.py

  • Committer: Andrew Bennetts
  • Date: 2009-03-18 07:28:14 UTC
  • mto: This revision was merged to the branch mainline in revision 4194.
  • Revision ID: andrew.bennetts@canonical.com-20090318072814-chvt67ssr9jyz259
Add ignore_fallbacks flag.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1318
1318
        """
1319
1319
        raise NotImplementedError(self.network_name)
1320
1320
 
1321
 
    def open(self, a_bzrdir, _found=False):
 
1321
    def open(self, a_bzrdir, _found=False, ignore_fallbacks=False):
1322
1322
        """Return the branch object for a_bzrdir
1323
1323
 
1324
1324
        _found is a private parameter, do not use it. It is used to indicate
1500
1500
        """The network name for this format is the control dirs disk label."""
1501
1501
        return self._matchingbzrdir.get_format_string()
1502
1502
 
1503
 
    def open(self, a_bzrdir, _found=False):
 
1503
    def open(self, a_bzrdir, _found=False, ignore_fallbacks=False):
1504
1504
        """Return the branch object for a_bzrdir
1505
1505
 
1506
1506
        _found is a private parameter, do not use it. It is used to indicate
1532
1532
        """
1533
1533
        return self.get_format_string()
1534
1534
 
1535
 
    def open(self, a_bzrdir, _found=False):
 
1535
    def open(self, a_bzrdir, _found=False, ignore_fallbacks=False):
1536
1536
        """Return the branch object for a_bzrdir.
1537
1537
 
1538
1538
        _found is a private parameter, do not use it. It is used to indicate
1550
1550
            return self._branch_class()(_format=self,
1551
1551
                              _control_files=control_files,
1552
1552
                              a_bzrdir=a_bzrdir,
1553
 
                              _repository=a_bzrdir.find_repository())
 
1553
                              _repository=a_bzrdir.find_repository(),
 
1554
                              ignore_fallbacks=ignore_fallbacks)
1554
1555
        except errors.NoSuchFile:
1555
1556
            raise errors.NotBranchError(path=transport.base)
1556
1557
 
1736
1737
        return clone
1737
1738
 
1738
1739
    def open(self, a_bzrdir, _found=False, location=None,
1739
 
             possible_transports=None):
 
1740
             possible_transports=None, ignore_fallbacks=False):
1740
1741
        """Return the branch that the branch reference in a_bzrdir points at.
1741
1742
 
1742
1743
        _found is a private parameter, do not use it. It is used to indicate
1751
1752
            location = self.get_reference(a_bzrdir)
1752
1753
        real_bzrdir = bzrdir.BzrDir.open(
1753
1754
            location, possible_transports=possible_transports)
1754
 
        result = real_bzrdir.open_branch()
 
1755
        result = real_bzrdir.open_branch(ignore_fallbacks=ignore_fallbacks)
1755
1756
        # this changes the behaviour of result.clone to create a new reference
1756
1757
        # rather than a copy of the content of the branch.
1757
1758
        # I did not use a proxy object because that needs much more extensive
1804
1805
    """
1805
1806
 
1806
1807
    def __init__(self, _format=None,
1807
 
                 _control_files=None, a_bzrdir=None, _repository=None):
 
1808
                 _control_files=None, a_bzrdir=None, _repository=None,
 
1809
                 ignore_fallbacks=False):
1808
1810
        """Create new branch object at a particular location."""
1809
1811
        if a_bzrdir is None:
1810
1812
            raise ValueError('a_bzrdir must be supplied')
2304
2306
            self._get_fallback_repository(url))
2305
2307
 
2306
2308
    def _open_hook(self):
 
2309
#        from bzrlib.smart.request import jail_info
 
2310
#        if jail_info.transports is not None:
 
2311
#            return
 
2312
        if self._ignore_fallbacks:
 
2313
            return
2307
2314
        try:
2308
2315
            url = self.get_stacked_on_url()
2309
2316
        except (errors.UnstackableRepositoryFormat, errors.NotStacked,
2324
2331
            raise errors.UnstackableRepositoryFormat(self.repository._format,
2325
2332
                self.repository.base)
2326
2333
 
2327
 
    def __init__(self, *args, **kwargs):
2328
 
        super(BzrBranch7, self).__init__(*args, **kwargs)
 
2334
    def __init__(self, _format=None, _control_files=None, a_bzrdir=None,
 
2335
        _repository=None, ignore_fallbacks=False):
 
2336
        self._ignore_fallbacks = ignore_fallbacks
 
2337
        BzrBranch5.__init__(self, _format=_format,
 
2338
            _control_files=_control_files, a_bzrdir=a_bzrdir,
 
2339
            _repository=_repository)
2329
2340
        self._last_revision_info_cache = None
2330
2341
        self._partial_revision_history_cache = []
2331
2342