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)
| 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) |
no outgoing calls
no test coverage detected