From 7bdbde7af84036d2d900150e67f462e1a50f4b0e Mon Sep 17 00:00:00 2001 From: "Torne (Richard Coles)" Date: Wed, 5 Dec 2012 10:58:06 +0000 Subject: [PATCH] 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 --- subcmds/sync.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subcmds/sync.py b/subcmds/sync.py index f8094738..228a279a 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -51,7 +51,7 @@ from main import WrapperModule 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 @@ later is required to fix a server side protocol bug. """ 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',