diff options
Diffstat (limited to 'subcmds/init.py')
-rw-r--r-- | subcmds/init.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index 03f358d1..ad28a611 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -57,6 +57,10 @@ default.xml will be used. | |||
57 | g.add_option('-m', '--manifest-name', | 57 | g.add_option('-m', '--manifest-name', |
58 | dest='manifest_name', default='default.xml', | 58 | dest='manifest_name', default='default.xml', |
59 | help='initial manifest file', metavar='NAME.xml') | 59 | help='initial manifest file', metavar='NAME.xml') |
60 | g.add_option('--mirror', | ||
61 | dest='mirror', action='store_true', | ||
62 | help='mirror the forrest') | ||
63 | |||
60 | 64 | ||
61 | # Tool | 65 | # Tool |
62 | g = p.add_option_group('Version options') | 66 | g = p.add_option_group('Version options') |
@@ -112,6 +116,9 @@ default.xml will be used. | |||
112 | r.ResetFetch() | 116 | r.ResetFetch() |
113 | r.Save() | 117 | r.Save() |
114 | 118 | ||
119 | if opt.mirror: | ||
120 | m.config.SetString('repo.mirror', 'true') | ||
121 | |||
115 | m.Sync_NetworkHalf() | 122 | m.Sync_NetworkHalf() |
116 | m.Sync_LocalHalf() | 123 | m.Sync_LocalHalf() |
117 | m.StartBranch('default') | 124 | m.StartBranch('default') |
@@ -185,9 +192,14 @@ default.xml will be used. | |||
185 | self._SyncManifest(opt) | 192 | self._SyncManifest(opt) |
186 | self._LinkManifest(opt.manifest_name) | 193 | self._LinkManifest(opt.manifest_name) |
187 | 194 | ||
188 | if os.isatty(0) and os.isatty(1): | 195 | if os.isatty(0) and os.isatty(1) and not opt.mirror: |
189 | self._ConfigureUser() | 196 | self._ConfigureUser() |
190 | self._ConfigureColor() | 197 | self._ConfigureColor() |
191 | 198 | ||
199 | if opt.mirror: | ||
200 | type = 'mirror ' | ||
201 | else: | ||
202 | type = '' | ||
203 | |||
192 | print '' | 204 | print '' |
193 | print 'repo initialized in %s' % self.manifest.topdir | 205 | print 'repo %sinitialized in %s' % (type, self.manifest.topdir) |