Kiln » Dependencies » Dulwich Read More
Clone URL:  
Pushed to one repository · View In Graph Contained in master, master-1, and master-0

Split out ObjectStoreIterator.

Changeset f982f8388555

Parent 28980f1f1cc9

by Jelmer Vernooij

Changes to one file · Browse files at f982f8388555 Showing diff from parent 28980f1f1cc9 Diff from another changeset...

 
40
41
42
43
 
44
45
46
 
190
191
192
 
 
 
 
 
 
193
194
195
196
197
198
 
199
200
201
 
213
214
215
 
 
 
40
41
42
 
43
44
45
46
 
190
191
192
193
194
195
196
197
198
199
200
201
202
203
 
204
205
206
207
 
219
220
221
222
223
@@ -40,7 +40,7 @@
  self._packs = None     def iter_shas(self, shas): - return ObjectIterator(self, shas) + return ObjectStoreIterator(self, shas)     def pack_dir(self):   return os.path.join(self.path, PACKDIR) @@ -190,12 +190,18 @@
   class ObjectIterator(object):   + def iterobjects(self): + raise NotImplementedError(self.iterobjects) + + +class ObjectStoreIterator(ObjectIterator): +   def __init__(self, store, shas):   self.store = store   self.shas = shas     def __iter__(self): - return ((self.store.get_object(sha), path) for sha, path in self.shas) + return ((self.store[sha], path) for sha, path in self.shas)     def iterobjects(self):   for o, path in self: @@ -213,3 +219,5 @@
    def __len__(self):   return len(self.shas) + +