/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to versionedfiles.py

  • Committer: Jelmer Vernooij
  • Date: 2008-08-29 14:56:37 UTC
  • mto: (0.219.2 trunk)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20080829145637-f7z73y580w4ztcym
Import virtual versionedfiles code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2009 Jelmer Vernooij <jelmer@samba.org>
 
1
# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org>
2
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
 
from bzrlib import osutils
17
 
from bzrlib.versionedfile import VirtualVersionedFiles
 
16
from bzrlib import osutils, urlutils
 
17
from bzrlib.versionedfile import FulltextContentFactory, VersionedFiles, VirtualVersionedFiles
18
18
 
19
 
from bzrlib.errors import NoSuchRevision
 
19
from cStringIO import StringIO
20
20
 
21
21
 
22
22
class VirtualRevisionTexts(VirtualVersionedFiles):
26
26
        super(VirtualRevisionTexts, self).__init__(self.repository._make_parents_provider().get_parent_map, self.get_lines)
27
27
 
28
28
    def get_lines(self, key):
29
 
        try:
30
 
            return osutils.split_lines(self.repository.get_revision_xml(key))
31
 
        except NoSuchRevision:
32
 
            return None
33
 
 
34
 
    # TODO: annotate
35
 
 
36
 
    def keys(self):
37
 
        return self.repository.all_revision_ids()
 
29
        return osutils.split_lines(self.repository.get_revision_xml(key))
 
30
 
 
31
    # TODO: annotate, iter_lines_added_or_present_in_keys, keys
38
32
 
39
33
 
40
34
class VirtualInventoryTexts(VirtualVersionedFiles):
44
38
        super(VirtualInventoryTexts, self).__init__(self.repository._make_parents_provider().get_parent_map, self.get_lines)
45
39
 
46
40
    def get_lines(self, key):
47
 
        try:
48
 
            return osutils.split_lines(self.repository.get_inventory_xml(key))
49
 
        except NoSuchRevision:
50
 
            return None
51
 
 
52
 
    def keys(self):
53
 
        return self.repository.all_revision_ids()
54
 
 
55
 
    # TODO: annotate
 
41
        return osutils.split_lines(self.repository.get_inventory_xml(key))
 
42
 
 
43
    # TODO: annotate, iter_lines_added_or_present_in_keys, keys
56
44
 
57
45
 
58
46
class VirtualSignatureTexts(VirtualVersionedFiles):
62
50
        super(VirtualSignatureTexts, self).__init__(self.repository._make_parents_provider().get_parent_map, self.get_lines)
63
51
 
64
52
    def get_lines(self, key):
65
 
        try:
66
 
            return osutils.split_lines(self.repository.get_signature_text(key))
67
 
        except NoSuchRevision:
68
 
            return None
69
 
 
70
 
    def keys(self):
71
 
        return self.repository.all_revision_ids()
72
 
 
73
 
    # TODO: annotate
 
53
        return osutils.split_lines(self.repository.get_signature_text(key))
 
54
 
 
55
    # TODO: annotate, iter_lines_added_or_present_in_keys, keys
74
56