MCPcopy
hub / github.com/deadc0de6/dotdrop / compare

Method compare

dotdrop/ftree.py:66–79  ·  view source on GitHub ↗

compare two trees and returns - left_only (only in self) - right_only (only in other) - in_both (in both) the relative path are returned

(self, other)

Source from the content-addressed store, hash-verified

64 return self.entries
65
66 def compare(self, other):
67 """
68 compare two trees and returns
69 - left_only (only in self)
70 - right_only (only in other)
71 - in_both (in both)
72 the relative path are returned
73 """
74 left = [os.path.relpath(entry, self.path) for entry in self.entries]
75 right = [os.path.relpath(entry, other.path) for entry in other.entries]
76 left_only = set(left) - set(right)
77 right_only = set(right) - set(left)
78 in_both = set(left) & set(right)
79 return list(left_only), list(right_only), list(in_both)

Callers 2

_compare_dirs2Method · 0.95
_handle_dirMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected