~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Robert Collins
  • Date: 2009-04-14 02:35:07 UTC
  • mto: This revision was merged to the branch mainline in revision 4291.
  • Revision ID: robertc@robertcollins.net-20090414023507-935t0u7ab2rt7kfk
Add support for a RemoteBzrDirConfig to support optimising push operations which need to look for default stacking locations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
408
408
            stack_on_pwd = None
409
409
            config = found_bzrdir.get_config()
410
410
            stop = False
411
 
            if config is not None:
412
 
                stack_on = config.get_default_stack_on()
413
 
                if stack_on is not None:
414
 
                    stack_on_pwd = found_bzrdir.root_transport.base
415
 
                    stop = True
 
411
            stack_on = config.get_default_stack_on()
 
412
            if stack_on is not None:
 
413
                stack_on_pwd = found_bzrdir.root_transport.base
 
414
                stop = True
416
415
            # does it have a repository ?
417
416
            try:
418
417
                repository = found_bzrdir.open_repository()
744
743
        raise NotImplementedError(self.get_workingtree_transport)
745
744
 
746
745
    def get_config(self):
747
 
        if getattr(self, '_get_config', None) is None:
748
 
            return None
749
 
        return self._get_config()
 
746
        """Get configuration for this BzrDir."""
 
747
        return config.BzrDirConfig(self)
 
748
 
 
749
    def _get_config(self):
 
750
        """By default, no configuration is available."""
 
751
        return None
750
752
 
751
753
    def __init__(self, _transport, _format):
752
754
        """Initialize a Bzr control dir object.
1696
1698
        return format.open(self, _found=True)
1697
1699
 
1698
1700
    def _get_config(self):
1699
 
        return config.BzrDirConfig(self.transport)
1700
 
 
 
1701
        return config.TransportConfig(self.transport, 'control.conf')
1701
1702
 
1702
1703
class BzrDirFormat(object):
1703
1704
    """An encapsulation of the initialization and open routines for a format.