~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/__init__.py

  • Committer: Robert Collins
  • Date: 2007-07-04 08:08:13 UTC
  • mfrom: (2572 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2587.
  • Revision ID: robertc@robertcollins.net-20070704080813-wzebx0r88fvwj5rq
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 by Canonical Development Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
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
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: