Merge "init: Add no-tags and current branch options"

This commit is contained in:
Jonathan Nieder 2016-12-09 02:33:42 +00:00 committed by Gerrit Code Review
commit 7de8c5db78
2 changed files with 16 additions and 2 deletions

8
repo
View File

@ -23,7 +23,7 @@ REPO_REV = 'stable'
# limitations under the License. # limitations under the License.
# increment this whenever we make important changes to this script # increment this whenever we make important changes to this script
VERSION = (1, 23) VERSION = (1, 24)
# increment this if the MAINTAINER_KEYS block is modified # increment this if the MAINTAINER_KEYS block is modified
KEYRING_VERSION = (1, 2) KEYRING_VERSION = (1, 2)
@ -175,6 +175,9 @@ group.add_option('-b', '--manifest-branch',
group.add_option('-m', '--manifest-name', group.add_option('-m', '--manifest-name',
dest='manifest_name', dest='manifest_name',
help='initial manifest file', metavar='NAME.xml') help='initial manifest file', metavar='NAME.xml')
group.add_option('-c', '--current-branch',
dest='current_branch_only', action='store_true',
help='fetch only current manifest branch from server')
group.add_option('--mirror', group.add_option('--mirror',
dest='mirror', action='store_true', dest='mirror', action='store_true',
help='create a replica of the remote repositories ' help='create a replica of the remote repositories '
@ -202,6 +205,9 @@ group.add_option('-p', '--platform',
group.add_option('--no-clone-bundle', group.add_option('--no-clone-bundle',
dest='no_clone_bundle', action='store_true', dest='no_clone_bundle', action='store_true',
help='disable use of /clone.bundle on HTTP/HTTPS') help='disable use of /clone.bundle on HTTP/HTTPS')
group.add_option('--no-tags',
dest='no_tags', action='store_true',
help="don't fetch tags in the manifest")
# Tool # Tool

View File

@ -91,6 +91,9 @@ to update the working directory files.
g.add_option('-b', '--manifest-branch', g.add_option('-b', '--manifest-branch',
dest='manifest_branch', dest='manifest_branch',
help='manifest branch or revision', metavar='REVISION') help='manifest branch or revision', metavar='REVISION')
g.add_option('-c', '--current-branch',
dest='current_branch_only', action='store_true',
help='fetch only current manifest branch from server')
g.add_option('-m', '--manifest-name', g.add_option('-m', '--manifest-name',
dest='manifest_name', default='default.xml', dest='manifest_name', default='default.xml',
help='initial manifest file', metavar='NAME.xml') help='initial manifest file', metavar='NAME.xml')
@ -121,6 +124,9 @@ to update the working directory files.
g.add_option('--no-clone-bundle', g.add_option('--no-clone-bundle',
dest='no_clone_bundle', action='store_true', dest='no_clone_bundle', action='store_true',
help='disable use of /clone.bundle on HTTP/HTTPS') help='disable use of /clone.bundle on HTTP/HTTPS')
g.add_option('--no-tags',
dest='no_tags', action='store_true',
help="don't fetch tags in the manifest")
# Tool # Tool
g = p.add_option_group('repo Version options') g = p.add_option_group('repo Version options')
@ -231,7 +237,9 @@ to update the working directory files.
sys.exit(1) sys.exit(1)
if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet, if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet,
clone_bundle=not opt.no_clone_bundle): clone_bundle=not opt.no_clone_bundle,
current_branch_only=opt.current_branch_only,
no_tags=opt.no_tags):
r = m.GetRemote(m.remote.name) r = m.GetRemote(m.remote.name)
print('fatal: cannot obtain manifest %s' % r.url, file=sys.stderr) print('fatal: cannot obtain manifest %s' % r.url, file=sys.stderr)