/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
5
 
# the Free Software Foundation; either version 2 of the License, or
 
5
# the Free Software Foundation; either version 3 of the License, or
6
6
# (at your option) any later version.
7
7
 
8
8
# This program is distributed in the hope that it will be useful,
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 (
17
 
    osutils,
18
 
    )
19
 
from bzrlib.versionedfile import (
20
 
    VirtualVersionedFiles,
21
 
    )
 
16
from bzrlib import osutils, urlutils
 
17
from bzrlib.versionedfile import FulltextContentFactory, VersionedFiles, VirtualVersionedFiles
22
18
 
23
 
from bzrlib.errors import (
24
 
    NoSuchRevision,
25
 
    )
 
19
from cStringIO import StringIO
26
20
 
27
21
 
28
22
class VirtualRevisionTexts(VirtualVersionedFiles):
32
26
        super(VirtualRevisionTexts, self).__init__(self.repository._make_parents_provider().get_parent_map, self.get_lines)
33
27
 
34
28
    def get_lines(self, key):
35
 
        try:
36
 
            return osutils.split_lines(self.repository.get_revision_xml(key))
37
 
        except NoSuchRevision:
38
 
            return None
39
 
 
40
 
    # TODO: annotate
41
 
 
42
 
    def keys(self):
43
 
        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
44
32
 
45
33
 
46
34
class VirtualInventoryTexts(VirtualVersionedFiles):
50
38
        super(VirtualInventoryTexts, self).__init__(self.repository._make_parents_provider().get_parent_map, self.get_lines)
51
39
 
52
40
    def get_lines(self, key):
53
 
        try:
54
 
            return osutils.split_lines(self.repository.get_inventory_xml(key))
55
 
        except NoSuchRevision:
56
 
            return None
57
 
 
58
 
    def keys(self):
59
 
        return self.repository.all_revision_ids()
60
 
 
61
 
    # 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
62
44
 
63
45
 
64
46
class VirtualSignatureTexts(VirtualVersionedFiles):
68
50
        super(VirtualSignatureTexts, self).__init__(self.repository._make_parents_provider().get_parent_map, self.get_lines)
69
51
 
70
52
    def get_lines(self, key):
71
 
        try:
72
 
            return osutils.split_lines(self.repository.get_signature_text(key))
73
 
        except NoSuchRevision:
74
 
            return None
75
 
 
76
 
    def keys(self):
77
 
        return self.repository.all_revision_ids()
78
 
 
79
 
    # 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
80
56