~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-18 00:22:24 UTC
  • mto: This revision was merged to the branch mainline in revision 2298.
  • Revision ID: john@arbash-meinel.com-20070218002224-nfsw9ubivr178ahn
Switch all apis over to utf8 file ids. All tests pass

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
import bzrlib
33
33
from bzrlib import (
34
34
    errors,
 
35
    osutils,
35
36
    symbol_versioning,
36
37
    urlutils,
37
38
    )
128
129
            pb.update('preparing to copy')
129
130
        failed = set()
130
131
        count = 0
131
 
        ids = list(ids) # get the list for showing a length.
 
132
        ids = [osutils.safe_file_id(i) for i in ids] # get the list for showing a length.
132
133
        for fileid in ids:
133
134
            count += 1
134
135
            if self.has_id(fileid):
173
174
 
174
175
        f -- A file-like object
175
176
        """
 
177
        fileid = osutils.safe_file_id(fileid)
176
178
        mutter("add store entry %r", fileid)
177
179
        if isinstance(f, str):
178
180
            symbol_versioning.warn(zero_eleven % 'Passing a string to Store.add',
217
219
 
218
220
    def has_id(self, fileid, suffix=None):
219
221
        """See Store.has_id."""
 
222
        fileid = osutils.safe_file_id(fileid)
220
223
        return self._transport.has_any(self._id_to_names(fileid, suffix))
221
224
 
222
225
    def _get_name(self, fileid, suffix=None):
240
243
 
241
244
    def get(self, fileid, suffix=None):
242
245
        """See Store.get()."""
 
246
        fileid = osutils.safe_file_id(fileid)
243
247
        names = self._id_to_names(fileid, suffix)
244
248
        for name in names:
245
249
            try: