mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-07-02 20:17:19 +00:00
Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
fbd5dd3a30 | |||
3d27c71dd9 | |||
488d54d4ee | |||
5a5cfce1b2 | |||
e6d4b84060 | |||
d75ca2eb9d | |||
a010a9f4a0 | |||
8a54a7eac3 | |||
63a5657ecf | |||
07d21e6bde | |||
076d54652e | |||
790f4cea7a | |||
39cb17f7a3 | |||
ad1b7bd2e2 | |||
3c2d807905 | |||
7fa8eedd8f | |||
dede564c3d | |||
ac76fd3e3a | |||
a8c34d1075 | |||
5951e3043f | |||
48ea25c6a7 | |||
355f4398d8 | |||
bddc964d93 |
@ -158,6 +158,8 @@ def git_require(min_version, fail=False, msg=''):
|
||||
|
||||
|
||||
class GitCommand(object):
|
||||
"""Wrapper around a single git invocation."""
|
||||
|
||||
def __init__(self,
|
||||
project,
|
||||
cmdv,
|
||||
@ -279,14 +281,9 @@ class GitCommand(object):
|
||||
ssh_proxy.add_client(p)
|
||||
|
||||
self.process = p
|
||||
if input:
|
||||
if isinstance(input, str):
|
||||
input = input.encode('utf-8')
|
||||
p.stdin.write(input)
|
||||
p.stdin.close()
|
||||
|
||||
try:
|
||||
self.stdout, self.stderr = p.communicate()
|
||||
self.stdout, self.stderr = p.communicate(input=input)
|
||||
finally:
|
||||
if ssh_proxy:
|
||||
ssh_proxy.remove_client(p)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# From Gerrit Code Review 3.1.3
|
||||
# From Gerrit Code Review 3.6.1 c67916dbdc07555c44e32a68f92ffc484b9b34f0
|
||||
#
|
||||
# Part of Gerrit Code Review (https://www.gerritcodereview.com/)
|
||||
#
|
||||
@ -17,6 +17,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -u
|
||||
|
||||
# avoid [[ which is not POSIX sh.
|
||||
if test "$#" != 1 ; then
|
||||
echo "$0 requires an argument."
|
||||
@ -29,15 +31,25 @@ if test ! -f "$1" ; then
|
||||
fi
|
||||
|
||||
# Do not create a change id if requested
|
||||
if test "false" = "`git config --bool --get gerrit.createChangeId`" ; then
|
||||
if test "false" = "$(git config --bool --get gerrit.createChangeId)" ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# $RANDOM will be undefined if not using bash, so don't use set -u
|
||||
random=$( (whoami ; hostname ; date; cat $1 ; echo $RANDOM) | git hash-object --stdin)
|
||||
# Do not create a change id for squash commits.
|
||||
if head -n1 "$1" | grep -q '^squash! '; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if git rev-parse --verify HEAD >/dev/null 2>&1; then
|
||||
refhash="$(git rev-parse HEAD)"
|
||||
else
|
||||
refhash="$(git hash-object -t tree /dev/null)"
|
||||
fi
|
||||
|
||||
random=$({ git var GIT_COMMITTER_IDENT ; echo "$refhash" ; cat "$1"; } | git hash-object --stdin)
|
||||
dest="$1.tmp.${random}"
|
||||
|
||||
trap 'rm -f "${dest}"' EXIT
|
||||
trap 'rm -f "$dest" "$dest-2"' EXIT
|
||||
|
||||
if ! git stripspace --strip-comments < "$1" > "${dest}" ; then
|
||||
echo "cannot strip comments from $1"
|
||||
@ -49,11 +61,40 @@ if test ! -s "${dest}" ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
reviewurl="$(git config --get gerrit.reviewUrl)"
|
||||
if test -n "${reviewurl}" ; then
|
||||
token="Link"
|
||||
value="${reviewurl%/}/id/I$random"
|
||||
pattern=".*/id/I[0-9a-f]\{40\}$"
|
||||
else
|
||||
token="Change-Id"
|
||||
value="I$random"
|
||||
pattern=".*"
|
||||
fi
|
||||
|
||||
if git interpret-trailers --parse < "$1" | grep -q "^$token: $pattern$" ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# There must be a Signed-off-by trailer for the code below to work. Insert a
|
||||
# sentinel at the end to make sure there is one.
|
||||
# Avoid the --in-place option which only appeared in Git 2.8
|
||||
# Avoid the --if-exists option which only appeared in Git 2.15
|
||||
if ! git -c trailer.ifexists=doNothing interpret-trailers \
|
||||
--trailer "Change-Id: I${random}" < "$1" > "${dest}" ; then
|
||||
echo "cannot insert change-id line in $1"
|
||||
if ! git interpret-trailers \
|
||||
--trailer "Signed-off-by: SENTINEL" < "$1" > "$dest-2" ; then
|
||||
echo "cannot insert Signed-off-by sentinel line in $1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure the trailer appears before any Signed-off-by trailers by inserting
|
||||
# it as if it was a Signed-off-by trailer and then use sed to remove the
|
||||
# Signed-off-by prefix and the Signed-off-by sentinel line.
|
||||
# Avoid the --in-place option which only appeared in Git 2.8
|
||||
# Avoid the --where option which only appeared in Git 2.15
|
||||
if ! git -c trailer.where=before interpret-trailers \
|
||||
--trailer "Signed-off-by: $token: $value" < "$dest-2" |
|
||||
sed -re "s/^Signed-off-by: ($token: )/\1/" \
|
||||
-e "/^Signed-off-by: SENTINEL/d" > "$dest" ; then
|
||||
echo "cannot insert $token line in $1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man.
|
||||
.TH REPO "1" "July 2022" "repo gitc-init" "Repo Manual"
|
||||
.TH REPO "1" "August 2022" "repo gitc-init" "Repo Manual"
|
||||
.SH NAME
|
||||
repo \- repo gitc-init - manual page for repo gitc-init
|
||||
.SH SYNOPSIS
|
||||
@ -45,10 +45,15 @@ sync any submodules associated with the manifest repo
|
||||
\fB\-\-standalone\-manifest\fR
|
||||
download the manifest as a static file rather then
|
||||
create a git checkout of the manifest repo
|
||||
.TP
|
||||
\fB\-\-manifest\-depth\fR=\fI\,DEPTH\/\fR
|
||||
create a shallow clone of the manifest repo with given
|
||||
depth; see git clone (default: 1)
|
||||
.SS Manifest (only) checkout options:
|
||||
.TP
|
||||
\fB\-\-current\-branch\fR
|
||||
fetch only current manifest branch from server
|
||||
(default)
|
||||
.TP
|
||||
\fB\-\-no\-current\-branch\fR
|
||||
fetch all manifest branches from server
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man.
|
||||
.TH REPO "1" "July 2022" "repo init" "Repo Manual"
|
||||
.TH REPO "1" "August 2022" "repo init" "Repo Manual"
|
||||
.SH NAME
|
||||
repo \- repo init - manual page for repo init
|
||||
.SH SYNOPSIS
|
||||
@ -45,10 +45,15 @@ sync any submodules associated with the manifest repo
|
||||
\fB\-\-standalone\-manifest\fR
|
||||
download the manifest as a static file rather then
|
||||
create a git checkout of the manifest repo
|
||||
.TP
|
||||
\fB\-\-manifest\-depth\fR=\fI\,DEPTH\/\fR
|
||||
create a shallow clone of the manifest repo with given
|
||||
depth; see git clone (default: 1)
|
||||
.SS Manifest (only) checkout options:
|
||||
.TP
|
||||
\fB\-c\fR, \fB\-\-current\-branch\fR
|
||||
fetch only current manifest branch from server
|
||||
(default)
|
||||
.TP
|
||||
\fB\-\-no\-current\-branch\fR
|
||||
fetch all manifest branches from server
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man.
|
||||
.TH REPO "1" "July 2022" "repo smartsync" "Repo Manual"
|
||||
.TH REPO "1" "August 2022" "repo smartsync" "Repo Manual"
|
||||
.SH NAME
|
||||
repo \- repo smartsync - manual page for repo smartsync
|
||||
.SH SYNOPSIS
|
||||
@ -20,11 +20,11 @@ number of CPU cores)
|
||||
.TP
|
||||
\fB\-\-jobs\-network\fR=\fI\,JOBS\/\fR
|
||||
number of network jobs to run in parallel (defaults to
|
||||
\fB\-\-jobs\fR)
|
||||
\fB\-\-jobs\fR or 1)
|
||||
.TP
|
||||
\fB\-\-jobs\-checkout\fR=\fI\,JOBS\/\fR
|
||||
number of local checkout jobs to run in parallel
|
||||
(defaults to \fB\-\-jobs\fR)
|
||||
(defaults to \fB\-\-jobs\fR or 8)
|
||||
.TP
|
||||
\fB\-f\fR, \fB\-\-force\-broken\fR
|
||||
obsolete option (to be deleted in the future)
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man.
|
||||
.TH REPO "1" "July 2022" "repo sync" "Repo Manual"
|
||||
.TH REPO "1" "August 2022" "repo sync" "Repo Manual"
|
||||
.SH NAME
|
||||
repo \- repo sync - manual page for repo sync
|
||||
.SH SYNOPSIS
|
||||
@ -20,11 +20,11 @@ number of CPU cores)
|
||||
.TP
|
||||
\fB\-\-jobs\-network\fR=\fI\,JOBS\/\fR
|
||||
number of network jobs to run in parallel (defaults to
|
||||
\fB\-\-jobs\fR)
|
||||
\fB\-\-jobs\fR or 1)
|
||||
.TP
|
||||
\fB\-\-jobs\-checkout\fR=\fI\,JOBS\/\fR
|
||||
number of local checkout jobs to run in parallel
|
||||
(defaults to \fB\-\-jobs\fR)
|
||||
(defaults to \fB\-\-jobs\fR or 8)
|
||||
.TP
|
||||
\fB\-f\fR, \fB\-\-force\-broken\fR
|
||||
obsolete option (to be deleted in the future)
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man.
|
||||
.TH REPO "1" "July 2022" "repo upload" "Repo Manual"
|
||||
.TH REPO "1" "August 2022" "repo upload" "Repo Manual"
|
||||
.SH NAME
|
||||
repo \- repo upload - manual page for repo upload
|
||||
.SH SYNOPSIS
|
||||
@ -54,6 +54,9 @@ upload as a private change (deprecated; use \fB\-\-wip\fR)
|
||||
\fB\-w\fR, \fB\-\-wip\fR
|
||||
upload as a work\-in\-progress change
|
||||
.TP
|
||||
\fB\-r\fR, \fB\-\-ready\fR
|
||||
mark change as ready (clears work\-in\-progress setting)
|
||||
.TP
|
||||
\fB\-o\fR PUSH_OPTIONS, \fB\-\-push\-option\fR=\fI\,PUSH_OPTIONS\/\fR
|
||||
additional push options to transmit
|
||||
.TP
|
||||
@ -66,6 +69,12 @@ do everything except actually upload the CL
|
||||
\fB\-y\fR, \fB\-\-yes\fR
|
||||
answer yes to all safe prompts
|
||||
.TP
|
||||
\fB\-\-ignore\-untracked\-files\fR
|
||||
ignore untracked files in the working copy
|
||||
.TP
|
||||
\fB\-\-no\-ignore\-untracked\-files\fR
|
||||
always ask about untracked files in the working copy
|
||||
.TP
|
||||
\fB\-\-no\-cert\-checks\fR
|
||||
disable verifying ssl certs (unsafe)
|
||||
.SS Logging options:
|
||||
@ -118,6 +127,12 @@ respective list of users, and emails are sent to any new users. Users passed as
|
||||
\fB\-\-reviewers\fR must already be registered with the code review system, or the
|
||||
upload will fail.
|
||||
.PP
|
||||
While most normal Gerrit options have dedicated command line options, direct
|
||||
access to the Gerit options is available via \fB\-\-push\-options\fR. This is useful when
|
||||
Gerrit has newer functionality that repo upload doesn't yet support, or doesn't
|
||||
have plans to support. See the Push Options documentation for more details:
|
||||
https://gerrit\-review.googlesource.com/Documentation/user\-upload.html#push_options
|
||||
.PP
|
||||
Configuration
|
||||
.PP
|
||||
review.URL.autoupload:
|
||||
|
@ -123,7 +123,7 @@ class _Default(object):
|
||||
destBranchExpr = None
|
||||
upstreamExpr = None
|
||||
remote = None
|
||||
sync_j = 1
|
||||
sync_j = None
|
||||
sync_c = False
|
||||
sync_s = False
|
||||
sync_tags = True
|
||||
@ -284,7 +284,7 @@ class _XmlSubmanifest:
|
||||
if self.project:
|
||||
manifestUrl = remote.ToRemoteSpec(self.project).url
|
||||
else:
|
||||
manifestUrl = mp.GetRemote(mp.remote.name).url
|
||||
manifestUrl = mp.GetRemote().url
|
||||
manifestName = self.manifestName or 'default.xml'
|
||||
revision = self.revision or self.name
|
||||
path = self.path or revision.split('/')[-1]
|
||||
@ -358,7 +358,10 @@ class XmlManifest(object):
|
||||
|
||||
self.repodir = os.path.abspath(repodir)
|
||||
self._CheckLocalPath(submanifest_path)
|
||||
self.topdir = os.path.join(os.path.dirname(self.repodir), submanifest_path)
|
||||
self.topdir = os.path.dirname(self.repodir)
|
||||
if submanifest_path:
|
||||
# This avoids a trailing os.path.sep when submanifest_path is empty.
|
||||
self.topdir = os.path.join(self.topdir, submanifest_path)
|
||||
if manifest_file != os.path.abspath(manifest_file):
|
||||
raise ManifestParseError('manifest_file must be abspath')
|
||||
self.manifestFile = manifest_file
|
||||
@ -548,7 +551,7 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
|
||||
if d.upstreamExpr:
|
||||
have_default = True
|
||||
e.setAttribute('upstream', d.upstreamExpr)
|
||||
if d.sync_j > 1:
|
||||
if d.sync_j is not None:
|
||||
have_default = True
|
||||
e.setAttribute('sync-j', '%d' % d.sync_j)
|
||||
if d.sync_c:
|
||||
@ -1385,7 +1388,7 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
|
||||
|
||||
def _AddMetaProjectMirror(self, m):
|
||||
name = None
|
||||
m_url = m.GetRemote(m.remote.name).url
|
||||
m_url = m.GetRemote().url
|
||||
if m_url.endswith('/.git'):
|
||||
raise ManifestParseError('refusing to mirror %s' % m_url)
|
||||
|
||||
@ -1462,8 +1465,8 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
|
||||
d.destBranchExpr = node.getAttribute('dest-branch') or None
|
||||
d.upstreamExpr = node.getAttribute('upstream') or None
|
||||
|
||||
d.sync_j = XmlInt(node, 'sync-j', 1)
|
||||
if d.sync_j <= 0:
|
||||
d.sync_j = XmlInt(node, 'sync-j', None)
|
||||
if d.sync_j is not None and d.sync_j <= 0:
|
||||
raise ManifestParseError('%s: sync-j must be greater than 0, not "%s"' %
|
||||
(self.manifestFile, d.sync_j))
|
||||
|
||||
|
7
pager.py
7
pager.py
@ -56,8 +56,11 @@ def _PipePager(pager):
|
||||
global pager_process, old_stdout, old_stderr
|
||||
assert pager_process is None, "Only one active pager process at a time"
|
||||
# Create pager process, piping stdout/err into its stdin
|
||||
pager_process = subprocess.Popen([pager], stdin=subprocess.PIPE, stdout=sys.stdout,
|
||||
stderr=sys.stderr)
|
||||
try:
|
||||
pager_process = subprocess.Popen([pager], stdin=subprocess.PIPE, stdout=sys.stdout,
|
||||
stderr=sys.stderr)
|
||||
except FileNotFoundError:
|
||||
sys.exit(f'fatal: cannot start pager "{pager}"')
|
||||
old_stdout = sys.stdout
|
||||
old_stderr = sys.stderr
|
||||
sys.stdout = pager_process.stdin
|
||||
|
94
project.py
94
project.py
@ -205,6 +205,7 @@ class ReviewableBranch(object):
|
||||
private=False,
|
||||
notify=None,
|
||||
wip=False,
|
||||
ready=False,
|
||||
dest_branch=None,
|
||||
validate_certs=True,
|
||||
push_options=None):
|
||||
@ -217,6 +218,7 @@ class ReviewableBranch(object):
|
||||
private=private,
|
||||
notify=notify,
|
||||
wip=wip,
|
||||
ready=ready,
|
||||
dest_branch=dest_branch,
|
||||
validate_certs=validate_certs,
|
||||
push_options=push_options)
|
||||
@ -684,9 +686,13 @@ class Project(object):
|
||||
self._userident_name = ''
|
||||
self._userident_email = ''
|
||||
|
||||
def GetRemote(self, name):
|
||||
def GetRemote(self, name=None):
|
||||
"""Get the configuration for a single remote.
|
||||
|
||||
Defaults to the current project's remote.
|
||||
"""
|
||||
if name is None:
|
||||
name = self.remote.name
|
||||
return self.config.GetRemote(name)
|
||||
|
||||
def GetBranch(self, name):
|
||||
@ -1003,6 +1009,7 @@ class Project(object):
|
||||
private=False,
|
||||
notify=None,
|
||||
wip=False,
|
||||
ready=False,
|
||||
dest_branch=None,
|
||||
validate_certs=True,
|
||||
push_options=None):
|
||||
@ -1072,6 +1079,8 @@ class Project(object):
|
||||
opts += ['private']
|
||||
if wip:
|
||||
opts += ['wip']
|
||||
if ready:
|
||||
opts += ['ready']
|
||||
if opts:
|
||||
ref_spec = ref_spec + '%' + ','.join(opts)
|
||||
cmd.append(ref_spec)
|
||||
@ -1277,7 +1286,7 @@ class Project(object):
|
||||
if self.revisionId:
|
||||
return self.revisionId
|
||||
|
||||
rem = self.GetRemote(self.remote.name)
|
||||
rem = self.GetRemote()
|
||||
rev = rem.ToLocal(self.revisionExpr)
|
||||
|
||||
if all_refs is not None and rev in all_refs:
|
||||
@ -1469,7 +1478,7 @@ class Project(object):
|
||||
"discarding %d commits removed from upstream",
|
||||
len(local_changes) - cnt_mine)
|
||||
|
||||
branch.remote = self.GetRemote(self.remote.name)
|
||||
branch.remote = self.GetRemote()
|
||||
if not ID_RE.match(self.revisionExpr):
|
||||
# in case of manifest sync the revisionExpr might be a SHA1
|
||||
branch.merge = self.revisionExpr
|
||||
@ -1527,7 +1536,7 @@ class Project(object):
|
||||
def DownloadPatchSet(self, change_id, patch_id):
|
||||
"""Download a single patch set of a single change to FETCH_HEAD.
|
||||
"""
|
||||
remote = self.GetRemote(self.remote.name)
|
||||
remote = self.GetRemote()
|
||||
|
||||
cmd = ['fetch', remote.name]
|
||||
cmd.append('refs/changes/%2.2d/%d/%d'
|
||||
@ -1669,13 +1678,10 @@ class Project(object):
|
||||
|
||||
all_refs = self.bare_ref.all
|
||||
if R_HEADS + name in all_refs:
|
||||
return GitCommand(self,
|
||||
['checkout', name, '--'],
|
||||
capture_stdout=True,
|
||||
capture_stderr=True).Wait() == 0
|
||||
return GitCommand(self, ['checkout', '-q', name, '--']).Wait() == 0
|
||||
|
||||
branch = self.GetBranch(name)
|
||||
branch.remote = self.GetRemote(self.remote.name)
|
||||
branch.remote = self.GetRemote()
|
||||
branch.merge = branch_merge
|
||||
if not branch.merge.startswith('refs/') and not ID_RE.match(branch_merge):
|
||||
branch.merge = R_HEADS + branch_merge
|
||||
@ -1697,10 +1703,7 @@ class Project(object):
|
||||
branch.Save()
|
||||
return True
|
||||
|
||||
if GitCommand(self,
|
||||
['checkout', '-b', branch.name, revid],
|
||||
capture_stdout=True,
|
||||
capture_stderr=True).Wait() == 0:
|
||||
if GitCommand(self, ['checkout', '-q', '-b', branch.name, revid]).Wait() == 0:
|
||||
branch.Save()
|
||||
return True
|
||||
return False
|
||||
@ -2043,7 +2046,7 @@ class Project(object):
|
||||
self.bare_git.rev_list('-1', '--missing=allow-any',
|
||||
'%s^0' % self.revisionExpr, '--')
|
||||
if self.upstream:
|
||||
rev = self.GetRemote(self.remote.name).ToLocal(self.upstream)
|
||||
rev = self.GetRemote().ToLocal(self.upstream)
|
||||
self.bare_git.rev_list('-1', '--missing=allow-any',
|
||||
'%s^0' % rev, '--')
|
||||
self.bare_git.merge_base('--is-ancestor', self.revisionExpr, rev)
|
||||
@ -2334,7 +2337,7 @@ class Project(object):
|
||||
if initial and (self.manifest.manifestProject.depth or self.clone_depth):
|
||||
return False
|
||||
|
||||
remote = self.GetRemote(self.remote.name)
|
||||
remote = self.GetRemote()
|
||||
bundle_url = remote.url + '/clone.bundle'
|
||||
bundle_url = GitConfig.ForUser().UrlInsteadOf(bundle_url)
|
||||
if GetSchemeFromUrl(bundle_url) not in ('http', 'https',
|
||||
@ -2655,7 +2658,7 @@ class Project(object):
|
||||
|
||||
def _InitRemote(self):
|
||||
if self.remote.url:
|
||||
remote = self.GetRemote(self.remote.name)
|
||||
remote = self.GetRemote()
|
||||
remote.url = self.remote.url
|
||||
remote.pushUrl = self.remote.pushUrl
|
||||
remote.review = self.remote.review
|
||||
@ -2668,6 +2671,7 @@ class Project(object):
|
||||
remote.Save()
|
||||
|
||||
def _InitMRef(self):
|
||||
"""Initialize the pseudo m/<manifest branch> ref."""
|
||||
if self.manifest.branch:
|
||||
if self.use_git_worktrees:
|
||||
# Set up the m/ space to point to the worktree-specific ref space.
|
||||
@ -2697,6 +2701,16 @@ class Project(object):
|
||||
self._InitAnyMRef(HEAD, self.bare_git)
|
||||
|
||||
def _InitAnyMRef(self, ref, active_git, detach=False):
|
||||
"""Initialize |ref| in |active_git| to the value in the manifest.
|
||||
|
||||
This points |ref| to the <project> setting in the manifest.
|
||||
|
||||
Args:
|
||||
ref: The branch to update.
|
||||
active_git: The git repository to make updates in.
|
||||
detach: Whether to update target of symbolic refs, or overwrite the ref
|
||||
directly (and thus make it non-symbolic).
|
||||
"""
|
||||
cur = self.bare_ref.symref(ref)
|
||||
|
||||
if self.revisionId:
|
||||
@ -2705,7 +2719,7 @@ class Project(object):
|
||||
dst = self.revisionId + '^0'
|
||||
active_git.UpdateRef(ref, dst, message=msg, detach=True)
|
||||
else:
|
||||
remote = self.GetRemote(self.remote.name)
|
||||
remote = self.GetRemote()
|
||||
dst = remote.ToLocal(self.revisionExpr)
|
||||
if cur != dst:
|
||||
msg = 'manifest set to %s' % self.revisionExpr
|
||||
@ -2780,6 +2794,35 @@ class Project(object):
|
||||
else:
|
||||
raise
|
||||
|
||||
def _InitialCheckoutStart(self):
|
||||
"""Called when checking out a project for the first time.
|
||||
|
||||
This will use temporary non-visible paths so we can be safely interrupted
|
||||
without leaving incomplete state behind.
|
||||
"""
|
||||
paths = [f'{x}.tmp' for x in (self.relpath, self.worktree, self.gitdir, self.objdir)]
|
||||
for p in paths:
|
||||
platform_utils.rmtree(p, ignore_errors=True)
|
||||
self.UpdatePaths(*paths)
|
||||
|
||||
def _InitialCheckoutFinalizeNetworkHalf(self):
|
||||
"""Finalize the object dirs after network syncing works."""
|
||||
# Once the network half finishes, we can move the objects into the right
|
||||
# place by removing the ".tmp" suffix on the dirs.
|
||||
platform_utils.rmtree(self.gitdir[:-4], ignore_errors=True)
|
||||
os.rename(self.gitdir, self.gitdir[:-4])
|
||||
self.UpdatePaths(self.relpath, self.worktree, self.gitdir[:-4], self.objdir[:-4])
|
||||
|
||||
def _InitialCheckoutFinalizeLocalHalf(self):
|
||||
"""Finalize the initial checkout and make it available."""
|
||||
assert self.gitdir == self.objdir
|
||||
# Once the local half finishes, we can move the manifest dir into the right
|
||||
# place by removing the ".tmp" suffix on the dirs.
|
||||
platform_utils.rmtree(self.worktree[:-4], ignore_errors=True)
|
||||
os.rename(self.worktree, self.worktree[:-4])
|
||||
self.UpdatePaths(
|
||||
self.relpath[:-4], self.worktree[:-4], self.gitdir, self.objdir)
|
||||
|
||||
def _InitGitWorktree(self):
|
||||
"""Init the project using git worktrees."""
|
||||
self.bare_git.worktree('prune')
|
||||
@ -3666,6 +3709,8 @@ class ManifestProject(MetaProject):
|
||||
(GitConfig.ForUser().UrlInsteadOf(manifest_url),),
|
||||
file=sys.stderr)
|
||||
|
||||
self._InitialCheckoutStart()
|
||||
|
||||
# The manifest project object doesn't keep track of the path on the
|
||||
# server where this git is located, so let's save that here.
|
||||
mirrored_manifest_git = None
|
||||
@ -3697,7 +3742,7 @@ class ManifestProject(MetaProject):
|
||||
|
||||
# Set the remote URL before the remote branch as we might need it below.
|
||||
if manifest_url:
|
||||
r = self.GetRemote(self.remote.name)
|
||||
r = self.GetRemote()
|
||||
r.url = manifest_url
|
||||
r.ResetFetch()
|
||||
r.Save()
|
||||
@ -3823,18 +3868,16 @@ class ManifestProject(MetaProject):
|
||||
clone_bundle=clone_bundle, current_branch_only=current_branch_only,
|
||||
tags=tags, submodules=submodules, clone_filter=clone_filter,
|
||||
partial_clone_exclude=self.manifest.PartialCloneExclude):
|
||||
r = self.GetRemote(self.remote.name)
|
||||
r = self.GetRemote()
|
||||
print('fatal: cannot obtain manifest %s' % r.url, file=sys.stderr)
|
||||
|
||||
# Better delete the manifest git dir if we created it; otherwise next
|
||||
# time (when user fixes problems) we won't go through the "is_new" logic.
|
||||
if is_new:
|
||||
platform_utils.rmtree(self.gitdir)
|
||||
return False
|
||||
|
||||
if manifest_branch:
|
||||
self.MetaBranchSwitch(submodules=submodules)
|
||||
|
||||
if is_new:
|
||||
self._InitialCheckoutFinalizeNetworkHalf()
|
||||
|
||||
syncbuf = SyncBuffer(self.config)
|
||||
self.Sync_LocalHalf(syncbuf, submodules=submodules)
|
||||
syncbuf.Finish()
|
||||
@ -3857,6 +3900,9 @@ class ManifestProject(MetaProject):
|
||||
with open(dest, 'wb') as f:
|
||||
f.write(manifest_data)
|
||||
|
||||
if is_new:
|
||||
self._InitialCheckoutFinalizeLocalHalf()
|
||||
|
||||
try:
|
||||
self.manifest.Link(manifest_name)
|
||||
except ManifestParseError as e:
|
||||
|
21
repo
21
repo
@ -149,7 +149,7 @@ if not REPO_REV:
|
||||
BUG_URL = 'https://bugs.chromium.org/p/gerrit/issues/entry?template=Repo+tool+issue'
|
||||
|
||||
# increment this whenever we make important changes to this script
|
||||
VERSION = (2, 21)
|
||||
VERSION = (2, 29)
|
||||
|
||||
# increment this if the MAINTAINER_KEYS block is modified
|
||||
KEYRING_VERSION = (2, 3)
|
||||
@ -316,6 +316,9 @@ def InitParser(parser, gitc_init=False):
|
||||
help='download the manifest as a static file '
|
||||
'rather then create a git checkout of '
|
||||
'the manifest repo')
|
||||
group.add_option('--manifest-depth', type='int', default=1, metavar='DEPTH',
|
||||
help='create a shallow clone of the manifest repo with '
|
||||
'given depth; see git clone (default: %default)')
|
||||
|
||||
# Options that only affect manifest project, and not any of the projects
|
||||
# specified in the manifest itself.
|
||||
@ -325,9 +328,9 @@ def InitParser(parser, gitc_init=False):
|
||||
# want -c, so try to satisfy both as best we can.
|
||||
if not gitc_init:
|
||||
cbr_opts += ['-c']
|
||||
group.add_option(*cbr_opts,
|
||||
group.add_option(*cbr_opts, default=True,
|
||||
dest='current_branch_only', action='store_true',
|
||||
help='fetch only current manifest branch from server')
|
||||
help='fetch only current manifest branch from server (default)')
|
||||
group.add_option('--no-current-branch',
|
||||
dest='current_branch_only', action='store_false',
|
||||
help='fetch all manifest branches from server')
|
||||
@ -612,15 +615,20 @@ def _Init(args, gitc_init=False):
|
||||
try:
|
||||
if not opt.quiet:
|
||||
print('Downloading Repo source from', url)
|
||||
dst = os.path.abspath(os.path.join(repodir, S_repo))
|
||||
dst_final = os.path.abspath(os.path.join(repodir, S_repo))
|
||||
dst = dst_final + '.tmp'
|
||||
shutil.rmtree(dst, ignore_errors=True)
|
||||
_Clone(url, dst, opt.clone_bundle, opt.quiet, opt.verbose)
|
||||
|
||||
remote_ref, rev = check_repo_rev(dst, rev, opt.repo_verify, quiet=opt.quiet)
|
||||
_Checkout(dst, remote_ref, rev, opt.quiet)
|
||||
|
||||
if not os.path.isfile(os.path.join(dst, 'repo')):
|
||||
print("warning: '%s' does not look like a git-repo repository, is "
|
||||
"REPO_URL set correctly?" % url, file=sys.stderr)
|
||||
print("fatal: '%s' does not look like a git-repo repository, is "
|
||||
"--repo-url set correctly?" % url, file=sys.stderr)
|
||||
raise CloneFailure()
|
||||
|
||||
os.rename(dst, dst_final)
|
||||
|
||||
except CloneFailure:
|
||||
print('fatal: double check your --repo-rev setting.', file=sys.stderr)
|
||||
@ -1317,6 +1325,7 @@ def main(orig_args):
|
||||
print("fatal: cloning the git-repo repository failed, will remove "
|
||||
"'%s' " % path, file=sys.stderr)
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
shutil.rmtree(path + '.tmp', ignore_errors=True)
|
||||
sys.exit(1)
|
||||
repo_main, rel_repo_dir = _FindRepo()
|
||||
else:
|
||||
|
@ -60,8 +60,10 @@ change id will be added.
|
||||
capture_stderr=True)
|
||||
status = p.Wait()
|
||||
|
||||
print(p.stdout, file=sys.stdout)
|
||||
print(p.stderr, file=sys.stderr)
|
||||
if p.stdout:
|
||||
print(p.stdout.strip(), file=sys.stdout)
|
||||
if p.stderr:
|
||||
print(p.stderr.strip(), file=sys.stderr)
|
||||
|
||||
if status == 0:
|
||||
# The cherry-pick was applied correctly. We just need to edit the
|
||||
|
@ -109,6 +109,10 @@ to update the working directory files.
|
||||
Args:
|
||||
opt: options from optparse.
|
||||
"""
|
||||
# Normally this value is set when instantiating the project, but the
|
||||
# manifest project is special and is created when instantiating the
|
||||
# manifest which happens before we parse options.
|
||||
self.manifest.manifestProject.clone_depth = opt.manifest_depth
|
||||
if not self.manifest.manifestProject.Sync(
|
||||
manifest_url=opt.manifest_url,
|
||||
manifest_branch=opt.manifest_branch,
|
||||
@ -144,7 +148,7 @@ to update the working directory files.
|
||||
return value
|
||||
return a
|
||||
|
||||
def _ShouldConfigureUser(self, opt):
|
||||
def _ShouldConfigureUser(self, opt, existing_checkout):
|
||||
gc = self.client.globalConfig
|
||||
mp = self.manifest.manifestProject
|
||||
|
||||
@ -156,7 +160,7 @@ to update the working directory files.
|
||||
mp.config.SetString('user.name', gc.GetString('user.name'))
|
||||
mp.config.SetString('user.email', gc.GetString('user.email'))
|
||||
|
||||
if not opt.quiet:
|
||||
if not opt.quiet and not existing_checkout or opt.verbose:
|
||||
print()
|
||||
print('Your identity is: %s <%s>' % (mp.config.GetString('user.name'),
|
||||
mp.config.GetString('user.email')))
|
||||
@ -241,7 +245,7 @@ to update the working directory files.
|
||||
if current_dir != self.manifest.topdir:
|
||||
print('If this is not the directory in which you want to initialize '
|
||||
'repo, please run:')
|
||||
print(' rm -r %s/.repo' % self.manifest.topdir)
|
||||
print(' rm -r %s' % os.path.join(self.manifest.topdir, '.repo'))
|
||||
print('and try again.')
|
||||
|
||||
def ValidateOptions(self, opt, args):
|
||||
@ -311,10 +315,17 @@ to update the working directory files.
|
||||
# Older versions of git supported worktree, but had dangerous gc bugs.
|
||||
git_require((2, 15, 0), fail=True, msg='git gc worktree corruption')
|
||||
|
||||
# Provide a short notice that we're reinitializing an existing checkout.
|
||||
# Sometimes developers might not realize that they're in one, or that
|
||||
# repo doesn't do nested checkouts.
|
||||
existing_checkout = self.manifest.manifestProject.Exists
|
||||
if not opt.quiet and existing_checkout:
|
||||
print('repo: reusing existing repo client checkout in', self.manifest.topdir)
|
||||
|
||||
self._SyncManifest(opt)
|
||||
|
||||
if os.isatty(0) and os.isatty(1) and not self.manifest.IsMirror:
|
||||
if opt.config_name or self._ShouldConfigureUser(opt):
|
||||
if opt.config_name or self._ShouldConfigureUser(opt, existing_checkout):
|
||||
self._ConfigureUser(opt)
|
||||
self._ConfigureColor()
|
||||
|
||||
|
@ -75,6 +75,7 @@ The '%prog' command stages files to prepare the next commit.
|
||||
out.nl()
|
||||
|
||||
out.prompt('project> ')
|
||||
out.flush()
|
||||
try:
|
||||
a = sys.stdin.readline()
|
||||
except KeyboardInterrupt:
|
||||
|
111
subcmds/sync.py
111
subcmds/sync.py
@ -28,6 +28,7 @@ import time
|
||||
import urllib.error
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
import xml.parsers.expat
|
||||
import xmlrpc.client
|
||||
|
||||
try:
|
||||
@ -52,7 +53,7 @@ import git_superproject
|
||||
import gitc_utils
|
||||
from project import Project
|
||||
from project import RemoteSpec
|
||||
from command import Command, MirrorSafeCommand, WORKER_BATCH_SIZE
|
||||
from command import Command, DEFAULT_LOCAL_JOBS, MirrorSafeCommand, WORKER_BATCH_SIZE
|
||||
from error import RepoChangedException, GitError, ManifestParseError
|
||||
import platform_utils
|
||||
from project import SyncBuffer
|
||||
@ -65,7 +66,6 @@ _ONE_DAY_S = 24 * 60 * 60
|
||||
|
||||
|
||||
class Sync(Command, MirrorSafeCommand):
|
||||
jobs = 1
|
||||
COMMON = True
|
||||
MULTI_MANIFEST_SUPPORT = True
|
||||
helpSummary = "Update working tree to the latest revision"
|
||||
@ -168,21 +168,16 @@ If the remote SSH daemon is Gerrit Code Review, version 2.0.10 or
|
||||
later is required to fix a server side protocol bug.
|
||||
|
||||
"""
|
||||
PARALLEL_JOBS = 1
|
||||
|
||||
def _CommonOptions(self, p):
|
||||
if self.outer_client and self.outer_client.manifest:
|
||||
try:
|
||||
self.PARALLEL_JOBS = self.outer_client.manifest.default.sync_j
|
||||
except ManifestParseError:
|
||||
pass
|
||||
super()._CommonOptions(p)
|
||||
# A value of 0 means we want parallel jobs, but we'll determine the default
|
||||
# value later on.
|
||||
PARALLEL_JOBS = 0
|
||||
|
||||
def _Options(self, p, show_smart=True):
|
||||
p.add_option('--jobs-network', default=None, type=int, metavar='JOBS',
|
||||
help='number of network jobs to run in parallel (defaults to --jobs)')
|
||||
help='number of network jobs to run in parallel (defaults to --jobs or 1)')
|
||||
p.add_option('--jobs-checkout', default=None, type=int, metavar='JOBS',
|
||||
help='number of local checkout jobs to run in parallel (defaults to --jobs)')
|
||||
help='number of local checkout jobs to run in parallel (defaults to --jobs or '
|
||||
f'{DEFAULT_LOCAL_JOBS})')
|
||||
|
||||
p.add_option('-f', '--force-broken',
|
||||
dest='force_broken', action='store_true',
|
||||
@ -451,7 +446,7 @@ later is required to fix a server side protocol bug.
|
||||
def _Fetch(self, projects, opt, err_event, ssh_proxy):
|
||||
ret = True
|
||||
|
||||
jobs = opt.jobs_network if opt.jobs_network else self.jobs
|
||||
jobs = opt.jobs_network
|
||||
fetched = set()
|
||||
pm = Progress('Fetching', len(projects), delay=False, quiet=opt.quiet)
|
||||
|
||||
@ -651,7 +646,7 @@ later is required to fix a server side protocol bug.
|
||||
return ret
|
||||
|
||||
return self.ExecuteInParallel(
|
||||
opt.jobs_checkout if opt.jobs_checkout else self.jobs,
|
||||
opt.jobs_checkout,
|
||||
functools.partial(self._CheckoutOne, opt.detach_head, opt.force_sync),
|
||||
all_projects,
|
||||
callback=_ProcessResults,
|
||||
@ -663,21 +658,27 @@ later is required to fix a server side protocol bug.
|
||||
|
||||
tidy_dirs = {}
|
||||
for project in projects:
|
||||
# Make sure pruning never kicks in with shared projects.
|
||||
# Make sure pruning never kicks in with shared projects that do not use
|
||||
# alternates to avoid corruption.
|
||||
if (not project.use_git_worktrees and
|
||||
len(project.manifest.GetProjectsWithName(project.name, all_manifests=True)) > 1):
|
||||
if not opt.quiet:
|
||||
print('\r%s: Shared project %s found, disabling pruning.' %
|
||||
(project.relpath, project.name))
|
||||
if git_require((2, 7, 0)):
|
||||
project.EnableRepositoryExtension('preciousObjects')
|
||||
if project.UseAlternates:
|
||||
# Undo logic set by previous versions of repo.
|
||||
project.config.SetString('extensions.preciousObjects', None)
|
||||
project.config.SetString('gc.pruneExpire', None)
|
||||
else:
|
||||
# This isn't perfect, but it's the best we can do with old git.
|
||||
print('\r%s: WARNING: shared projects are unreliable when using old '
|
||||
'versions of git; please upgrade to git-2.7.0+.'
|
||||
% (project.relpath,),
|
||||
file=sys.stderr)
|
||||
project.config.SetString('gc.pruneExpire', 'never')
|
||||
if not opt.quiet:
|
||||
print('\r%s: Shared project %s found, disabling pruning.' %
|
||||
(project.relpath, project.name))
|
||||
if git_require((2, 7, 0)):
|
||||
project.EnableRepositoryExtension('preciousObjects')
|
||||
else:
|
||||
# This isn't perfect, but it's the best we can do with old git.
|
||||
print('\r%s: WARNING: shared projects are unreliable when using old '
|
||||
'versions of git; please upgrade to git-2.7.0+.'
|
||||
% (project.relpath,),
|
||||
file=sys.stderr)
|
||||
project.config.SetString('gc.pruneExpire', 'never')
|
||||
project.config.SetString('gc.autoDetach', 'false')
|
||||
# Only call git gc once per objdir, but call pack-refs for the remainder.
|
||||
if project.objdir not in tidy_dirs:
|
||||
@ -691,8 +692,7 @@ later is required to fix a server side protocol bug.
|
||||
project.bare_git,
|
||||
)
|
||||
|
||||
cpu_count = os.cpu_count()
|
||||
jobs = min(self.jobs, cpu_count)
|
||||
jobs = opt.jobs
|
||||
|
||||
if jobs < 2:
|
||||
for (run_gc, bare_git) in tidy_dirs.values():
|
||||
@ -704,6 +704,7 @@ later is required to fix a server side protocol bug.
|
||||
pm.end()
|
||||
return
|
||||
|
||||
cpu_count = os.cpu_count()
|
||||
config = {'pack.threads': cpu_count // jobs if cpu_count > jobs else 1}
|
||||
|
||||
threads = set()
|
||||
@ -1011,9 +1012,6 @@ later is required to fix a server side protocol bug.
|
||||
sys.exit(1)
|
||||
self._ReloadManifest(manifest_name, mp.manifest)
|
||||
|
||||
if opt.jobs is None:
|
||||
self.jobs = mp.manifest.default.sync_j
|
||||
|
||||
def ValidateOptions(self, opt, args):
|
||||
if opt.force_broken:
|
||||
print('warning: -f/--force-broken is now the default behavior, and the '
|
||||
@ -1036,12 +1034,6 @@ later is required to fix a server side protocol bug.
|
||||
opt.prune = True
|
||||
|
||||
def Execute(self, opt, args):
|
||||
if opt.jobs:
|
||||
self.jobs = opt.jobs
|
||||
if self.jobs > 1:
|
||||
soft_limit, _ = _rlimit_nofile()
|
||||
self.jobs = min(self.jobs, (soft_limit - 5) // 3)
|
||||
|
||||
manifest = self.outer_manifest
|
||||
if not opt.outer_manifest:
|
||||
manifest = self.manifest
|
||||
@ -1092,6 +1084,36 @@ later is required to fix a server side protocol bug.
|
||||
else:
|
||||
print('Skipping update of local manifest project.')
|
||||
|
||||
# Now that the manifests are up-to-date, setup the jobs value.
|
||||
if opt.jobs is None:
|
||||
# User has not made a choice, so use the manifest settings.
|
||||
opt.jobs = mp.default.sync_j
|
||||
if opt.jobs is not None:
|
||||
# Neither user nor manifest have made a choice.
|
||||
if opt.jobs_network is None:
|
||||
opt.jobs_network = opt.jobs
|
||||
if opt.jobs_checkout is None:
|
||||
opt.jobs_checkout = opt.jobs
|
||||
# Setup defaults if jobs==0.
|
||||
if not opt.jobs:
|
||||
if not opt.jobs_network:
|
||||
opt.jobs_network = 1
|
||||
if not opt.jobs_checkout:
|
||||
opt.jobs_checkout = DEFAULT_LOCAL_JOBS
|
||||
opt.jobs = os.cpu_count()
|
||||
|
||||
# Try to stay under user rlimit settings.
|
||||
#
|
||||
# Since each worker requires at 3 file descriptors to run `git fetch`, use
|
||||
# that to scale down the number of jobs. Unfortunately there isn't an easy
|
||||
# way to determine this reliably as systems change, but it was last measured
|
||||
# by hand in 2011.
|
||||
soft_limit, _ = _rlimit_nofile()
|
||||
jobs_soft_limit = max(1, (soft_limit - 5) // 3)
|
||||
opt.jobs = min(opt.jobs, jobs_soft_limit)
|
||||
opt.jobs_network = min(opt.jobs_network, jobs_soft_limit)
|
||||
opt.jobs_checkout = min(opt.jobs_checkout, jobs_soft_limit)
|
||||
|
||||
superproject_logging_data = {}
|
||||
self._UpdateProjectsRevisionId(opt, args, superproject_logging_data,
|
||||
manifest)
|
||||
@ -1410,11 +1432,16 @@ class PersistentTransport(xmlrpc.client.Transport):
|
||||
raise
|
||||
|
||||
p, u = xmlrpc.client.getparser()
|
||||
while 1:
|
||||
data = response.read(1024)
|
||||
if not data:
|
||||
break
|
||||
# Response should be fairly small, so read it all at once.
|
||||
# This way we can show it to the user in case of error (e.g. HTML).
|
||||
data = response.read()
|
||||
try:
|
||||
p.feed(data)
|
||||
except xml.parsers.expat.ExpatError as e:
|
||||
raise IOError(
|
||||
f'Parsing the manifest failed: {e}\n'
|
||||
f'Please report this to your manifest server admin.\n'
|
||||
f'Here is the full response:\n{data.decode("utf-8")}')
|
||||
p.close()
|
||||
return u.close()
|
||||
|
||||
|
@ -78,6 +78,13 @@ added to the respective list of users, and emails are sent to any
|
||||
new users. Users passed as --reviewers must already be registered
|
||||
with the code review system, or the upload will fail.
|
||||
|
||||
While most normal Gerrit options have dedicated command line options,
|
||||
direct access to the Gerit options is available via --push-options.
|
||||
This is useful when Gerrit has newer functionality that %prog doesn't
|
||||
yet support, or doesn't have plans to support. See the Push Options
|
||||
documentation for more details:
|
||||
https://gerrit-review.googlesource.com/Documentation/user-upload.html#push_options
|
||||
|
||||
# Configuration
|
||||
|
||||
review.URL.autoupload:
|
||||
@ -190,6 +197,9 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
||||
p.add_option('-w', '--wip',
|
||||
action='store_true', dest='wip', default=False,
|
||||
help='upload as a work-in-progress change')
|
||||
p.add_option('-r', '--ready',
|
||||
action='store_true', default=False,
|
||||
help='mark change as ready (clears work-in-progress setting)')
|
||||
p.add_option('-o', '--push-option',
|
||||
type='string', action='append', dest='push_options',
|
||||
default=[],
|
||||
@ -252,7 +262,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
||||
answer = sys.stdin.readline().strip().lower()
|
||||
answer = answer in ('y', 'yes', '1', 'true', 't')
|
||||
|
||||
if answer:
|
||||
if not opt.yes and answer:
|
||||
if len(branch.commits) > UNUSUAL_COMMIT_THRESHOLD:
|
||||
answer = _ConfirmManyUploads()
|
||||
|
||||
@ -325,14 +335,15 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
||||
if not todo:
|
||||
_die("nothing uncommented for upload")
|
||||
|
||||
many_commits = False
|
||||
for branch in todo:
|
||||
if len(branch.commits) > UNUSUAL_COMMIT_THRESHOLD:
|
||||
many_commits = True
|
||||
break
|
||||
if many_commits:
|
||||
if not _ConfirmManyUploads(multiple_branches=True):
|
||||
_die("upload aborted by user")
|
||||
if not opt.yes:
|
||||
many_commits = False
|
||||
for branch in todo:
|
||||
if len(branch.commits) > UNUSUAL_COMMIT_THRESHOLD:
|
||||
many_commits = True
|
||||
break
|
||||
if many_commits:
|
||||
if not _ConfirmManyUploads(multiple_branches=True):
|
||||
_die("upload aborted by user")
|
||||
|
||||
self._UploadAndReport(opt, todo, people)
|
||||
|
||||
@ -465,6 +476,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
||||
private=opt.private,
|
||||
notify=notify,
|
||||
wip=opt.wip,
|
||||
ready=opt.ready,
|
||||
dest_branch=destination,
|
||||
validate_certs=opt.validate_certs,
|
||||
push_options=opt.push_options)
|
||||
|
@ -33,7 +33,7 @@ class Version(Command, MirrorSafeCommand):
|
||||
|
||||
def Execute(self, opt, args):
|
||||
rp = self.manifest.repoProject
|
||||
rem = rp.GetRemote(rp.remote.name)
|
||||
rem = rp.GetRemote()
|
||||
branch = rp.GetBranch('default')
|
||||
|
||||
# These might not be the same. Report them both.
|
||||
|
Reference in New Issue
Block a user