summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-07-14 16:56:39 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-07-14 21:53:18 +0900
commitbe082e28003543eff5ff07cf5261dbf7b6278a50 (patch)
treeae3fd0bf21e1a2d3ee21f75091b5ad34efc8e25a /tool
parentd8cc41c43be65dd4b17e7a6e38f5a7fdf2b247d6 (diff)
Try to sync with commit history for default gems.
Diffstat (limited to 'tool')
-rw-r--r--tool/sync_default_gems.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 34cdfaedee..9d3089250a 100644
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -228,6 +228,17 @@ def sync_default_gems(gem)
end
end
+def sync_default_gems_with_commits(gem, range)
+ puts "Sync #{$repositories[gem.to_sym]} with commit history."
+
+ IO.popen(%W"git remote") do |f|
+ unless f.read.split.include?(gem)
+ `git remote add #{gem} git@github.com:#{$repositories[gem.to_sym]}.git`
+ `git fetch #{gem}`
+ end
+ end
+end
+
def sync_lib(repo)
unless File.directory?("../#{repo}")
abort "Expected '../#{repo}' (#{File.expand_path("../#{repo}")}) to be a directory, but it wasn't."
@@ -278,5 +289,9 @@ when "up"
when "all"
$repositories.keys.each{|gem| sync_default_gems(gem.to_s)}
else
- sync_default_gems(ARGV[0])
+ if ARGV[1]
+ sync_default_gems_with_commits(ARGV[0], ARGV[1])
+ else
+ sync_default_gems(ARGV[0])
+ end
end