diff options
Diffstat (limited to 'subcmds/init.py')
| -rw-r--r-- | subcmds/init.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index b6b98076..48df9e89 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
| @@ -147,7 +147,7 @@ to update the working directory files. | |||
| 147 | r.ResetFetch() | 147 | r.ResetFetch() |
| 148 | r.Save() | 148 | r.Save() |
| 149 | 149 | ||
| 150 | groups = re.split('[,\s]+', opt.groups) | 150 | groups = re.split(r'[,\s]+', opt.groups) |
| 151 | all_platforms = ['linux', 'darwin'] | 151 | all_platforms = ['linux', 'darwin'] |
| 152 | platformize = lambda x: 'platform-' + x | 152 | platformize = lambda x: 'platform-' + x |
| 153 | if opt.platform == 'auto': | 153 | if opt.platform == 'auto': |
| @@ -313,6 +313,21 @@ to update the working directory files. | |||
| 313 | # We store the depth in the main manifest project. | 313 | # We store the depth in the main manifest project. |
| 314 | self.manifest.manifestProject.config.SetString('repo.depth', depth) | 314 | self.manifest.manifestProject.config.SetString('repo.depth', depth) |
| 315 | 315 | ||
| 316 | def _DisplayResult(self): | ||
| 317 | if self.manifest.IsMirror: | ||
| 318 | init_type = 'mirror ' | ||
| 319 | else: | ||
| 320 | init_type = '' | ||
| 321 | |||
| 322 | print '' | ||
| 323 | print 'repo %shas been initialized in %s' % (init_type, self.manifest.topdir) | ||
| 324 | |||
| 325 | current_dir = os.getcwd() | ||
| 326 | if current_dir != self.manifest.topdir: | ||
| 327 | print 'If this is not the directory in which you want to initialize repo, please run:' | ||
| 328 | print ' rm -r %s/.repo' % self.manifest.topdir | ||
| 329 | print 'and try again.' | ||
| 330 | |||
| 316 | def Execute(self, opt, args): | 331 | def Execute(self, opt, args): |
| 317 | git_require(MIN_GIT_VERSION, fail=True) | 332 | git_require(MIN_GIT_VERSION, fail=True) |
| 318 | 333 | ||
| @@ -329,10 +344,4 @@ to update the working directory files. | |||
| 329 | 344 | ||
| 330 | self._ConfigureDepth(opt) | 345 | self._ConfigureDepth(opt) |
| 331 | 346 | ||
| 332 | if self.manifest.IsMirror: | 347 | self._DisplayResult() |
| 333 | init_type = 'mirror ' | ||
| 334 | else: | ||
| 335 | init_type = '' | ||
| 336 | |||
| 337 | print '' | ||
| 338 | print 'repo %sinitialized in %s' % (init_type, self.manifest.topdir) | ||
