~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/revision/text.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-13 13:11:06 UTC
  • mto: This revision was merged to the branch mainline in revision 1869.
  • Revision ID: john@arbash-meinel.com-20060713131106-4f059a8003d852bd
Move offset_to_http_ranges back onto HttpTransportBase, clarify tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006 by Canonical Ltd
2
2
#
3
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 2 of the License, or
6
 
# (at your option) any later version.
 
4
# it under the terms of the GNU General Public License version 2 as published by
 
5
# the Free Software Foundation.
7
6
#
8
7
# This program is distributed in the hope that it will be useful,
9
8
# but WITHOUT ANY WARRANTY; without even the implied warranty of
24
23
from cStringIO import StringIO
25
24
 
26
25
 
27
 
from bzrlib import (
28
 
    cache_utf8,
29
 
    errors,
30
 
    osutils,
31
 
    revision as _mod_revision,
32
 
    )
 
26
import bzrlib
 
27
import bzrlib.errors as errors
33
28
from bzrlib.store.revision import RevisionStore
34
29
from bzrlib.store.text import TextStore
35
30
from bzrlib.store.versioned import VersionedFileStore
81
76
        assert self.text_store.listable()
82
77
        result_graph = {}
83
78
        for rev_id in self.text_store:
84
 
            rev_id = osutils.safe_revision_id(rev_id)
85
79
            rev = self.get_revision(rev_id, transaction)
86
80
            result_graph[rev_id] = rev.parent_ids
87
81
        # remove ghosts
105
99
            xml_file.close()
106
100
            assert r.revision_id == revision_id
107
101
            revisions.append(r)
108
 
        return revisions
 
102
        return revisions 
109
103
 
110
104
    def _get_revision_xml_file(self, revision_id):
111
105
        try:
112
106
            return self.text_store.get(revision_id)
113
107
        except (IndexError, KeyError):
114
 
            raise errors.NoSuchRevision(self, revision_id)
 
108
            raise bzrlib.errors.NoSuchRevision(self, revision_id)
115
109
 
116
110
    def _get_signature_text(self, revision_id, transaction):
117
111
        """See RevisionStore._get_signature_text()."""
122
116
 
123
117
    def has_revision_id(self, revision_id, transaction):
124
118
        """True if the store contains revision_id."""
125
 
        return (_mod_revision.is_null(revision_id)
 
119
        return (revision_id is None
126
120
                or self.text_store.has_id(revision_id))
127
 
 
 
121
 
128
122
    def _has_signature(self, revision_id, transaction):
129
123
        """See RevisionStore._has_signature()."""
130
124
        return self.text_store.has_id(revision_id, suffix='sig')