Allow sync to run even when the manifest is broken. If the current manifest is broken then "repo sync" fails because it can't retrieve the default value for --jobs. Use 1 in this case, in order that you can "repo sync" to get a fixed manifest (assuming someone fixed it upstream). Change-Id: I4262abb59311f1e851ca2a663438a7e9f796b9f6
diff --git a/subcmds/sync.py b/subcmds/sync.py index f809473..228a279 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py
@@ -51,7 +51,7 @@ from project import Project from project import RemoteSpec from command import Command, MirrorSafeCommand -from error import RepoChangedException, GitError +from error import RepoChangedException, GitError, ManifestParseError from project import SyncBuffer from progress import Progress @@ -148,7 +148,10 @@ """ def _Options(self, p, show_smart=True): - self.jobs = self.manifest.default.sync_j + try: + self.jobs = self.manifest.default.sync_j + except ManifestParseError: + self.jobs = 1 p.add_option('-f', '--force-broken', dest='force_broken', action='store_true',