def walk_trees(store, tree1_id, tree2_id, prune_identical=False):
 mode1 = ((tree1_id and stat.S_IFDIR) or None)
 mode2 = ((tree2_id and stat.S_IFDIR) or None)
 todo = [(TreeEntry('', mode1, tree1_id), TreeEntry('', mode2, tree2_id))]
 while todo:
  (entry1, entry2) = todo.pop()
  is_tree1 = _is_tree(entry1)
  is_tree2 = _is_tree(entry2)
  if (prune_identical and is_tree1 and is_tree2 and (entry1 == entry2)):
   continue
  tree1 = ((is_tree1 and store[entry1.sha]) or None)
  tree2 = ((is_tree2 and store[entry2.sha]) or None)
  path = (entry1.path or entry2.path)
  todo.extend(reversed(_merge_entries(path, tree1, tree2)))
  (yield (entry1, entry2))

def walk_trees ( store , tree1_id , tree2_id , prune_identical = False ) : mode1 = ( ( tree1_id and stat . S_IFDIR ) or None ) mode2 = ( ( tree2_id and stat . S_IFDIR ) or None ) todo = [ ( TreeEntry ( '' , mode1 , tree1_id ) , TreeEntry ( '' , mode2 , tree2_id ) ) ] while todo : ( entry1 , entry2 ) = todo . pop ( ) is_tree1 = _is_tree ( entry1 ) is_tree2 = _is_tree ( entry2 ) if ( prune_identical and is_tree1 and is_tree2 and ( entry1 == entry2 ) ) : continue tree1 = ( ( is_tree1 and store [ entry1 . sha ] ) or None ) tree2 = ( ( is_tree2 and store [ entry2 . sha ] ) or None ) path = ( entry1 . path or entry2 . path ) todo . extend ( reversed ( _merge_entries ( path , tree1 , tree2 ) ) ) ( yield ( entry1 , entry2 ) )
recursively walk all the entries of two trees .