mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Don't permit "repo init --mirror" in an existing client
Simply setting repo.mirror true doesn't make a client into a mirror. The on-disk layout is completely wrong for a mirror repository, and until we fix our layout for a non-mirror client to more closely resemble the upstream we can't do anything to easily turn on or turn off the mirror status flag. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
0ed2bd1d95
commit
5470df6219
@ -89,8 +89,9 @@ default.xml will be used.
|
||||
|
||||
def _SyncManifest(self, opt):
|
||||
m = self.manifest.manifestProject
|
||||
is_new = not m.Exists
|
||||
|
||||
if not m.Exists:
|
||||
if is_new:
|
||||
if not opt.manifest_url:
|
||||
print >>sys.stderr, 'fatal: manifest url (-u) is required.'
|
||||
sys.exit(1)
|
||||
@ -117,7 +118,11 @@ default.xml will be used.
|
||||
r.Save()
|
||||
|
||||
if opt.mirror:
|
||||
if is_new:
|
||||
m.config.SetString('repo.mirror', 'true')
|
||||
else:
|
||||
print >>sys.stderr, 'fatal: --mirror not supported on existing client'
|
||||
sys.exit(1)
|
||||
|
||||
m.Sync_NetworkHalf()
|
||||
m.Sync_LocalHalf()
|
||||
|
Loading…
Reference in New Issue
Block a user