~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: jelmer at samba
  • Date: 2011-10-11 12:01:51 UTC
  • mto: This revision was merged to the branch mainline in revision 6214.
  • Revision ID: jelmer@samba.org-20111011120151-l1aa35zasaocrev3
Fix tests and the like.

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
        """
260
260
        if path is None:
261
261
            path = osutils.getcwd()
262
 
        control = bzrdir.BzrDir.open(path, _unsupported)
 
262
        control = controldir.ControlDir.open(path, _unsupported)
263
263
        return control.open_workingtree(_unsupported)
264
264
 
265
265
    @staticmethod
277
277
        """
278
278
        if path is None:
279
279
            path = osutils.getcwd()
280
 
        control, relpath = bzrdir.BzrDir.open_containing(path)
 
280
        control, relpath = controldir.ControlDir.open_containing(path)
281
281
        return control.open_workingtree(), relpath
282
282
 
283
283
    @staticmethod
366
366
            else:
367
367
                return True, tree
368
368
        t = transport.get_transport(location)
369
 
        iterator = bzrdir.BzrDir.find_bzrdirs(t, evaluate=evaluate,
 
369
        iterator = controldir.ControlDir.find_bzrdirs(t, evaluate=evaluate,
370
370
                                              list_current=list_current)
371
371
        return [tr for tr in iterator if tr is not None]
372
372
 
2982
2982
    supports_versioned_directories = None
2983
2983
 
2984
2984
    @classmethod
2985
 
    def find_format_string(klass, a_bzrdir):
2986
 
        """Return format name for the working tree object in a_bzrdir."""
 
2985
    def find_format_string(klass, controldir):
 
2986
        """Return format name for the working tree object in controldir."""
2987
2987
        try:
2988
 
            transport = a_bzrdir.get_workingtree_transport(None)
 
2988
            transport = controldir.get_workingtree_transport(None)
2989
2989
            return transport.get_bytes("format")
2990
2990
        except errors.NoSuchFile:
2991
2991
            raise errors.NoWorkingTree(base=transport.base)
2992
2992
 
2993
2993
    @classmethod
2994
 
    def find_format(klass, a_bzrdir):
2995
 
        """Return the format for the working tree object in a_bzrdir."""
 
2994
    def find_format(klass, controldir):
 
2995
        """Return the format for the working tree object in controldir."""
2996
2996
        try:
2997
 
            format_string = klass.find_format_string(a_bzrdir)
 
2997
            format_string = klass.find_format_string(controldir)
2998
2998
            return format_registry.get(format_string)
2999
2999
        except KeyError:
3000
3000
            raise errors.UnknownFormatError(format=format_string,
3001
3001
                                            kind="working tree")
3002
3002
 
3003
 
    def initialize(self, a_bzrdir, revision_id=None, from_branch=None,
 
3003
    def initialize(self, controldir, revision_id=None, from_branch=None,
3004
3004
                   accelerator_tree=None, hardlink=False):
3005
 
        """Initialize a new working tree in a_bzrdir.
 
3005
        """Initialize a new working tree in controldir.
3006
3006
 
3007
 
        :param a_bzrdir: BzrDir to initialize the working tree in.
 
3007
        :param controldir: ControlDir to initialize the working tree in.
3008
3008
        :param revision_id: allows creating a working tree at a different
3009
3009
            revision than the branch is at.
3010
3010
        :param from_branch: Branch to checkout