~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

[patch] Aaron Bentley: make revert work in a subdirectory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1708
1708
                raise BzrCommandError("No files specified")
1709
1709
        else:
1710
1710
            file_list = []
 
1711
        
 
1712
        tree, file_list = tree_files(file_list)
1711
1713
        if revision is None:
1712
 
            revno = -1
1713
 
            tree = WorkingTree.open_containing(u'.')[0]
1714
1714
            # FIXME should be tree.last_revision
1715
1715
            rev_id = tree.branch.last_revision()
1716
1716
        elif len(revision) != 1:
1717
1717
            raise BzrCommandError('bzr revert --revision takes exactly 1 argument')
1718
1718
        else:
1719
 
            tree, file_list = tree_files(file_list)
1720
1719
            rev_id = revision[0].in_history(tree.branch).rev_id
1721
1720
        tree.revert(file_list, tree.branch.revision_tree(rev_id),
1722
 
                                not no_backup)
 
1721
                    not no_backup)
1723
1722
 
1724
1723
 
1725
1724
class cmd_assert_fail(Command):