~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2012-06-18 11:43:07 UTC
  • mfrom: (6437.54.10 2.5)
  • mto: This revision was merged to the branch mainline in revision 6525.
  • Revision ID: jelmer@samba.org-20120618114307-zeazlym311p38m98
MergeĀ 2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3139
3139
        bzrdir.BzrFormat.check_support_status(self, allow_unsupported=allow_unsupported,
3140
3140
            recommend_upgrade=recommend_upgrade, basedir=basedir)
3141
3141
 
 
3142
    def get_controldir_for_branch(self):
 
3143
        """Get the control directory format for creating branches.
 
3144
 
 
3145
        This is to support testing of working tree formats that can not exist
 
3146
        in the same control directory as a branch.
 
3147
        """
 
3148
        return self._matchingbzrdir
 
3149
 
 
3150
 
 
3151
class WorkingTreeFormatMetaDir(bzrdir.BzrFormat, WorkingTreeFormat):
 
3152
    """Base class for working trees that live in bzr meta directories."""
 
3153
 
 
3154
    def __init__(self):
 
3155
        WorkingTreeFormat.__init__(self)
 
3156
        bzrdir.BzrFormat.__init__(self)
 
3157
 
 
3158
    @classmethod
 
3159
    def find_format_string(klass, controldir):
 
3160
        """Return format name for the working tree object in controldir."""
 
3161
        try:
 
3162
            transport = controldir.get_workingtree_transport(None)
 
3163
            return transport.get_bytes("format")
 
3164
        except errors.NoSuchFile:
 
3165
            raise errors.NoWorkingTree(base=transport.base)
 
3166
 
 
3167
    @classmethod
 
3168
    def find_format(klass, controldir):
 
3169
        """Return the format for the working tree object in controldir."""
 
3170
        format_string = klass.find_format_string(controldir)
 
3171
        return klass._find_format(format_registry, 'working tree',
 
3172
                format_string)
 
3173
 
 
3174
    def check_support_status(self, allow_unsupported, recommend_upgrade=True,
 
3175
            basedir=None):
 
3176
        WorkingTreeFormat.check_support_status(self,
 
3177
            allow_unsupported=allow_unsupported, recommend_upgrade=recommend_upgrade,
 
3178
            basedir=basedir)
 
3179
        bzrdir.BzrFormat.check_support_status(self, allow_unsupported=allow_unsupported,
 
3180
            recommend_upgrade=recommend_upgrade, basedir=basedir)
 
3181
 
3142
3182
 
3143
3183
format_registry.register_lazy("Bazaar Working Tree Format 4 (bzr 0.15)\n",
3144
3184
    "bzrlib.workingtree_4", "WorkingTreeFormat4")