Pārlūkot izejas kodu

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
Torne (Richard Coles) 13 gadi atpakaļ
vecāks
revīzija
7bdbde7af8
1 mainītis faili ar 5 papildinājumiem un 2 dzēšanām
  1. 5 2
      subcmds/sync.py

+ 5 - 2
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',