diff options
| author | Chris Wolfe <cwolfe@chromium.org> | 2012-01-26 11:36:18 -0500 |
|---|---|---|
| committer | Chris Wolfe <cwolfe@chromium.org> | 2012-01-26 12:32:36 -0500 |
| commit | e9dc3b33680571731181f30fbd38317d19c24652 (patch) | |
| tree | 3f714ed282c94d2d055a2b5c050f4cf840f933bc | |
| parent | c9571423f843340de19ef576ccaa418ac72fdb58 (diff) | |
| download | git-repo-e9dc3b33680571731181f30fbd38317d19c24652.tar.gz | |
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
| -rw-r--r-- | subcmds/sync.py | 12 |
1 files changed, 12 insertions, 0 deletions
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. | |||
| 140 | p.add_option('-j','--jobs', | 140 | p.add_option('-j','--jobs', |
| 141 | dest='jobs', action='store', type='int', | 141 | dest='jobs', action='store', type='int', |
| 142 | help="projects to fetch simultaneously (default %d)" % self.jobs) | 142 | help="projects to fetch simultaneously (default %d)" % self.jobs) |
| 143 | p.add_option('-m', '--manifest-name', | ||
| 144 | dest='manifest_name', | ||
| 145 | help='temporary manifest to use for this sync', metavar='NAME.xml') | ||
| 143 | if show_smart: | 146 | if show_smart: |
| 144 | p.add_option('-s', '--smart-sync', | 147 | p.add_option('-s', '--smart-sync', |
| 145 | dest='smart_sync', action='store_true', | 148 | dest='smart_sync', action='store_true', |
| @@ -333,6 +336,15 @@ uncommitted changes are present' % project.relpath | |||
| 333 | if opt.network_only and opt.local_only: | 336 | if opt.network_only and opt.local_only: |
| 334 | print >>sys.stderr, 'error: cannot combine -n and -l' | 337 | print >>sys.stderr, 'error: cannot combine -n and -l' |
| 335 | sys.exit(1) | 338 | sys.exit(1) |
| 339 | if opt.manifest_name and opt.smart_sync: | ||
| 340 | print >>sys.stderr, 'error: cannot combine -m and -s' | ||
| 341 | sys.exit(1) | ||
| 342 | if opt.manifest_name and opt.smart_tag: | ||
| 343 | print >>sys.stderr, 'error: cannot combine -m and -t' | ||
| 344 | sys.exit(1) | ||
| 345 | |||
| 346 | if opt.manifest_name: | ||
| 347 | self.manifest.Override(opt.manifest_name) | ||
| 336 | 348 | ||
| 337 | if opt.smart_sync or opt.smart_tag: | 349 | if opt.smart_sync or opt.smart_tag: |
| 338 | if not self.manifest.manifest_server: | 350 | if not self.manifest.manifest_server: |
