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

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

Changeset db27fdc3e583

Parent 44edc70423a7

committed by Jelmer Vernooij

authored by Dmitriy

Changes to one file · Browse files at db27fdc3e583 Showing diff from parent 44edc70423a7 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)