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

alternates: remove contains_alternate() and move the code inside __contains__

Changeset 3e7382857fde

Parent 9ca3417d0a96

committed by Jelmer Vernooij

authored by Dmitriy

Changes to one file · Browse files at 3e7382857fde Showing diff from parent 9ca3417d0a96 Diff from another changeset...

 
237
238
239
240
241
 
 
 
 
 
 
 
242
243
 
244
245
246
247
248
249
250
251
252
253
254
255
 
237
238
239
 
 
240
241
242
243
244
245
246
247
 
248
249
250
 
 
 
 
 
 
 
251
252
253
@@ -237,19 +237,17 @@
  return True   return False   - def contains_alternate(self, sha): - """Check if a particular object is present by SHA1 in the alternate storage.""" + def __contains__(self, sha): + """Check if a particular object is present by SHA1 in the main or alternate stores. + + This method makes no distinction between loose and packed objects. + """ + if self.contains_packed(sha) or self.contains_loose(sha): + return True   for alternate in self.alternates: - if alternate.contains_loose(sha) or alternate.contains_packed(sha): + if alternate.contains_packed(sha) or alternate.contains_loose(sha):   return True   return False - - def __contains__(self, sha): - """Check if a particular object is present by SHA1 in the main or alternate stores. - - This method makes no distinction between loose and packed objects. - """ - return self.contains_packed(sha) or self.contains_loose(sha) or self.contains_alternate(sha)     def _load_packs(self):   raise NotImplementedError(self._load_packs)