~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-04 09:41:29 UTC
  • mfrom: (5816.3.4 serve-tariff-wt)
  • Revision ID: pqm@pqm.ubuntu.com-20110504094129-zodvq0croxdzf86w
(jelmer) Don't load working tree implementations during 'bzr serve'. (Jelmer
 Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3021
3021
    """If this format supports missing parent conflicts."""
3022
3022
 
3023
3023
    @classmethod
 
3024
    def find_format_string(klass, a_bzrdir):
 
3025
        """Return format name for the working tree object in a_bzrdir."""
 
3026
        try:
 
3027
            transport = a_bzrdir.get_workingtree_transport(None)
 
3028
            return transport.get_bytes("format")
 
3029
        except errors.NoSuchFile:
 
3030
            raise errors.NoWorkingTree(base=transport.base)
 
3031
 
 
3032
    @classmethod
3024
3033
    def find_format(klass, a_bzrdir):
3025
3034
        """Return the format for the working tree object in a_bzrdir."""
3026
3035
        try:
3027
 
            transport = a_bzrdir.get_workingtree_transport(None)
3028
 
            format_string = transport.get_bytes("format")
 
3036
            format_string = klass.find_format_string(a_bzrdir)
3029
3037
            return format_registry.get(format_string)
3030
 
        except errors.NoSuchFile:
3031
 
            raise errors.NoWorkingTree(base=transport.base)
3032
3038
        except KeyError:
3033
3039
            raise errors.UnknownFormatError(format=format_string,
3034
3040
                                            kind="working tree")