sync: Add manifest_name parameter

This parameter changes the manifest used by 'repo sync' for only
this execution. It should be useful for developers wishing to get
the repo temporarily into a known state, without clobbering their
existing manifest.

Tested by shifting Chrome OS between minilayout and full, and
between several release-builder-generated manifests.

Change-Id: I14194b665195b0e78f368d9ec8b8a83227af2627
This commit is contained in:
Chris Wolfe 2012-01-26 11:36:18 -05:00
parent c9571423f8
commit e9dc3b3368

View File

@ -140,6 +140,9 @@ later is required to fix a server side protocol bug.
p.add_option('-j','--jobs', p.add_option('-j','--jobs',
dest='jobs', action='store', type='int', dest='jobs', action='store', type='int',
help="projects to fetch simultaneously (default %d)" % self.jobs) help="projects to fetch simultaneously (default %d)" % self.jobs)
p.add_option('-m', '--manifest-name',
dest='manifest_name',
help='temporary manifest to use for this sync', metavar='NAME.xml')
if show_smart: if show_smart:
p.add_option('-s', '--smart-sync', p.add_option('-s', '--smart-sync',
dest='smart_sync', action='store_true', dest='smart_sync', action='store_true',
@ -333,6 +336,15 @@ uncommitted changes are present' % project.relpath
if opt.network_only and opt.local_only: if opt.network_only and opt.local_only:
print >>sys.stderr, 'error: cannot combine -n and -l' print >>sys.stderr, 'error: cannot combine -n and -l'
sys.exit(1) sys.exit(1)
if opt.manifest_name and opt.smart_sync:
print >>sys.stderr, 'error: cannot combine -m and -s'
sys.exit(1)
if opt.manifest_name and opt.smart_tag:
print >>sys.stderr, 'error: cannot combine -m and -t'
sys.exit(1)
if opt.manifest_name:
self.manifest.Override(opt.manifest_name)
if opt.smart_sync or opt.smart_tag: if opt.smart_sync or opt.smart_tag:
if not self.manifest.manifest_server: if not self.manifest.manifest_server: