~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-09-04 02:59:56 UTC
  • mfrom: (1172)
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: aaron.bentley@utoronto.ca-20050904025956-776ba4f07de97700
Merged mpool's latest changes (~0.0.7)

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
    def __init__(self, basedir):
69
69
        self._basedir = basedir
70
70
 
71
 
    def _path(self, entry_id):
72
 
        if not isinstance(entry_id, basestring):
73
 
            raise TypeError(type(entry_id))
74
 
        if '\\' in entry_id or '/' in entry_id:
75
 
            raise ValueError("invalid store id %r" % entry_id)
76
 
        return os.path.join(self._basedir, entry_id)
 
71
    def _path(self, id):
 
72
        if '\\' in id or '/' in id:
 
73
            raise ValueError("invalid store id %r" % id)
 
74
        return os.path.join(self._basedir, id)
77
75
 
78
76
    def __repr__(self):
79
77
        return "%s(%r)" % (self.__class__.__name__, self._basedir)
126
124
        pb.update('preparing to copy')
127
125
        to_copy = [id for id in ids if id not in self]
128
126
        if isinstance(other, ImmutableStore):
129
 
            return self.copy_multi_immutable(other, to_copy, pb, 
130
 
                                             permit_failure=permit_failure)
 
127
            return self.copy_multi_immutable(other, to_copy, pb)
131
128
        count = 0
132
129
        failed = set()
133
130
        for id in to_copy:
138
135
            else:
139
136
                try:
140
137
                    entry = other[id]
141
 
                except KeyError:
 
138
                except IndexError:
142
139
                    failed.add(id)
143
140
                    continue
144
141
                self.add(entry, id)
214
211
            if e.errno != errno.ENOENT:
215
212
                raise
216
213
 
217
 
        raise KeyError(fileid)
 
214
        raise IndexError(fileid)
218
215
 
219
216
 
220
217
    def total_size(self):