summaryrefslogtreecommitdiffstats
path: root/subcmds
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/init.py16
-rw-r--r--subcmds/sync.py5
2 files changed, 17 insertions, 4 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)
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 9af12322..8050e515 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -102,8 +102,9 @@ the manifest.
102 self._Fetch(*missing) 102 self._Fetch(*missing)
103 103
104 for project in all: 104 for project in all:
105 if not project.Sync_LocalHalf(): 105 if project.worktree:
106 sys.exit(1) 106 if not project.Sync_LocalHalf():
107 sys.exit(1)
107 108
108 109
109def _VerifyTag(project): 110def _VerifyTag(project):