diff options
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index c0f605a8..5855af55 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -271,6 +271,15 @@ later is required to fix a server side protocol bug. | |||
271 | dest='repo_upgraded', action='store_true', | 271 | dest='repo_upgraded', action='store_true', |
272 | help=SUPPRESS_HELP) | 272 | help=SUPPRESS_HELP) |
273 | 273 | ||
274 | def _GetBranch(self): | ||
275 | """Returns the branch name for getting the approved manifest.""" | ||
276 | p = self.manifest.manifestProject | ||
277 | b = p.GetBranch(p.CurrentBranch) | ||
278 | branch = b.merge | ||
279 | if branch.startswith(R_HEADS): | ||
280 | branch = branch[len(R_HEADS):] | ||
281 | return branch | ||
282 | |||
274 | def _UpdateProjectsRevisionId(self, opt, args): | 283 | def _UpdateProjectsRevisionId(self, opt, args): |
275 | """Update revisionId of every project with the SHA from superproject. | 284 | """Update revisionId of every project with the SHA from superproject. |
276 | 285 | ||
@@ -302,9 +311,11 @@ later is required to fix a server side protocol bug. | |||
302 | all_projects = self.GetProjects(args, | 311 | all_projects = self.GetProjects(args, |
303 | missing_ok=True, | 312 | missing_ok=True, |
304 | submodules_ok=opt.fetch_submodules) | 313 | submodules_ok=opt.fetch_submodules) |
314 | branch = self._GetBranch() | ||
305 | manifest_path = superproject.UpdateProjectsRevisionId(self.manifest, | 315 | manifest_path = superproject.UpdateProjectsRevisionId(self.manifest, |
306 | all_projects, | 316 | all_projects, |
307 | url=superproject_url) | 317 | url=superproject_url, |
318 | branch=branch) | ||
308 | if not manifest_path: | 319 | if not manifest_path: |
309 | print('error: Update of revsionId from superproject has failed', | 320 | print('error: Update of revsionId from superproject has failed', |
310 | file=sys.stderr) | 321 | file=sys.stderr) |
@@ -753,11 +764,7 @@ later is required to fix a server side protocol bug. | |||
753 | try: | 764 | try: |
754 | server = xmlrpc.client.Server(manifest_server, transport=transport) | 765 | server = xmlrpc.client.Server(manifest_server, transport=transport) |
755 | if opt.smart_sync: | 766 | if opt.smart_sync: |
756 | p = self.manifest.manifestProject | 767 | branch = self._GetBranch() |
757 | b = p.GetBranch(p.CurrentBranch) | ||
758 | branch = b.merge | ||
759 | if branch.startswith(R_HEADS): | ||
760 | branch = branch[len(R_HEADS):] | ||
761 | 768 | ||
762 | if 'SYNC_TARGET' in os.environ: | 769 | if 'SYNC_TARGET' in os.environ: |
763 | target = os.environ['SYNC_TARGET'] | 770 | target = os.environ['SYNC_TARGET'] |