From 0d9b16d1d8bd696efc1b8c6b7a17c40345346f20 Mon Sep 17 00:00:00 2001 From: Kuang-che Wu Date: Sat, 6 Apr 2019 00:49:47 +0800 Subject: [PATCH] sync: deleted unused repos in reversed order (children before parent) Bug: chromium:950002 Test: repo sync chromeos using release manifest file Change-Id: I613df6a1973eb36acd806a703e72f5172554bcc7 --- subcmds/sync.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subcmds/sync.py b/subcmds/sync.py index fafc1e5c..ec7337aa 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -550,7 +550,8 @@ later is required to fix a server side protocol bug. old_project_paths = fd.read().split('\n') finally: fd.close() - for path in old_project_paths: + # In reversed order, so subfolders are deleted before parent folder. + for path in sorted(old_project_paths, reverse=True): if not path: continue if path not in new_project_paths: