summaryrefslogtreecommitdiffstats
path: root/subcmds/init.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/init.py')
-rw-r--r--subcmds/init.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/subcmds/init.py b/subcmds/init.py
index b6b98076..e56b9223 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -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)