/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: 2009-03-19 16:43:56 UTC
  • mto: (0.436.139 foreign)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20090319164356-iwxw3x3ntre7fjxc
Fix formatting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org>
 
1
# Copyright (C) 2005-2009 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 3 of the License, or
 
5
# the Free Software Foundation; either version 2 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 osutils
17
 
from bzrlib.versionedfile import VirtualVersionedFiles
 
16
from bzrlib import (
 
17
    osutils,
 
18
    )
 
19
from bzrlib.versionedfile import (
 
20
    VirtualVersionedFiles,
 
21
    )
 
22
 
 
23
from bzrlib.errors import (
 
24
    NoSuchRevision,
 
25
    )
18
26
 
19
27
 
20
28
class VirtualRevisionTexts(VirtualVersionedFiles):
24
32
        super(VirtualRevisionTexts, self).__init__(self.repository._make_parents_provider().get_parent_map, self.get_lines)
25
33
 
26
34
    def get_lines(self, key):
27
 
        return osutils.split_lines(self.repository.get_revision_xml(key))
28
 
 
29
 
    # TODO: annotate, iter_lines_added_or_present_in_keys, keys
 
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()
30
44
 
31
45
 
32
46
class VirtualInventoryTexts(VirtualVersionedFiles):
36
50
        super(VirtualInventoryTexts, self).__init__(self.repository._make_parents_provider().get_parent_map, self.get_lines)
37
51
 
38
52
    def get_lines(self, key):
39
 
        return osutils.split_lines(self.repository.get_inventory_xml(key))
40
 
 
41
 
    # TODO: annotate, iter_lines_added_or_present_in_keys, keys
 
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
42
62
 
43
63
 
44
64
class VirtualSignatureTexts(VirtualVersionedFiles):
48
68
        super(VirtualSignatureTexts, self).__init__(self.repository._make_parents_provider().get_parent_map, self.get_lines)
49
69
 
50
70
    def get_lines(self, key):
51
 
        return osutils.split_lines(self.repository.get_signature_text(key))
52
 
 
53
 
    # TODO: annotate, iter_lines_added_or_present_in_keys, keys
 
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
54
80