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

Fix iterator over objects in server.

Changeset 8ee2fc9ffaf6

Parent 655734ad359d

by Jelmer Vernooij

Changes to 3 files · Browse files at 8ee2fc9ffaf6 Showing diff from parent 655734ad359d Diff from another changeset...

 
61
62
63
 
64
65
66
 
61
62
63
64
65
66
67
@@ -61,6 +61,7 @@
  """Iterate over the objects for the specified shas.     :param shas: Iterable object with SHAs + :return: Object iterator   """   return ObjectStoreIterator(self, shas)  
Change 1 of 1 Show Entire File dulwich/​repo.py Stacked
 
225
226
227
228
 
229
230
231
 
225
226
227
 
228
229
230
231
@@ -225,7 +225,7 @@
  that a revision is present.   :param progress: Simple progress function that will be called with   updated progress strings. - :return: tuple with number of objects, iterator over objects + :return: iterator over objects, with __len__ implemented   """   wants = determine_wants(self.get_refs())   haves = self.object_store.find_common_revisions(graph_walker)
Change 1 of 1 Show Entire File dulwich/​server.py Stacked
 
161
162
163
164
 
165
166
167
 
168
169
170
171
172
 
 
 
173
174
175
 
161
162
163
 
164
165
166
 
167
168
169
170
 
 
171
172
173
174
175
176
@@ -161,15 +161,16 @@
  self.proto.write_pkt_line("NAK\n")     graph_walker = ProtocolGraphWalker(self.proto) - num_objects, objects_iter = self.backend.fetch_objects(determine_wants, graph_walker, progress) + objects_iter = self.backend.fetch_objects(determine_wants, graph_walker, progress)     # Do they want any objects? - if num_objects == 0: + if len(objects_iter) == 0:   return     progress("dul-daemon says what\n") - progress("counting objects: %d, done.\n" % num_objects) - write_pack_data(ProtocolFile(None, write), objects_iter, num_objects) + progress("counting objects: %d, done.\n" % len(objects_iter)) + write_pack_data(ProtocolFile(None, write), objects_iter, + len(objects_iter))   progress("how was that, then?\n")   # we are done   self.proto.write("0000")