bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
0.205.5
by Jelmer Vernooij
Import virtual versionedfiles code. |
1 |
# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org>
|
2 |
||
3 |
# This program is free software; you can redistribute it and/or modify
|
|
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
|
|
6 |
# (at your option) any later version.
|
|
7 |
||
8 |
# This program is distributed in the hope that it will be useful,
|
|
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11 |
# GNU General Public License for more details.
|
|
12 |
||
13 |
# You should have received a copy of the GNU General Public License
|
|
14 |
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
15 |
||
0.205.19
by Jelmer Vernooij
import bzr-svn improvements. |
16 |
from bzrlib import osutils |
17 |
from bzrlib.versionedfile import VirtualVersionedFiles |
|
0.205.5
by Jelmer Vernooij
Import virtual versionedfiles code. |
18 |
|
19 |
||
20 |
class VirtualRevisionTexts(VirtualVersionedFiles): |
|
21 |
"""Virtual revisions backend.""" |
|
22 |
def __init__(self, repository): |
|
23 |
self.repository = repository |
|
24 |
super(VirtualRevisionTexts, self).__init__(self.repository._make_parents_provider().get_parent_map, self.get_lines) |
|
25 |
||
26 |
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
|
|
30 |
||
31 |
||
32 |
class VirtualInventoryTexts(VirtualVersionedFiles): |
|
33 |
"""Virtual inventories backend.""" |
|
34 |
def __init__(self, repository): |
|
35 |
self.repository = repository |
|
36 |
super(VirtualInventoryTexts, self).__init__(self.repository._make_parents_provider().get_parent_map, self.get_lines) |
|
37 |
||
38 |
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
|
|
42 |
||
43 |
||
44 |
class VirtualSignatureTexts(VirtualVersionedFiles): |
|
45 |
"""Virtual signatures backend.""" |
|
46 |
def __init__(self, repository): |
|
47 |
self.repository = repository |
|
48 |
super(VirtualSignatureTexts, self).__init__(self.repository._make_parents_provider().get_parent_map, self.get_lines) |
|
49 |
||
50 |
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
|
|
54 |