diff options
author | Dan Willemsen <dwillemsen@google.com> | 2015-09-08 13:27:20 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2015-09-09 20:50:40 -0700 |
commit | 5ea32d135963da5542b78895f95332c6a17bbe11 (patch) | |
tree | 832e03decd9f0d7b412b111e00bd28b89c1c9ea6 /subcmds/start.py | |
parent | 5cc384034d144c339d2e5822c36c5ca4529ac487 (diff) | |
download | git-repo-5ea32d135963da5542b78895f95332c6a17bbe11.tar.gz |
GITC: Always update the gitc manifest from the repo manifestv1.12.31
This way any changes made to the main manifest are reflected in the gitc
manifest. It's also necessary to use both manifests to sync since the
information required to update the gitc manifest is actually in the repo
manifest.
This also fixes a few issues that came up when testing. notdefault
groups weren't being saved to the gitc manifest in a method that matched
'sync'. The merge branch wasn't always being set to the correct value
either.
Change-Id: I435235cb5622a048ffad0059affd32ecf71f1f5b
Diffstat (limited to 'subcmds/start.py')
-rw-r--r-- | subcmds/start.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/subcmds/start.py b/subcmds/start.py index 188fd7c6..940c3413 100644 --- a/subcmds/start.py +++ b/subcmds/start.py | |||
@@ -57,7 +57,6 @@ revision specified in the manifest. | |||
57 | print("error: at least one project must be specified", file=sys.stderr) | 57 | print("error: at least one project must be specified", file=sys.stderr) |
58 | sys.exit(1) | 58 | sys.exit(1) |
59 | 59 | ||
60 | proj_name_to_gitc_proj_dict = {} | ||
61 | if self.gitc_manifest: | 60 | if self.gitc_manifest: |
62 | all_projects = self.GetProjects(projects, manifest=self.gitc_manifest, | 61 | all_projects = self.GetProjects(projects, manifest=self.gitc_manifest, |
63 | missing_ok=True) | 62 | missing_ok=True) |
@@ -67,7 +66,6 @@ revision specified in the manifest. | |||
67 | else: | 66 | else: |
68 | project.already_synced = False | 67 | project.already_synced = False |
69 | project.old_revision = project.revisionExpr | 68 | project.old_revision = project.revisionExpr |
70 | proj_name_to_gitc_proj_dict[project.name] = project | ||
71 | project.revisionExpr = None | 69 | project.revisionExpr = None |
72 | # Save the GITC manifest. | 70 | # Save the GITC manifest. |
73 | gitc_utils.save_manifest(self.gitc_manifest) | 71 | gitc_utils.save_manifest(self.gitc_manifest) |
@@ -77,9 +75,10 @@ revision specified in the manifest. | |||
77 | pm = Progress('Starting %s' % nb, len(all_projects)) | 75 | pm = Progress('Starting %s' % nb, len(all_projects)) |
78 | for project in all_projects: | 76 | for project in all_projects: |
79 | pm.update() | 77 | pm.update() |
78 | |||
80 | if self.gitc_manifest: | 79 | if self.gitc_manifest: |
81 | gitc_project = proj_name_to_gitc_proj_dict[project.name] | 80 | gitc_project = self.gitc_manifest.paths[project.relpath] |
82 | # Sync projects that have already been opened. | 81 | # Sync projects that have not been opened. |
83 | if not gitc_project.already_synced: | 82 | if not gitc_project.already_synced: |
84 | proj_localdir = os.path.join(self.gitc_manifest.gitc_client_dir, | 83 | proj_localdir = os.path.join(self.gitc_manifest.gitc_client_dir, |
85 | project.relpath) | 84 | project.relpath) |
@@ -89,7 +88,7 @@ revision specified in the manifest. | |||
89 | project.Sync_NetworkHalf() | 88 | project.Sync_NetworkHalf() |
90 | sync_buf = SyncBuffer(self.manifest.manifestProject.config) | 89 | sync_buf = SyncBuffer(self.manifest.manifestProject.config) |
91 | project.Sync_LocalHalf(sync_buf) | 90 | project.Sync_LocalHalf(sync_buf) |
92 | project.revisionExpr = gitc_project.old_revision | 91 | project.revisionId = gitc_project.old_revision |
93 | 92 | ||
94 | # If the current revision is a specific SHA1 then we can't push back | 93 | # If the current revision is a specific SHA1 then we can't push back |
95 | # to it; so substitute with dest_branch if defined, or with manifest | 94 | # to it; so substitute with dest_branch if defined, or with manifest |
@@ -100,6 +99,7 @@ revision specified in the manifest. | |||
100 | branch_merge = project.dest_branch | 99 | branch_merge = project.dest_branch |
101 | else: | 100 | else: |
102 | branch_merge = self.manifest.default.revisionExpr | 101 | branch_merge = self.manifest.default.revisionExpr |
102 | |||
103 | if not project.StartBranch(nb, branch_merge=branch_merge): | 103 | if not project.StartBranch(nb, branch_merge=branch_merge): |
104 | err.append(project) | 104 | err.append(project) |
105 | pm.end() | 105 | pm.end() |