diff options
author | Kuang-che Wu <kcwu@chromium.org> | 2019-04-06 00:49:47 +0800 |
---|---|---|
committer | Kuang-che Wu <kcwu@chromium.org> | 2019-04-06 00:49:47 +0800 |
commit | 0d9b16d1d8bd696efc1b8c6b7a17c40345346f20 (patch) | |
tree | 6840cad2a7d1e8b9e8d90dcb00b9472214c5a83d /subcmds/sync.py | |
parent | e57f1146de4324dc0f9c6c95fb9897b0e78dfd36 (diff) | |
download | git-repo-0d9b16d1d8bd696efc1b8c6b7a17c40345346f20.tar.gz |
sync: deleted unused repos in reversed order (children before parent)
Bug: chromium:950002
Test: repo sync chromeos using release manifest file
Change-Id: I613df6a1973eb36acd806a703e72f5172554bcc7
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 3 |
1 files changed, 2 insertions, 1 deletions
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. | |||
550 | old_project_paths = fd.read().split('\n') | 550 | old_project_paths = fd.read().split('\n') |
551 | finally: | 551 | finally: |
552 | fd.close() | 552 | fd.close() |
553 | for path in old_project_paths: | 553 | # In reversed order, so subfolders are deleted before parent folder. |
554 | for path in sorted(old_project_paths, reverse=True): | ||
554 | if not path: | 555 | if not path: |
555 | continue | 556 | continue |
556 | if path not in new_project_paths: | 557 | if path not in new_project_paths: |