summaryrefslogtreecommitdiff
path: root/tool/vcs.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-07 03:25:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-07 03:25:28 +0000
commit2fa7cd751e6128733302dd91e06e91a460326a6a (patch)
tree8774d8516eeaf948bbbf606d205a534218fe4156 /tool/vcs.rb
parent4201000a7ceeed6285a0c9b712cf64515cb86fe8 (diff)
vcs.rb: exclude beginning revision
* tool/make-snapshot: pass the last revision in the last ChangeLog file without increment. * tool/vcs.rb (export_changelog): exclude the beginning revision of the range uniformly. svn log includes it, but git log not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/vcs.rb')
-rw-r--r--tool/vcs.rb19
1 files changed, 11 insertions, 8 deletions
diff --git a/tool/vcs.rb b/tool/vcs.rb
index fd56b42eca..5ef77e424d 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -306,8 +306,9 @@ class VCS
end
def export_changelog(from, to, path)
+ range = [to, (from+1 if from)].compact.join(':')
IO.popen({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'},
- %W"svn log -r#{to}:#{from} #{url}") do |r|
+ %W"svn log -r#{range} #{url}") do |r|
open(path, 'w') do |w|
IO.copy_stream(r, w)
end
@@ -390,14 +391,16 @@ class VCS
end
def export_changelog(from, to, path)
- from = IO.pread(%W"git log -n1 --format=format:%H" +
- ["--grep=^ *git-svn-id: .*@#{from} "],
- :chdir => @abs_srcdir)
- to &&= IO.pread(%W"git log -n1 --format=format:%H" +
- ["--grep=^ *git-svn-id: .*@#{to} "],
- :chdir => @abs_srcdir)
+ range = [from, to].map do |rev|
+ rev or next
+ rev = IO.pread({'LANG' => 'C', 'LC_ALL' => 'C'},
+ %W"git log -n1 --format=format:%H" <<
+ "--grep=^ *git-svn-id: .*@#{rev} ",
+ :chdir => @abs_srcdir)
+ rev unless rev.empty?
+ end.join('..')
IO.popen({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'},
- %W"git log --date=iso-local --topo-order #{from}..#{to}",
+ %W"git svn log --date=iso-local --topo-order #{range}",
:chdir => @abs_srcdir) do |r|
open(path, 'w') do |w|
IO.copy_stream(r, w)