~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

(vila) Provide a config section matcher respecting the file order. (Vincent
 Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
 
48
48
from bzrlib import (
49
49
    branch,
50
 
    bzrdir,
51
50
    conflicts as _mod_conflicts,
52
51
    controldir,
53
52
    errors,
72
71
 
73
72
# Explicitly import bzrlib.bzrdir so that the BzrProber
74
73
# is guaranteed to be registered.
75
 
import bzrlib.bzrdir
 
74
from bzrlib import (
 
75
    bzrdir,
 
76
    symbol_versioning,
 
77
    )
76
78
 
77
 
from bzrlib import symbol_versioning
78
79
from bzrlib.decorators import needs_read_lock, needs_write_lock
79
80
from bzrlib.i18n import gettext
80
81
from bzrlib.lock import LogicalLockResult
267
268
        """
268
269
        if path is None:
269
270
            path = osutils.getcwd()
270
 
        control = controldir.ControlDir.open(path, _unsupported)
271
 
        return control.open_workingtree(_unsupported)
 
271
        control = controldir.ControlDir.open(path, _unsupported=_unsupported)
 
272
        return control.open_workingtree(unsupported=_unsupported)
272
273
 
273
274
    @staticmethod
274
275
    def open_containing(path=None):
2976
2977
                if dir[2] == _directory:
2977
2978
                    pending.append(dir)
2978
2979
 
 
2980
    @needs_write_lock
 
2981
    def update_feature_flags(self, updated_flags):
 
2982
        """Update the feature flags for this branch.
 
2983
 
 
2984
        :param updated_flags: Dictionary mapping feature names to necessities
 
2985
            A necessity can be None to indicate the feature should be removed
 
2986
        """
 
2987
        self._format._update_feature_flags(updated_flags)
 
2988
        self.control_transport.put_bytes('format', self._format.as_string())
 
2989
 
2979
2990
 
2980
2991
class WorkingTreeFormatRegistry(controldir.ControlComponentFormatRegistry):
2981
2992
    """Registry for working tree formats."""
3133
3144
        return self._matchingbzrdir
3134
3145
 
3135
3146
 
3136
 
class WorkingTreeFormatMetaDir(bzrdir.BzrDirMetaComponentFormat, WorkingTreeFormat):
 
3147
class WorkingTreeFormatMetaDir(bzrdir.BzrFormat, WorkingTreeFormat):
3137
3148
    """Base class for working trees that live in bzr meta directories."""
3138
3149
 
3139
3150
    def __init__(self):
3140
3151
        WorkingTreeFormat.__init__(self)
3141
 
        bzrdir.BzrDirMetaComponentFormat.__init__(self)
 
3152
        bzrdir.BzrFormat.__init__(self)
3142
3153
 
3143
3154
    @classmethod
3144
3155
    def find_format_string(klass, controldir):
3156
3167
        return klass._find_format(format_registry, 'working tree',
3157
3168
                format_string)
3158
3169
 
 
3170
    def check_support_status(self, allow_unsupported, recommend_upgrade=True,
 
3171
            basedir=None):
 
3172
        WorkingTreeFormat.check_support_status(self,
 
3173
            allow_unsupported=allow_unsupported, recommend_upgrade=recommend_upgrade,
 
3174
            basedir=basedir)
 
3175
        bzrdir.BzrFormat.check_support_status(self, allow_unsupported=allow_unsupported,
 
3176
            recommend_upgrade=recommend_upgrade, basedir=basedir)
 
3177
 
3159
3178
 
3160
3179
format_registry.register_lazy("Bazaar Working Tree Format 4 (bzr 0.15)\n",
3161
3180
    "bzrlib.workingtree_4", "WorkingTreeFormat4")