Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/algos/diff.py
Show First 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | elif status['both_are_dirs']: | ||||
elif not status['from_is_empty_dir'] and not status['to_is_empty_dir']: | elif not status['from_is_empty_dir'] and not status['to_is_empty_dir']: | ||||
it.step_both() | it.step_both() | ||||
def _compare_paths(path1, path2): | def _compare_paths(path1, path2): | ||||
""" | """ | ||||
Compare paths in lexicographic depth-first order. | Compare paths in lexicographic depth-first order. | ||||
For instance, it returns: | For instance, it returns: | ||||
- "a" < "b" | - "a" < "b" | ||||
- "b/c/d" < "b" | - "b/c/d" < "b" | ||||
- "c/foo.txt" < "c.txt" | - "c/foo.txt" < "c.txt" | ||||
""" | """ | ||||
path1_parts = path1.split(b'/') | path1_parts = path1.split(b'/') | ||||
path2_parts = path2.split(b'/') | path2_parts = path2.split(b'/') | ||||
i = 0 | i = 0 | ||||
while True: | while True: | ||||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |