~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Give branch its own basis tree and last_revision methods; deprecated branch.working_tree()

Show diffs side-by-side

added added

removed removed

Lines of Context:
589
589
                else:
590
590
                    raise
591
591
            try:
592
 
                br_from.clone(to_location, revision_id, basis_branch)
 
592
                branch = br_from.clone(to_location, revision_id, basis_branch)
593
593
            except bzrlib.errors.NoSuchRevision:
594
594
                rmtree(to_location)
595
595
                msg = "The branch %s has no revision %s." % (from_location, revision[0])
598
598
                rmtree(to_location)
599
599
                msg = "The branch %s cannot be used as a --basis"
600
600
                raise BzrCommandError(msg)
601
 
            branch = Branch.open(to_location)
 
601
            WorkingTree.create(branch, to_location)
602
602
            if name:
603
603
                branch.control_files.put_utf8('branch-name', name)
604
604
 
618
618
    @display_command
619
619
    def run(self, dir=u'.'):
620
620
        tree = WorkingTree.open_containing(dir)[0]
621
 
        old_inv = tree.branch.basis_tree().inventory
 
621
        old_inv = tree.basis_tree().inventory
622
622
        new_inv = tree.read_working_inventory()
623
623
 
624
624
        renames = list(bzrlib.tree.find_renames(old_inv, new_inv))
820
820
    @display_command
821
821
    def run(self, show_ids=False):
822
822
        tree = WorkingTree.open_containing(u'.')[0]
823
 
        old = tree.branch.basis_tree()
 
823
        old = tree.basis_tree()
824
824
        for path, ie in old.inventory.iter_entries():
825
825
            if not tree.has_id(ie.file_id):
826
826
                if show_ids:
837
837
        from bzrlib.delta import compare_trees
838
838
 
839
839
        tree = WorkingTree.open_containing(u'.')[0]
840
 
        td = compare_trees(tree.branch.basis_tree(), tree)
 
840
        td = compare_trees(tree.basis_tree(), tree)
841
841
 
842
842
        for path, id, kind, text_modified, meta_modified in td.modified:
843
843
            print path
850
850
    @display_command
851
851
    def run(self):
852
852
        wt = WorkingTree.open_containing(u'.')[0]
853
 
        basis_inv = wt.branch.basis_tree().inventory
 
853
        basis_inv = wt.basis_tree().inventory
854
854
        inv = wt.inventory
855
855
        for file_id in inv:
856
856
            if file_id in basis_inv:
1684
1684
                    
1685
1685
                    for name, ie in tree.inventory.iter_entries(file_id):
1686
1686
                        interesting_ids.add(ie.file_id)
1687
 
            transform_tree(tree, tree.branch.basis_tree(), interesting_ids)
 
1687
            transform_tree(tree, tree.basis_tree(), interesting_ids)
1688
1688
            if file_list is None:
1689
1689
                restore_files = list(tree.iter_conflicts())
1690
1690
            else: