~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2005-12-25 00:38:48 UTC
  • mto: (1185.67.11 bzr.revision-storage)
  • mto: This revision was merged to the branch mainline in revision 1550.
  • Revision ID: aaron.bentley@utoronto.ca-20051225003848-111ac71170cb2605
Renamed Branch.storage to Branch.repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
            raise BzrCommandError('You must supply either --revision or a revision_id')
149
149
        b = WorkingTree.open_containing(u'.')[0].branch
150
150
        if revision_id is not None:
151
 
            sys.stdout.write(b.storage.get_revision_xml(revision_id))
 
151
            sys.stdout.write(b.repository.get_revision_xml(revision_id))
152
152
        elif revision is not None:
153
153
            for rev in revision:
154
154
                if rev is None:
155
155
                    raise BzrCommandError('You cannot specify a NULL revision.')
156
156
                revno, rev_id = rev.in_history(b)
157
 
                sys.stdout.write(b.storage.get_revision_xml(rev_id))
 
157
                sys.stdout.write(b.repository.get_revision_xml(rev_id))
158
158
    
159
159
 
160
160
class cmd_revno(Command):
298
298
            if len(revision) > 1:
299
299
                raise BzrCommandError('bzr inventory --revision takes'
300
300
                    ' exactly one revision identifier')
301
 
            inv = tree.branch.storage.get_revision_inventory(
 
301
            inv = tree.branch.repository.get_revision_inventory(
302
302
                revision[0].in_history(tree.branch).rev_id)
303
303
 
304
304
        for path, entry in inv.entries():
926
926
            if tree is None:
927
927
                b, fp = Branch.open_containing(filename)
928
928
                if fp != '':
929
 
                    inv = b.storage.get_inventory(b.last_revision())
 
929
                    inv = b.repository.get_inventory(b.last_revision())
930
930
            if fp != '':
931
931
                file_id = inv.path2id(fp)
932
932
            else:
1035
1035
        elif relpath:
1036
1036
            relpath += '/'
1037
1037
        if revision is not None:
1038
 
            tree = tree.branch.storage.revision_tree(
 
1038
            tree = tree.branch.repository.revision_tree(
1039
1039
                revision[0].in_history(tree.branch).rev_id)
1040
1040
        for fp, fc, kind, fid, entry in tree.list_files():
1041
1041
            if fp.startswith(relpath):
1193
1193
            if len(revision) != 1:
1194
1194
                raise BzrError('bzr export --revision takes exactly 1 argument')
1195
1195
            rev_id = revision[0].in_history(b).rev_id
1196
 
        t = b.storage.revision_tree(rev_id)
 
1196
        t = b.repository.revision_tree(rev_id)
1197
1197
        try:
1198
1198
            export(t, dest, format, root)
1199
1199
        except errors.NoSuchExportFormat, e:
1631
1631
                raise BzrCommandError("Sorry, remerge only works after normal"
1632
1632
                                      + " merges.  Not cherrypicking or"
1633
1633
                                      + "multi-merges.")
 
1634
            repository = tree.branch.repository
1634
1635
            base_revision = common_ancestor(tree.branch.last_revision(), 
1635
 
                                            pending_merges[0],
1636
 
                                            tree.branch.storage)
1637
 
            base_tree = tree.branch.storage.revision_tree(base_revision)
1638
 
            other_tree = tree.branch.storage.revision_tree(pending_merges[0])
 
1636
                                            pending_merges[0], repository)
 
1637
            base_tree = repository.revision_tree(base_revision)
 
1638
            other_tree = repository.revision_tree(pending_merges[0])
1639
1639
            interesting_ids = None
1640
1640
            if file_list is not None:
1641
1641
                interesting_ids = set()
1699
1699
        else:
1700
1700
            tree, file_list = tree_files(file_list)
1701
1701
            rev_id = revision[0].in_history(tree.branch).rev_id
1702
 
        tree.revert(file_list, tree.branch.storage.revision_tree(rev_id),
 
1702
        tree.revert(file_list, tree.branch.repository.revision_tree(rev_id),
1703
1703
                    not no_backup)
1704
1704
 
1705
1705
 
1802
1802
            remote_extra.reverse()
1803
1803
        if local_extra and not theirs_only:
1804
1804
            print "You have %d extra revision(s):" % len(local_extra)
1805
 
            for data in iter_log_data(local_extra, local_branch.storage,
 
1805
            for data in iter_log_data(local_extra, local_branch.repository,
1806
1806
                                      verbose):
1807
1807
                lf.show(*data)
1808
1808
            printed_local = True
1812
1812
            if printed_local is True:
1813
1813
                print "\n\n"
1814
1814
            print "You are missing %d revision(s):" % len(remote_extra)
1815
 
            for data in iter_log_data(remote_extra, remote_branch.storage, 
 
1815
            for data in iter_log_data(remote_extra, remote_branch.repository, 
1816
1816
                                      verbose):
1817
1817
                lf.show(*data)
1818
1818
        if not remote_extra and not local_extra:
1859
1859
                rev_id = b.last_revision()
1860
1860
            else:
1861
1861
                rev_id = revision[0].in_history(b).rev_id
1862
 
            t = Testament.from_revision(b.storage, rev_id)
 
1862
            t = Testament.from_revision(b.repository, rev_id)
1863
1863
            if long:
1864
1864
                sys.stdout.writelines(t.as_text_lines())
1865
1865
            else:
1895
1895
        branch.lock_read()
1896
1896
        try:
1897
1897
            file_id = tree.inventory.path2id(relpath)
1898
 
            tree = branch.storage.revision_tree(branch.last_revision())
 
1898
            tree = branch.repository.revision_tree(branch.last_revision())
1899
1899
            file_version = tree.inventory[file_id].revision
1900
1900
            annotate_file(branch, file_version, file_id, long, all, sys.stdout)
1901
1901
        finally:
1920
1920
        b = WorkingTree.open_containing(u'.')[0].branch
1921
1921
        gpg_strategy = gpg.GPGStrategy(config.BranchConfig(b))
1922
1922
        if revision_id is not None:
1923
 
            b.storage.sign_revision(revision_id, gpg_strategy)
 
1923
            b.repository.sign_revision(revision_id, gpg_strategy)
1924
1924
        elif revision is not None:
1925
1925
            if len(revision) == 1:
1926
1926
                revno, rev_id = revision[0].in_history(b)
1927
 
                b.storage.sign_revision(rev_id, gpg_strategy)
 
1927
                b.repository.sign_revision(rev_id, gpg_strategy)
1928
1928
            elif len(revision) == 2:
1929
1929
                # are they both on rh- if so we can walk between them
1930
1930
                # might be nice to have a range helper for arbitrary
1936
1936
                if from_revno is None or to_revno is None:
1937
1937
                    raise BzrCommandError('Cannot sign a range of non-revision-history revisions')
1938
1938
                for revno in range(from_revno, to_revno + 1):
1939
 
                    b.storage.sign_revision(b.get_rev_id(revno), gpg_strategy)
 
1939
                    b.repository.sign_revision(b.get_rev_id(revno), 
 
1940
                                               gpg_strategy)
1940
1941
            else:
1941
1942
                raise BzrCommandError('Please supply either one revision, or a range.')
1942
1943
 
1984
1985
        for r in range(revno, b.revno()+1):
1985
1986
            rev_id = b.get_rev_id(r)
1986
1987
            lf = log_formatter('short', to_file=sys.stdout,show_timezone='original')
1987
 
            lf.show(r, b.storage.get_revision(rev_id), None)
 
1988
            lf.show(r, b.repository.get_revision(rev_id), None)
1988
1989
 
1989
1990
        if dry_run:
1990
1991
            print 'Dry-run, pretending to remove the above revisions.'