Revert "bump: bump synced formula together"
This commit is contained in:
parent
c45a734293
commit
7873f0200f
@ -160,17 +160,13 @@ module Homebrew
|
|||||||
run_cask_style(cask, old_contents)
|
run_cask_style(cask, old_contents)
|
||||||
|
|
||||||
pr_info = {
|
pr_info = {
|
||||||
commits: [{
|
branch_name:,
|
||||||
commit_message:,
|
commit_message:,
|
||||||
old_contents:,
|
old_contents:,
|
||||||
sourcefile_path: cask.sourcefile_path,
|
|
||||||
}],
|
|
||||||
branch_name:,
|
|
||||||
pr_message: "Created with `brew bump-cask-pr`.",
|
pr_message: "Created with `brew bump-cask-pr`.",
|
||||||
|
sourcefile_path: cask.sourcefile_path,
|
||||||
tap: cask.tap,
|
tap: cask.tap,
|
||||||
pr_title: commit_message,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GitHub.create_bump_pr(pr_info, args:)
|
GitHub.create_bump_pr(pr_info, args:)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -81,14 +81,13 @@ module Homebrew
|
|||||||
description: "Include these additional Python packages when finding resources."
|
description: "Include these additional Python packages when finding resources."
|
||||||
comma_array "--python-exclude-packages=",
|
comma_array "--python-exclude-packages=",
|
||||||
description: "Exclude these Python packages when finding resources."
|
description: "Exclude these Python packages when finding resources."
|
||||||
comma_array "--bump-synced=",
|
|
||||||
hidden: true
|
|
||||||
conflicts "--dry-run", "--write-only"
|
conflicts "--dry-run", "--write-only"
|
||||||
conflicts "--no-audit", "--strict"
|
conflicts "--no-audit", "--strict"
|
||||||
conflicts "--no-audit", "--online"
|
conflicts "--no-audit", "--online"
|
||||||
conflicts "--url", "--tag"
|
conflicts "--url", "--tag"
|
||||||
|
|
||||||
named_args :named_formula, max: 1, without_api: true
|
named_args :formula, max: 1, without_api: true
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { override.void }
|
sig { override.void }
|
||||||
@ -104,17 +103,18 @@ module Homebrew
|
|||||||
# Use the user's browser, too.
|
# Use the user's browser, too.
|
||||||
ENV["BROWSER"] = Homebrew::EnvConfig.browser
|
ENV["BROWSER"] = Homebrew::EnvConfig.browser
|
||||||
|
|
||||||
named_formula = args.named.to_formulae.first
|
formula = args.named.to_formulae.first
|
||||||
raise FormulaUnspecifiedError if named_formula.blank?
|
new_url = args.url
|
||||||
|
raise FormulaUnspecifiedError if formula.blank?
|
||||||
|
|
||||||
odie "This formula is disabled!" if named_formula.disabled?
|
odie "This formula is disabled!" if formula.disabled?
|
||||||
odie "This formula is deprecated and does not build!" if named_formula.deprecation_reason == :does_not_build
|
odie "This formula is deprecated and does not build!" if formula.deprecation_reason == :does_not_build
|
||||||
tap = named_formula.tap
|
tap = formula.tap
|
||||||
odie "This formula is not in a tap!" if tap.blank?
|
odie "This formula is not in a tap!" if tap.blank?
|
||||||
odie "This formula's tap is not a Git repository!" unless tap.git?
|
odie "This formula's tap is not a Git repository!" unless tap.git?
|
||||||
|
|
||||||
odie <<~EOS unless tap.allow_bump?(named_formula.name)
|
odie <<~EOS unless tap.allow_bump?(formula.name)
|
||||||
Whoops, the #{named_formula.name} formula has its version update
|
Whoops, the #{formula.name} formula has its version update
|
||||||
pull requests automatically opened by BrewTestBot every ~3 hours!
|
pull requests automatically opened by BrewTestBot every ~3 hours!
|
||||||
We'd still love your contributions, though, so try another one
|
We'd still love your contributions, though, so try another one
|
||||||
that's not in the autobump list:
|
that's not in the autobump list:
|
||||||
@ -123,8 +123,8 @@ module Homebrew
|
|||||||
|
|
||||||
odie "You have too many PRs open: close or merge some first!" if GitHub.too_many_open_prs?(tap)
|
odie "You have too many PRs open: close or merge some first!" if GitHub.too_many_open_prs?(tap)
|
||||||
|
|
||||||
named_formula_spec = named_formula.stable
|
formula_spec = formula.stable
|
||||||
odie "#{named_formula}: no stable specification found!" if named_formula_spec.blank?
|
odie "#{formula}: no stable specification found!" if formula_spec.blank?
|
||||||
|
|
||||||
# This will be run by `brew audit` later so run it first to not start
|
# This will be run by `brew audit` later so run it first to not start
|
||||||
# spamming during normal output.
|
# spamming during normal output.
|
||||||
@ -135,29 +135,8 @@ module Homebrew
|
|||||||
remote_branch = tap.git_repository.origin_branch_name
|
remote_branch = tap.git_repository.origin_branch_name
|
||||||
previous_branch = "-"
|
previous_branch = "-"
|
||||||
|
|
||||||
check_pull_requests(named_formula, tap_remote_repo, state: "open")
|
check_pull_requests(formula, tap_remote_repo, state: "open")
|
||||||
|
|
||||||
all_formulae = []
|
|
||||||
if args.bump_synced.present?
|
|
||||||
Array(args.bump_synced).each do |formula_name|
|
|
||||||
all_formulae << formula_name
|
|
||||||
end
|
|
||||||
else
|
|
||||||
all_formulae << args.named.first.to_s
|
|
||||||
end
|
|
||||||
|
|
||||||
return if all_formulae.empty?
|
|
||||||
|
|
||||||
commits = all_formulae.filter_map do |formula_name|
|
|
||||||
formula = Formula[formula_name]
|
|
||||||
raise FormulaUnspecifiedError if formula.blank?
|
|
||||||
|
|
||||||
formula_spec = formula.stable
|
|
||||||
odie "#{formula}: no stable specification found!" if formula_spec.blank?
|
|
||||||
|
|
||||||
formula_pr_message = ""
|
|
||||||
|
|
||||||
new_url = args.url
|
|
||||||
new_version = args.version
|
new_version = args.version
|
||||||
check_new_version(formula, tap_remote_repo, version: new_version) if new_version.present?
|
check_new_version(formula, tap_remote_repo, version: new_version) if new_version.present?
|
||||||
|
|
||||||
@ -213,7 +192,7 @@ module Homebrew
|
|||||||
elsif new_url.blank? && new_version.blank?
|
elsif new_url.blank? && new_version.blank?
|
||||||
raise UsageError, "#{formula}: no `--url` or `--version` argument specified!"
|
raise UsageError, "#{formula}: no `--url` or `--version` argument specified!"
|
||||||
else
|
else
|
||||||
next unless new_version.present?
|
return unless new_version.present?
|
||||||
|
|
||||||
new_url ||= PyPI.update_pypi_url(old_url, new_version)
|
new_url ||= PyPI.update_pypi_url(old_url, new_version)
|
||||||
if new_url.blank?
|
if new_url.blank?
|
||||||
@ -372,10 +351,13 @@ module Homebrew
|
|||||||
version: new_formula_version.to_s
|
version: new_formula_version.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
run_audit(formula, alias_rename, old_contents)
|
||||||
|
|
||||||
|
pr_message = "Created with `brew bump-formula-pr`."
|
||||||
if resources_checked.nil? && formula.resources.any? do |resource|
|
if resources_checked.nil? && formula.resources.any? do |resource|
|
||||||
resource.livecheck.formula != :parent && !resource.name.start_with?("homebrew-")
|
resource.livecheck.formula != :parent && !resource.name.start_with?("homebrew-")
|
||||||
end
|
end
|
||||||
formula_pr_message += <<~EOS
|
pr_message += <<~EOS
|
||||||
|
|
||||||
|
|
||||||
- [ ] `resource` blocks have been checked for updates.
|
- [ ] `resource` blocks have been checked for updates.
|
||||||
@ -395,7 +377,7 @@ module Homebrew
|
|||||||
|
|
||||||
if github_release_data.present?
|
if github_release_data.present?
|
||||||
pre = "pre" if github_release_data["prerelease"].present?
|
pre = "pre" if github_release_data["prerelease"].present?
|
||||||
formula_pr_message += <<~XML
|
pr_message += <<~XML
|
||||||
<details>
|
<details>
|
||||||
<summary>#{pre}release notes</summary>
|
<summary>#{pre}release notes</summary>
|
||||||
<pre>#{github_release_data["body"]}</pre>
|
<pre>#{github_release_data["body"]}</pre>
|
||||||
@ -404,59 +386,14 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
{
|
pr_info = {
|
||||||
sourcefile_path: formula.path,
|
sourcefile_path: formula.path,
|
||||||
old_contents:,
|
old_contents:,
|
||||||
commit_message: "#{formula.name} #{args.version}",
|
|
||||||
additional_files: alias_rename,
|
additional_files: alias_rename,
|
||||||
formula_pr_message:,
|
|
||||||
formula_name: formula.name,
|
|
||||||
new_version: new_formula_version,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
commits.each do |commit|
|
|
||||||
commit_formula = Formula[commit[:formula_name]]
|
|
||||||
# For each formula, run `brew audit` to check for any issues.
|
|
||||||
audit_result = run_audit(commit_formula, commit[:additional_files],
|
|
||||||
skip_synced_versions: args.bump_synced.present?)
|
|
||||||
|
|
||||||
next unless audit_result
|
|
||||||
|
|
||||||
# If `brew audit` fails, revert the changes made to any formula.
|
|
||||||
commits.each do |revert|
|
|
||||||
revert_formula = Formula[revert[:formula_name]]
|
|
||||||
revert_formula.path.atomic_write(revert[:old_contents]) unless args.dry_run?
|
|
||||||
revert_alias_rename = revert[:additional_files]
|
|
||||||
if revert_alias_rename && (source = revert_alias_rename.first) && (destination = revert_alias_rename.last)
|
|
||||||
FileUtils.mv source, destination
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
odie "`brew audit` failed for #{commit[:formula_name]}!"
|
|
||||||
end
|
|
||||||
|
|
||||||
new_formula_version = T.must(commits.first)[:new_version]
|
|
||||||
pr_title = if args.bump_synced.nil?
|
|
||||||
"#{named_formula.name} #{new_formula_version}"
|
|
||||||
else
|
|
||||||
"#{Array(args.bump_synced).join(" ")} #{new_formula_version}"
|
|
||||||
end
|
|
||||||
|
|
||||||
pr_message = "Created by `brew bump-formula-pr`."
|
|
||||||
commits.each do |commit|
|
|
||||||
next if commit[:formula_pr_message].empty?
|
|
||||||
|
|
||||||
pr_message += "<h4>#{commit[:formula_name]}</h4>" if commits.length != 1
|
|
||||||
pr_message += "#{commit[:formula_pr_message]}<hr>"
|
|
||||||
end
|
|
||||||
|
|
||||||
pr_info = {
|
|
||||||
commits:,
|
|
||||||
remote:,
|
remote:,
|
||||||
remote_branch:,
|
remote_branch:,
|
||||||
branch_name: "bump-#{named_formula.name}-#{new_formula_version}",
|
branch_name: "bump-#{formula.name}-#{new_formula_version}",
|
||||||
pr_title:,
|
commit_message: "#{formula.name} #{new_formula_version}",
|
||||||
previous_branch:,
|
previous_branch:,
|
||||||
tap: tap,
|
tap: tap,
|
||||||
tap_remote_repo:,
|
tap_remote_repo:,
|
||||||
@ -667,15 +604,11 @@ module Homebrew
|
|||||||
[versioned_alias, "#{name}@#{new_alias_version}"]
|
[versioned_alias, "#{name}@#{new_alias_version}"]
|
||||||
end
|
end
|
||||||
|
|
||||||
sig {
|
sig { params(formula: Formula, alias_rename: T.nilable(T::Array[String]), old_contents: String).void }
|
||||||
params(formula: Formula, alias_rename: T.nilable(T::Array[String]),
|
def run_audit(formula, alias_rename, old_contents)
|
||||||
skip_synced_versions: T::Boolean).returns(T::Boolean)
|
|
||||||
}
|
|
||||||
def run_audit(formula, alias_rename, skip_synced_versions: false)
|
|
||||||
audit_args = ["--formula"]
|
audit_args = ["--formula"]
|
||||||
audit_args << "--strict" if args.strict?
|
audit_args << "--strict" if args.strict?
|
||||||
audit_args << "--online" if args.online?
|
audit_args << "--online" if args.online?
|
||||||
audit_args << "--except=synced_versions_formulae" if skip_synced_versions
|
|
||||||
if args.dry_run?
|
if args.dry_run?
|
||||||
if args.no_audit?
|
if args.no_audit?
|
||||||
ohai "Skipping `brew audit`"
|
ohai "Skipping `brew audit`"
|
||||||
@ -684,7 +617,7 @@ module Homebrew
|
|||||||
else
|
else
|
||||||
ohai "brew audit #{formula.path.basename}"
|
ohai "brew audit #{formula.path.basename}"
|
||||||
end
|
end
|
||||||
return true
|
return
|
||||||
end
|
end
|
||||||
if alias_rename && (source = alias_rename.first) && (destination = alias_rename.last)
|
if alias_rename && (source = alias_rename.first) && (destination = alias_rename.last)
|
||||||
FileUtils.mv source, destination
|
FileUtils.mv source, destination
|
||||||
@ -699,7 +632,13 @@ module Homebrew
|
|||||||
system HOMEBREW_BREW_FILE, "audit", formula.full_name
|
system HOMEBREW_BREW_FILE, "audit", formula.full_name
|
||||||
failed_audit = !$CHILD_STATUS.success?
|
failed_audit = !$CHILD_STATUS.success?
|
||||||
end
|
end
|
||||||
failed_audit
|
return unless failed_audit
|
||||||
|
|
||||||
|
formula.path.atomic_write(old_contents)
|
||||||
|
if alias_rename && (source = alias_rename.first) && (destination = alias_rename.last)
|
||||||
|
FileUtils.mv source, destination
|
||||||
|
end
|
||||||
|
odie "`brew audit` failed!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -53,8 +53,6 @@ module Homebrew
|
|||||||
description: "Open a pull request for the new version if none have been opened yet."
|
description: "Open a pull request for the new version if none have been opened yet."
|
||||||
flag "--start-with=",
|
flag "--start-with=",
|
||||||
description: "Letter or word that the list of package results should alphabetically follow."
|
description: "Letter or word that the list of package results should alphabetically follow."
|
||||||
switch "--bump-synced",
|
|
||||||
description: "Bump additional formulae marked as synced with the given formulae."
|
|
||||||
|
|
||||||
conflicts "--cask", "--formula"
|
conflicts "--cask", "--formula"
|
||||||
conflicts "--tap=", "--installed"
|
conflicts "--tap=", "--installed"
|
||||||
@ -472,13 +470,11 @@ module Homebrew
|
|||||||
EOS
|
EOS
|
||||||
if formula_or_cask.is_a?(Formula) && formula_or_cask.synced_with_other_formulae?
|
if formula_or_cask.is_a?(Formula) && formula_or_cask.synced_with_other_formulae?
|
||||||
outdated_synced_formulae = synced_with(formula_or_cask, new_version.general)
|
outdated_synced_formulae = synced_with(formula_or_cask, new_version.general)
|
||||||
if !args.bump_synced? && outdated_synced_formulae.present?
|
puts <<~EOS if outdated_synced_formulae.present?
|
||||||
puts <<~EOS
|
|
||||||
Version syncing: #{title_name} version should be kept in sync with
|
Version syncing: #{title_name} version should be kept in sync with
|
||||||
#{outdated_synced_formulae.join(", ")}.
|
#{outdated_synced_formulae.join(", ")}.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if !args.no_pull_requests? &&
|
if !args.no_pull_requests? &&
|
||||||
(new_version.general != "unable to get versions") &&
|
(new_version.general != "unable to get versions") &&
|
||||||
!versions_equal
|
!versions_equal
|
||||||
@ -523,7 +519,7 @@ module Homebrew
|
|||||||
"--version=#{new_version.general}"
|
"--version=#{new_version.general}"
|
||||||
end
|
end
|
||||||
|
|
||||||
bump_pr_args = [
|
bump_cask_pr_args = [
|
||||||
"bump-#{version_info.type}-pr",
|
"bump-#{version_info.type}-pr",
|
||||||
name,
|
name,
|
||||||
*version_args,
|
*version_args,
|
||||||
@ -531,13 +527,9 @@ module Homebrew
|
|||||||
"--message=Created by `brew bump`",
|
"--message=Created by `brew bump`",
|
||||||
]
|
]
|
||||||
|
|
||||||
bump_pr_args << "--no-fork" if args.no_fork?
|
bump_cask_pr_args << "--no-fork" if args.no_fork?
|
||||||
|
|
||||||
if args.bump_synced? && outdated_synced_formulae.present?
|
system HOMEBREW_BREW_FILE, *bump_cask_pr_args
|
||||||
bump_pr_args << "--bump-synced=#{outdated_synced_formulae.join(",")}"
|
|
||||||
end
|
|
||||||
|
|
||||||
system HOMEBREW_BREW_FILE, *bump_pr_args
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sig {
|
sig {
|
||||||
|
@ -14,9 +14,6 @@ class Homebrew::DevCmd::Bump::Args < Homebrew::CLI::Args
|
|||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def auto?; end
|
def auto?; end
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
|
||||||
def bump_synced?; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def cask?; end
|
def cask?; end
|
||||||
|
|
||||||
|
@ -11,9 +11,6 @@ class Homebrew::DevCmd::BumpFormulaPr
|
|||||||
end
|
end
|
||||||
|
|
||||||
class Homebrew::DevCmd::BumpFormulaPr::Args < Homebrew::CLI::Args
|
class Homebrew::DevCmd::BumpFormulaPr::Args < Homebrew::CLI::Args
|
||||||
sig { returns(T.nilable(String)) }
|
|
||||||
def bump_synced; end
|
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def commit?; end
|
def commit?; end
|
||||||
|
|
||||||
|
@ -706,49 +706,16 @@ module GitHub
|
|||||||
|
|
||||||
def self.create_bump_pr(info, args:)
|
def self.create_bump_pr(info, args:)
|
||||||
tap = info[:tap]
|
tap = info[:tap]
|
||||||
|
sourcefile_path = info[:sourcefile_path]
|
||||||
|
old_contents = info[:old_contents]
|
||||||
|
additional_files = info[:additional_files] || []
|
||||||
remote = info[:remote] || "origin"
|
remote = info[:remote] || "origin"
|
||||||
remote_branch = info[:remote_branch] || tap.git_repository.origin_branch_name
|
remote_branch = info[:remote_branch] || tap.git_repository.origin_branch_name
|
||||||
branch = info[:branch_name]
|
branch = info[:branch_name]
|
||||||
|
commit_message = info[:commit_message]
|
||||||
previous_branch = info[:previous_branch] || "-"
|
previous_branch = info[:previous_branch] || "-"
|
||||||
tap_remote_repo = info[:tap_remote_repo] || tap.full_name
|
tap_remote_repo = info[:tap_remote_repo] || tap.full_name
|
||||||
pr_message = info[:pr_message]
|
pr_message = info[:pr_message]
|
||||||
pr_title = info[:pr_title]
|
|
||||||
|
|
||||||
commits = info[:commits]
|
|
||||||
username = tap.user
|
|
||||||
|
|
||||||
remote_url = Utils.popen_read("git", "remote", "get-url", "--push", "origin").chomp
|
|
||||||
|
|
||||||
tap.path.cd do
|
|
||||||
require "utils/popen"
|
|
||||||
git_dir = Utils.popen_read("git", "rev-parse", "--git-dir").chomp
|
|
||||||
shallow = !git_dir.empty? && File.exist?("#{git_dir}/shallow")
|
|
||||||
unless args.commit?
|
|
||||||
if args.no_fork?
|
|
||||||
remote_url = Utils.popen_read("git", "remote", "get-url", "--push", "origin").chomp
|
|
||||||
add_auth_token_to_url!(remote_url)
|
|
||||||
username = tap.user
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
forked_repo_info!(tap_remote_repo, org: args.fork_org)
|
|
||||||
rescue *API::ERRORS => e
|
|
||||||
commits.each do |commit|
|
|
||||||
commit[:sourcefile_path].atomic_write(commit[:old_contents])
|
|
||||||
end
|
|
||||||
odie "Unable to fork: #{e.message}!"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
safe_system "git", "fetch", "--unshallow", "origin" if shallow
|
|
||||||
end
|
|
||||||
safe_system "git", "checkout", "--no-track", "-b", branch, "#{remote}/#{remote_branch}" unless args.commit?
|
|
||||||
Utils::Git.set_name_email!
|
|
||||||
end
|
|
||||||
|
|
||||||
commits.each do |commit|
|
|
||||||
sourcefile_path = commit[:sourcefile_path]
|
|
||||||
commit_message = commit[:commit_message]
|
|
||||||
additional_files = commit[:additional_files] || []
|
|
||||||
|
|
||||||
sourcefile_path.parent.cd do
|
sourcefile_path.parent.cd do
|
||||||
require "utils/popen"
|
require "utils/popen"
|
||||||
@ -766,27 +733,41 @@ module GitHub
|
|||||||
ohai fork_message
|
ohai fork_message
|
||||||
"FORK_URL"
|
"FORK_URL"
|
||||||
end
|
end
|
||||||
ohai "git checkout --no-track -b #{branch} #{remote}/#{remote_branch}"
|
|
||||||
ohai "git fetch --unshallow origin" if shallow
|
ohai "git fetch --unshallow origin" if shallow
|
||||||
ohai "git add #{changed_files.join(" ")}"
|
ohai "git add #{changed_files.join(" ")}"
|
||||||
|
ohai "git checkout --no-track -b #{branch} #{remote}/#{remote_branch}"
|
||||||
ohai "git commit --no-edit --verbose --message='#{commit_message}' " \
|
ohai "git commit --no-edit --verbose --message='#{commit_message}' " \
|
||||||
"-- #{changed_files.join(" ")}"
|
"-- #{changed_files.join(" ")}"
|
||||||
ohai "git push --set-upstream #{remote_url} #{branch}:#{branch}"
|
ohai "git push --set-upstream #{remote_url} #{branch}:#{branch}"
|
||||||
ohai "git checkout --quiet #{previous_branch}"
|
ohai "git checkout --quiet #{previous_branch}"
|
||||||
ohai "create pull request with GitHub API (base branch: #{remote_branch})"
|
ohai "create pull request with GitHub API (base branch: #{remote_branch})"
|
||||||
else
|
else
|
||||||
|
|
||||||
|
unless args.commit?
|
||||||
|
if args.no_fork?
|
||||||
|
remote_url = Utils.popen_read("git", "remote", "get-url", "--push", "origin").chomp
|
||||||
|
add_auth_token_to_url!(remote_url)
|
||||||
|
username = tap.user
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
remote_url, username = forked_repo_info!(tap_remote_repo, org: args.fork_org)
|
||||||
|
rescue *API::ERRORS => e
|
||||||
|
sourcefile_path.atomic_write(old_contents)
|
||||||
|
odie "Unable to fork: #{e.message}!"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
safe_system "git", "fetch", "--unshallow", "origin" if shallow
|
||||||
|
end
|
||||||
|
|
||||||
safe_system "git", "add", *changed_files
|
safe_system "git", "add", *changed_files
|
||||||
|
safe_system "git", "checkout", "--no-track", "-b", branch, "#{remote}/#{remote_branch}" unless args.commit?
|
||||||
Utils::Git.set_name_email!
|
Utils::Git.set_name_email!
|
||||||
safe_system "git", "commit", "--no-edit", "--verbose",
|
safe_system "git", "commit", "--no-edit", "--verbose",
|
||||||
"--message=#{commit_message}",
|
"--message=#{commit_message}",
|
||||||
"--", *changed_files
|
"--", *changed_files
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return if args.commit?
|
return if args.commit?
|
||||||
|
|
||||||
tap.path.cd do
|
|
||||||
system_command!("git", args: ["push", "--set-upstream", remote_url, "#{branch}:#{branch}"],
|
system_command!("git", args: ["push", "--set-upstream", remote_url, "#{branch}:#{branch}"],
|
||||||
print_stdout: true)
|
print_stdout: true)
|
||||||
safe_system "git", "checkout", "--quiet", previous_branch
|
safe_system "git", "checkout", "--quiet", previous_branch
|
||||||
@ -805,7 +786,7 @@ module GitHub
|
|||||||
end
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
url = create_pull_request(tap_remote_repo, pr_title,
|
url = create_pull_request(tap_remote_repo, commit_message,
|
||||||
"#{username}:#{branch}", remote_branch, pr_message)["html_url"]
|
"#{username}:#{branch}", remote_branch, pr_message)["html_url"]
|
||||||
if args.no_browse?
|
if args.no_browse?
|
||||||
puts url
|
puts url
|
||||||
@ -813,13 +794,11 @@ module GitHub
|
|||||||
exec_browser url
|
exec_browser url
|
||||||
end
|
end
|
||||||
rescue *API::ERRORS => e
|
rescue *API::ERRORS => e
|
||||||
commits.each do |commit|
|
|
||||||
commit[:sourcefile_path].atomic_write(commit[:old_contents])
|
|
||||||
end
|
|
||||||
odie "Unable to open pull request: #{e.message}!"
|
odie "Unable to open pull request: #{e.message}!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def self.pull_request_commits(user, repo, pull_request, per_page: 100)
|
def self.pull_request_commits(user, repo, pull_request, per_page: 100)
|
||||||
pr_data = API.open_rest(url_to("repos", user, repo, "pulls", pull_request))
|
pr_data = API.open_rest(url_to("repos", user, repo, "pulls", pull_request))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user