Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
76cc31f1
Commit
76cc31f1
authored
4 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Pass `args` in `pr-pull` instead of using global `args`.
parent
8a1f8ab8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/dev-cmd/pr-pull.rb
+16
-14
16 additions, 14 deletions
Library/Homebrew/dev-cmd/pr-pull.rb
with
16 additions
and
14 deletions
Library/Homebrew/dev-cmd/pr-pull.rb
+
16
−
14
View file @
76cc31f1
...
...
@@ -76,7 +76,7 @@ module Homebrew
end
end
def
signoff!
(
pr
,
tap
:)
def
signoff!
(
pr
,
tap
:
,
args
:
)
message
=
Utils
.
popen_read
"git"
,
"-C"
,
tap
.
path
,
"log"
,
"-1"
,
"--pretty=%B"
subject
=
message
.
lines
.
first
.
strip
...
...
@@ -95,15 +95,15 @@ module Homebrew
body
+=
"
\n\n
#{
close_message
}
"
unless
body
.
include?
close_message
new_message
=
[
subject
,
body
,
trailers
].
join
(
"
\n\n
"
).
strip
if
Homebrew
.
args
.
dry_run?
if
args
.
dry_run?
puts
"git commit --amend --signoff -m $message"
else
safe_system
"git"
,
"-C"
,
tap
.
path
,
"commit"
,
"--amend"
,
"--signoff"
,
"--allow-empty"
,
"-q"
,
"-m"
,
new_message
end
end
def
cherry_pick_pr!
(
pr
,
path:
"."
)
if
Homebrew
.
args
.
dry_run?
def
cherry_pick_pr!
(
pr
,
path:
"."
,
args
:
)
if
args
.
dry_run?
puts
<<~
EOS
git fetch --force origin +refs/pull/
#{
pr
}
/head
git merge-base HEAD FETCH_HEAD
...
...
@@ -120,7 +120,7 @@ module Homebrew
result
=
Homebrew
.
args
.
verbose?
?
system
(
*
cherry_pick_args
)
:
quiet_system
(
*
cherry_pick_args
)
unless
result
if
Homebrew
.
args
.
resolve?
if
args
.
resolve?
odie
"Cherry-pick failed: try to resolve it."
else
system
"git"
,
"-C"
,
path
,
"cherry-pick"
,
"--abort"
...
...
@@ -138,19 +138,19 @@ module Homebrew
opoo
"Current branch is
#{
branch
}
: do you need to pull inside
#{
ref
}
?"
end
def
formulae_need_bottles?
(
tap
,
original_commit
)
return
if
Homebrew
.
args
.
dry_run?
def
formulae_need_bottles?
(
tap
,
original_commit
,
args
:
)
return
if
args
.
dry_run?
changed_formulae
(
tap
,
original_commit
).
any?
do
|
f
|
!
f
.
bottle_unneeded?
&&
!
f
.
bottle_disabled?
end
end
def
mirror_formulae
(
tap
,
original_commit
,
publish:
true
,
org
:,
repo
:)
def
mirror_formulae
(
tap
,
original_commit
,
publish:
true
,
org
:,
repo
:
,
args
:
)
changed_formulae
(
tap
,
original_commit
).
select
do
|
f
|
stable_urls
=
[
f
.
stable
.
url
]
+
f
.
stable
.
mirrors
stable_urls
.
grep
(
%r{^https://dl.bintray.com/
#{
org
}
/
#{
repo
}
/}
)
do
|
mirror_url
|
if
Homebrew
.
args
.
dry_run?
if
args
.
dry_run?
puts
"brew mirror
#{
f
.
full_name
}
"
else
odebug
"Mirroring
#{
mirror_url
}
"
...
...
@@ -210,7 +210,7 @@ module Homebrew
end
def
pr_pull
pr_pull_args
.
parse
args
=
pr_pull_args
.
parse
bintray_user
=
ENV
[
"HOMEBREW_BINTRAY_USER"
]
bintray_key
=
ENV
[
"HOMEBREW_BINTRAY_KEY"
]
...
...
@@ -239,14 +239,16 @@ module Homebrew
Dir
.
mktmpdir
pr
do
|
dir
|
cd
dir
do
original_commit
=
Utils
.
popen_read
(
"git"
,
"-C"
,
tap
.
path
,
"rev-parse"
,
"HEAD"
).
chomp
cherry_pick_pr!
pr
,
path:
tap
.
path
signoff!
pr
,
tap:
tap
unless
args
.
clean?
cherry_pick_pr!
(
pr
,
path:
tap
.
path
,
args:
args
)
signoff!
(
pr
,
tap:
tap
,
args:
args
)
unless
args
.
clean?
unless
args
.
no_upload?
mirror_formulae
(
tap
,
original_commit
,
org:
bintray_org
,
repo:
mirror_repo
,
publish:
!
args
.
no_publish?
)
mirror_formulae
(
tap
,
original_commit
,
org:
bintray_org
,
repo:
mirror_repo
,
publish:
!
args
.
no_publish?
,
args:
args
)
end
unless
formulae_need_bottles?
tap
,
original_commit
unless
formulae_need_bottles?
(
tap
,
original_commit
,
args:
args
)
ohai
"Skipping artifacts for #
#{
pr
}
as the formulae don't need bottles"
next
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment