mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-26 20:17:52 +00:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
d92076d930 | |||
aeb2eee9d3 | |||
45d1c372a7 | |||
19607b2817 | |||
68744dbc01 | |||
ef412624e9 | |||
a06ab7d28b | |||
471a7ed5f7 | |||
619a2b5887 | |||
ab15e42fa4 | |||
75c02fe4cb | |||
afd1b4023f |
@ -528,7 +528,7 @@ def GetUrlCookieFile(url, quiet):
|
|||||||
cookiefile = None
|
cookiefile = None
|
||||||
proxy = None
|
proxy = None
|
||||||
for line in p.stdout:
|
for line in p.stdout:
|
||||||
line = line.strip()
|
line = line.strip().decode('utf-8')
|
||||||
if line.startswith(cookieprefix):
|
if line.startswith(cookieprefix):
|
||||||
cookiefile = os.path.expanduser(line[len(cookieprefix):])
|
cookiefile = os.path.expanduser(line[len(cookieprefix):])
|
||||||
if line.startswith(proxyprefix):
|
if line.startswith(proxyprefix):
|
||||||
@ -540,7 +540,7 @@ def GetUrlCookieFile(url, quiet):
|
|||||||
finally:
|
finally:
|
||||||
p.stdin.close()
|
p.stdin.close()
|
||||||
if p.wait():
|
if p.wait():
|
||||||
err_msg = p.stderr.read()
|
err_msg = p.stderr.read().decode('utf-8')
|
||||||
if ' -print_config' in err_msg:
|
if ' -print_config' in err_msg:
|
||||||
pass # Persistent proxy doesn't support -print_config.
|
pass # Persistent proxy doesn't support -print_config.
|
||||||
elif not quiet:
|
elif not quiet:
|
||||||
|
9
project.py
Executable file → Normal file
9
project.py
Executable file → Normal file
@ -1989,7 +1989,7 @@ class Project(object):
|
|||||||
gitmodules_lines = []
|
gitmodules_lines = []
|
||||||
fd, temp_gitmodules_path = tempfile.mkstemp()
|
fd, temp_gitmodules_path = tempfile.mkstemp()
|
||||||
try:
|
try:
|
||||||
os.write(fd, p.stdout)
|
os.write(fd, p.stdout.encode('utf-8'))
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
cmd = ['config', '--file', temp_gitmodules_path, '--list']
|
cmd = ['config', '--file', temp_gitmodules_path, '--list']
|
||||||
p = GitCommand(None, cmd, capture_stdout=True, capture_stderr=True,
|
p = GitCommand(None, cmd, capture_stdout=True, capture_stderr=True,
|
||||||
@ -2252,7 +2252,10 @@ class Project(object):
|
|||||||
spec.append('tag')
|
spec.append('tag')
|
||||||
spec.append(tag_name)
|
spec.append(tag_name)
|
||||||
|
|
||||||
branch = self.revisionExpr
|
if self.manifest.IsMirror and not current_branch_only:
|
||||||
|
branch = None
|
||||||
|
else:
|
||||||
|
branch = self.revisionExpr
|
||||||
if (not self.manifest.IsMirror and is_sha1 and depth
|
if (not self.manifest.IsMirror and is_sha1 and depth
|
||||||
and git_require((1, 8, 3))):
|
and git_require((1, 8, 3))):
|
||||||
# Shallow checkout of a specific commit, fetch from that commit and not
|
# Shallow checkout of a specific commit, fetch from that commit and not
|
||||||
@ -2395,7 +2398,7 @@ class Project(object):
|
|||||||
platform_utils.remove(tmpPath)
|
platform_utils.remove(tmpPath)
|
||||||
with GetUrlCookieFile(srcUrl, quiet) as (cookiefile, proxy):
|
with GetUrlCookieFile(srcUrl, quiet) as (cookiefile, proxy):
|
||||||
if cookiefile:
|
if cookiefile:
|
||||||
cmd += ['--cookie', cookiefile, '--cookie-jar', cookiefile]
|
cmd += ['--cookie', cookiefile]
|
||||||
if proxy:
|
if proxy:
|
||||||
cmd += ['--proxy', proxy]
|
cmd += ['--proxy', proxy]
|
||||||
elif 'http_proxy' in os.environ and 'darwin' == sys.platform:
|
elif 'http_proxy' in os.environ and 'darwin' == sys.platform:
|
||||||
|
10
repo
10
repo
@ -16,7 +16,9 @@ import os
|
|||||||
REPO_URL = os.environ.get('REPO_URL', None)
|
REPO_URL = os.environ.get('REPO_URL', None)
|
||||||
if not REPO_URL:
|
if not REPO_URL:
|
||||||
REPO_URL = 'https://gerrit.googlesource.com/git-repo'
|
REPO_URL = 'https://gerrit.googlesource.com/git-repo'
|
||||||
REPO_REV = 'stable'
|
REPO_REV = os.environ.get('REPO_REV')
|
||||||
|
if not REPO_REV:
|
||||||
|
REPO_REV = 'repo-1'
|
||||||
|
|
||||||
# Copyright (C) 2008 Google Inc.
|
# Copyright (C) 2008 Google Inc.
|
||||||
#
|
#
|
||||||
@ -33,7 +35,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, 26)
|
VERSION = (1, 27)
|
||||||
|
|
||||||
# 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)
|
||||||
@ -235,10 +237,10 @@ group.add_option('--no-tags',
|
|||||||
group = init_optparse.add_option_group('repo Version options')
|
group = init_optparse.add_option_group('repo Version options')
|
||||||
group.add_option('--repo-url',
|
group.add_option('--repo-url',
|
||||||
dest='repo_url',
|
dest='repo_url',
|
||||||
help='repo repository location', metavar='URL')
|
help='repo repository location ($REPO_URL)', metavar='URL')
|
||||||
group.add_option('--repo-branch',
|
group.add_option('--repo-branch',
|
||||||
dest='repo_branch',
|
dest='repo_branch',
|
||||||
help='repo branch or revision', metavar='REVISION')
|
help='repo branch or revision ($REPO_REV)', metavar='REVISION')
|
||||||
group.add_option('--no-repo-verify',
|
group.add_option('--no-repo-verify',
|
||||||
dest='no_repo_verify', action='store_true',
|
dest='no_repo_verify', action='store_true',
|
||||||
help='do not verify repo source code')
|
help='do not verify repo source code')
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/env python
|
||||||
# -*- coding:utf-8 -*-
|
# -*- coding:utf-8 -*-
|
||||||
# Copyright 2019 The Android Open Source Project
|
# Copyright 2019 The Android Open Source Project
|
||||||
#
|
#
|
||||||
|
2
setup.py
2
setup.py
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/env python
|
||||||
# -*- coding:utf-8 -*-
|
# -*- coding:utf-8 -*-
|
||||||
# Copyright 2019 The Android Open Source Project
|
# Copyright 2019 The Android Open Source Project
|
||||||
#
|
#
|
||||||
|
0
subcmds/download.py
Executable file → Normal file
0
subcmds/download.py
Executable file → Normal file
@ -366,7 +366,7 @@ def DoWork(project, mirror, opt, cmd, shell, cnt, config):
|
|||||||
while not s_in.is_done:
|
while not s_in.is_done:
|
||||||
in_ready = s_in.select()
|
in_ready = s_in.select()
|
||||||
for s in in_ready:
|
for s in in_ready:
|
||||||
buf = s.read()
|
buf = s.read().decode()
|
||||||
if not buf:
|
if not buf:
|
||||||
s.close()
|
s.close()
|
||||||
s_in.remove(s)
|
s_in.remove(s)
|
||||||
|
@ -50,7 +50,7 @@ use for this GITC client.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def _Options(self, p):
|
def _Options(self, p):
|
||||||
super(GitcInit, self)._Options(p)
|
super(GitcInit, self)._Options(p, gitc_init=True)
|
||||||
g = p.add_option_group('GITC options')
|
g = p.add_option_group('GITC options')
|
||||||
g.add_option('-f', '--manifest-file',
|
g.add_option('-f', '--manifest-file',
|
||||||
dest='manifest_file',
|
dest='manifest_file',
|
||||||
|
@ -81,7 +81,7 @@ manifest, a subsequent `repo sync` (or `repo sync -d`) is necessary
|
|||||||
to update the working directory files.
|
to update the working directory files.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def _Options(self, p):
|
def _Options(self, p, gitc_init=False):
|
||||||
# Logging
|
# Logging
|
||||||
g = p.add_option_group('Logging options')
|
g = p.add_option_group('Logging options')
|
||||||
g.add_option('-q', '--quiet',
|
g.add_option('-q', '--quiet',
|
||||||
@ -96,7 +96,12 @@ 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',
|
cbr_opts = ['--current-branch']
|
||||||
|
# The gitc-init subcommand allocates -c itself, but a lot of init users
|
||||||
|
# want -c, so try to satisfy both as best we can.
|
||||||
|
if not gitc_init:
|
||||||
|
cbr_opts += ['-c']
|
||||||
|
g.add_option(*cbr_opts,
|
||||||
dest='current_branch_only', action='store_true',
|
dest='current_branch_only', action='store_true',
|
||||||
help='fetch only current manifest branch from server')
|
help='fetch only current manifest branch from server')
|
||||||
g.add_option('-m', '--manifest-name',
|
g.add_option('-m', '--manifest-name',
|
||||||
|
Reference in New Issue
Block a user