~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-03 23:16:56 UTC
  • mto: This revision was merged to the branch mainline in revision 5819.
  • Revision ID: jelmer@samba.org-20110503231656-4sxm717yejm8cpuw
Add tariff test to make sure working tree isn't opened by 'bzr serve'
that simply accesses a branch.

Show diffs side-by-side

added added

removed removed

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