summaryrefslogtreecommitdiffstats
path: root/subcmds/start.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/start.py')
-rw-r--r--subcmds/start.py44
1 files changed, 1 insertions, 43 deletions
diff --git a/subcmds/start.py b/subcmds/start.py
index 67ac7df9..481d9ef2 100644
--- a/subcmds/start.py
+++ b/subcmds/start.py
@@ -13,15 +13,13 @@
13# limitations under the License. 13# limitations under the License.
14 14
15import functools 15import functools
16import os
17import sys 16import sys
18 17
19from command import Command, DEFAULT_LOCAL_JOBS 18from command import Command, DEFAULT_LOCAL_JOBS
20from git_config import IsImmutable 19from git_config import IsImmutable
21from git_command import git 20from git_command import git
22import gitc_utils
23from progress import Progress 21from progress import Progress
24from project import SyncBuffer, Project 22from project import Project
25from typing import NamedTuple 23from typing import NamedTuple
26from error import RepoExitError 24from error import RepoExitError
27 25
@@ -115,49 +113,9 @@ revision specified in the manifest.
115 113
116 all_projects = self.GetProjects( 114 all_projects = self.GetProjects(
117 projects, 115 projects,
118 missing_ok=bool(self.gitc_manifest),
119 all_manifests=not opt.this_manifest_only, 116 all_manifests=not opt.this_manifest_only,
120 ) 117 )
121 118
122 # This must happen after we find all_projects, since GetProjects may
123 # need the local directory, which will disappear once we save the GITC
124 # manifest.
125 if self.gitc_manifest:
126 gitc_projects = self.GetProjects(
127 projects, manifest=self.gitc_manifest, missing_ok=True
128 )
129 for project in gitc_projects:
130 if project.old_revision:
131 project.already_synced = True
132 else:
133 project.already_synced = False
134 project.old_revision = project.revisionExpr
135 project.revisionExpr = None
136 # Save the GITC manifest.
137 gitc_utils.save_manifest(self.gitc_manifest)
138
139 # Make sure we have a valid CWD.
140 if not os.path.exists(os.getcwd()):
141 os.chdir(self.manifest.topdir)
142
143 pm = Progress("Syncing %s" % nb, len(all_projects), quiet=opt.quiet)
144 for project in all_projects:
145 gitc_project = self.gitc_manifest.paths[project.relpath]
146 # Sync projects that have not been opened.
147 if not gitc_project.already_synced:
148 proj_localdir = os.path.join(
149 self.gitc_manifest.gitc_client_dir, project.relpath
150 )
151 project.worktree = proj_localdir
152 if not os.path.exists(proj_localdir):
153 os.makedirs(proj_localdir)
154 project.Sync_NetworkHalf()
155 sync_buf = SyncBuffer(self.manifest.manifestProject.config)
156 project.Sync_LocalHalf(sync_buf)
157 project.revisionId = gitc_project.old_revision
158 pm.update(msg="")
159 pm.end()
160
161 def _ProcessResults(_pool, pm, results): 119 def _ProcessResults(_pool, pm, results):
162 for result in results: 120 for result in results:
163 if result.error: 121 if result.error: