mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
reapplying defunkts changes
This commit is contained in:
parent
5679e51481
commit
1afd2ff363
@ -360,14 +360,16 @@ class GitHandler(object):
|
||||
def generate_pack_contents(self, want, have):
|
||||
graph_walker = SimpleFetchGraphWalker(want, self.git.get_parents)
|
||||
next = graph_walker.next()
|
||||
shas = []
|
||||
shas = set()
|
||||
while next:
|
||||
if next in have:
|
||||
graph_walker.ack(next)
|
||||
else:
|
||||
shas.append(next)
|
||||
shas.add(next)
|
||||
next = graph_walker.next()
|
||||
|
||||
|
||||
seen = []
|
||||
|
||||
# so now i have the shas, need to turn them into a list of
|
||||
# tuples (sha, path) for ALL the objects i'm sending
|
||||
# TODO : don't send blobs or trees they already have
|
||||
@ -377,11 +379,15 @@ class GitHandler(object):
|
||||
for (mode, name, sha) in tree.entries():
|
||||
if mode == 57344: # TODO : properly handle submodules
|
||||
continue
|
||||
if sha in seen:
|
||||
continue
|
||||
|
||||
obj = self.git.get_object(sha)
|
||||
seen.append(sha)
|
||||
if isinstance (obj, Blob):
|
||||
changes.append((obj, path + name))
|
||||
elif isinstance(obj, Tree):
|
||||
changes.extend (get_objects (obj, path + name + '/'))
|
||||
changes.extend(get_objects(obj, path + name + '/'))
|
||||
return changes
|
||||
|
||||
objects = []
|
||||
|
Loading…
Reference in New Issue
Block a user