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

Implement ObjectStore.find_common_revisions().

Changeset dcaba02adcea

Parent bb188d92ce39

by Jelmer Vernooij

Changes to 2 files · Browse files at dcaba02adcea Showing diff from parent bb188d92ce39 Diff from another changeset...

 
109
110
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
113
114
 
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
@@ -109,6 +109,21 @@
  """   return iter(MissingObjectFinder(self, haves, wants, progress).next, None)   + def find_common_revisions(self, graphwalker): + """Find which revisions this store has in common using graphwalker. + + :param graphwalker: A graphwalker object. + :return: List of SHAs that are in common + """ + haves = [] + sha = graphwalker.next() + while sha: + if sha in self: + haves.append(sha) + graphwalker.ack(sha) + sha = graphwalker.next() + return haves +   def get_graph_walker(self, heads):   """Obtain a graph walker for this object store.  
Change 1 of 1 Show Entire File dulwich/​repo.py Stacked
 
228
229
230
231
 
232
233
234
 
228
229
230
 
231
232
233
234
@@ -228,7 +228,7 @@
  :return: tuple with number of objects, iterator over objects   """   wants = determine_wants(self.get_refs()) - haves = self.object_store.find_missing_revisions(graphwalker) + haves = self.object_store.find_common_revisions(graphwalker)   return self.object_store.iter_shas(   self.object_store.find_missing_objects(haves, wants, progress))