Use local repository instead of remote

to improve performance
This commit is contained in:
NARUSE, Yui 2021-02-02 19:14:37 +09:00
parent ce2062dee6
commit d29cb56bfa

View File

@ -244,6 +244,11 @@ def find_git_log(pattern)
`git #{RUBY_REPO_PATH ? "-C #{RUBY_REPO_PATH.shellescape}" : ""} log --grep="#{pattern}"` `git #{RUBY_REPO_PATH ? "-C #{RUBY_REPO_PATH.shellescape}" : ""} log --grep="#{pattern}"`
end end
def has_commit(commit, branch)
base = RUBY_REPO_PATH ? ["-C", RUBY_REPO_PATH.shellescape] : nil
system("git", *base, "merge-base", "--is-ancestor", commit, branch)
end
def show_last_journal(http, uri) def show_last_journal(http, uri)
res = http.get("#{uri.path}?include=journals") res = http.get("#{uri.path}?include=journals")
res.value res.value
@ -269,14 +274,8 @@ def backport_command_string
@changesets = @changesets.select do |c| @changesets = @changesets.select do |c|
next false if c.match(/\A\d{1,6}\z/) # skip SVN revision next false if c.match(/\A\d{1,6}\z/) # skip SVN revision
# check if the Git revision is included in trunk # check if the Git revision is included in master
begin has_commit(c, "master")
uri = URI("#{REDMINE_BASE}/projects/ruby-master/repository/git/revisions/#{c}")
uri.read($openuri_options)
true
rescue
false
end
end end
@changesets.define_singleton_method(:validated){true} @changesets.define_singleton_method(:validated){true}
end end