~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

Split out repository into .bzr/repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
318
318
        return self.branch.repository.revision_tree(revision_id)
319
319
 
320
320
    @staticmethod
 
321
    @deprecated_method(zero_eight)
321
322
    def create(branch, directory):
322
323
        """Create a workingtree for branch at directory.
323
324
 
333
334
        XXX: When BzrDir is present, these should be created through that 
334
335
        interface instead.
335
336
        """
 
337
        warn('delete WorkingTree.create', stacklevel=3)
336
338
        transport = get_transport(directory)
337
339
        if branch.bzrdir.transport.clone('..').base == transport.base:
338
340
            # same dir 
341
343
        # create a branch reference
342
344
        # and now a working tree.
343
345
        raise NotImplementedError
344
 
        try:
345
 
            os.mkdir(directory)
346
 
        except OSError, e:
347
 
            if e.errno != errno.EEXIST:
348
 
                raise
349
 
        try:
350
 
            os.mkdir(pathjoin(directory, '.bzr'))
351
 
        except OSError, e:
352
 
            if e.errno != errno.EEXIST:
353
 
                raise
354
 
        revision_tree = branch.repository.revision_tree(branch.last_revision())
355
 
        inv = revision_tree.inventory
356
 
        wt = WorkingTree(directory, branch, inv, _internal=True)
357
 
        wt._write_inventory(inv)
358
 
        wt.set_root_id(revision_tree.inventory.root.file_id)
359
 
        if branch.last_revision() is not None:
360
 
            wt.set_last_revision(branch.last_revision())
361
 
        wt.set_pending_merges([])
362
 
        wt.revert([])
363
 
        return wt
364
346
 
365
347
    @staticmethod
366
348
    @deprecated_method(zero_eight)