From e9dc3b33680571731181f30fbd38317d19c24652 Mon Sep 17 00:00:00 2001 From: Chris Wolfe Date: Thu, 26 Jan 2012 11:36:18 -0500 Subject: [PATCH] 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 --- subcmds/sync.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/subcmds/sync.py b/subcmds/sync.py index c5955a38..6dcce82e 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -140,6 +140,9 @@ later is required to fix a server side protocol bug. p.add_option('-j','--jobs', dest='jobs', action='store', type='int', 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: p.add_option('-s', '--smart-sync', dest='smart_sync', action='store_true', @@ -333,6 +336,15 @@ uncommitted changes are present' % project.relpath if opt.network_only and opt.local_only: print >>sys.stderr, 'error: cannot combine -n and -l' 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 not self.manifest.manifest_server: