diff options
| author | Dan Willemsen <dwillemsen@google.com> | 2016-02-04 22:36:05 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-02-04 22:36:05 +0000 |
| commit | ecf0a6c92b62437f2c0a2017a0e98c7f92b162dd (patch) | |
| tree | 592a01e04a1ee28923ce8be0a0ffb337fadb695d /subcmds | |
| parent | 0b4cb325c6f412ac5ab33573b4f5e50b4945c924 (diff) | |
| parent | 04197a5144d6a40ee2d85799b32505250480f365 (diff) | |
| download | git-repo-ecf0a6c92b62437f2c0a2017a0e98c7f92b162dd.tar.gz | |
Merge "GITC: Fix 'repo start <branch> <repo>/<subdir>'"
Diffstat (limited to 'subcmds')
| -rw-r--r-- | subcmds/start.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/subcmds/start.py b/subcmds/start.py index 940c3413..d1430a9d 100644 --- a/subcmds/start.py +++ b/subcmds/start.py | |||
| @@ -57,10 +57,15 @@ 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 | all_projects = self.GetProjects(projects, | ||
| 61 | missing_ok=bool(self.gitc_manifest)) | ||
| 62 | |||
| 63 | # This must happen after we find all_projects, since GetProjects may need | ||
| 64 | # the local directory, which will disappear once we save the GITC manifest. | ||
| 60 | if self.gitc_manifest: | 65 | if self.gitc_manifest: |
| 61 | all_projects = self.GetProjects(projects, manifest=self.gitc_manifest, | 66 | gitc_projects = self.GetProjects(projects, manifest=self.gitc_manifest, |
| 62 | missing_ok=True) | 67 | missing_ok=True) |
| 63 | for project in all_projects: | 68 | for project in gitc_projects: |
| 64 | if project.old_revision: | 69 | if project.old_revision: |
| 65 | project.already_synced = True | 70 | project.already_synced = True |
| 66 | else: | 71 | else: |
| @@ -70,8 +75,10 @@ revision specified in the manifest. | |||
| 70 | # Save the GITC manifest. | 75 | # Save the GITC manifest. |
| 71 | gitc_utils.save_manifest(self.gitc_manifest) | 76 | gitc_utils.save_manifest(self.gitc_manifest) |
| 72 | 77 | ||
| 73 | all_projects = self.GetProjects(projects, | 78 | # Make sure we have a valid CWD |
| 74 | missing_ok=bool(self.gitc_manifest)) | 79 | if not os.path.exists(os.getcwd()): |
| 80 | os.chdir(self.manifest.topdir) | ||
| 81 | |||
| 75 | pm = Progress('Starting %s' % nb, len(all_projects)) | 82 | pm = Progress('Starting %s' % nb, len(all_projects)) |
| 76 | for project in all_projects: | 83 | for project in all_projects: |
| 77 | pm.update() | 84 | pm.update() |
