Merge branch 'release/1.3.9'

This commit is contained in:
Petr Korolev 2015-03-06 16:47:30 +02:00
commit a35d08f6c7
5 changed files with 45 additions and 33 deletions

View File

@ -139,7 +139,7 @@ Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Ch
### Projects using this library ### Projects using this library
[Wikipage with list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) [Wikipage with list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator)
*If you are using `github_changelog_generator` for generation change log in your project or know of project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.* *If you are using `github_changelog_generator` for generation change log in your project or know another project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.*
## Am I missed some essential feature? ## Am I missed some essential feature?

View File

@ -2,16 +2,28 @@
## [Unreleased](https://github.com/skywinder/changelog_test/tree/HEAD) ## [Unreleased](https://github.com/skywinder/changelog_test/tree/HEAD)
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.2...HEAD) [Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.3...HEAD)
**Merged pull requests:** **Merged pull requests:**
- Here is a test hotfix should appear in v.0.0.2 [\#2](https://github.com/skywinder/changelog_test/pull/2) ([skywinder](https://github.com/skywinder)) - Add automatically generated change log file. [\#5](https://github.com/skywinder/changelog_test/pull/5) ([skywinder](https://github.com/skywinder))
## [v0.0.3](https://github.com/skywinder/changelog_test/tree/v0.0.3) (2015-03-04)
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.2...v0.0.3)
**Merged pull requests:**
- fix \#3. hotfix. Should appear in v0.0.3 [\#4](https://github.com/skywinder/changelog_test/pull/4) ([skywinder](https://github.com/skywinder))
## [v0.0.2](https://github.com/skywinder/changelog_test/tree/v0.0.2) (2015-03-04) ## [v0.0.2](https://github.com/skywinder/changelog_test/tree/v0.0.2) (2015-03-04)
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.1...v0.0.2) [Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.1...v0.0.2)
**Merged pull requests:**
- Here is a test hotfix should appear in v.0.0.2 [\#2](https://github.com/skywinder/changelog_test/pull/2) ([skywinder](https://github.com/skywinder))
## [v0.0.1](https://github.com/skywinder/changelog_test/tree/v0.0.1) (2015-03-02) ## [v0.0.1](https://github.com/skywinder/changelog_test/tree/v0.0.1) (2015-03-02)

View File

@ -593,11 +593,23 @@ module GitHubChangelogGenerator
end end
# Async fetching events: # Async fetching events:
threads = []
fetch_events_async(@issues + @pull_requests)
#to clear line from prev print
print " \r"
if @options[:verbose]
puts 'Fetching events for issues and PR: Done!'
end
end
def fetch_events_async(issues)
i = 0 i = 0
max_thread_number = 50
@issues.each { |issue| threads = []
issues.each_slice(max_thread_number) { |issues_slice|
issues_slice.each { |issue|
threads << Thread.new { threads << Thread.new {
obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: issue['number'] obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: issue['number']
issue[:events] = obj.body issue[:events] = obj.body
@ -605,24 +617,9 @@ module GitHubChangelogGenerator
i +=1 i +=1
} }
} }
@pull_requests.each { |pull_request|
threads << Thread.new {
obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: pull_request['number']
pull_request[:events] = obj.body
print "Fetching events for issues and PR: #{i+1}/#{@issues.count + @pull_requests.count}\r"
i +=1
}
}
threads.each { |thr| thr.join } threads.each { |thr| thr.join }
threads = []
#to clear line from prev print }
print " \r"
if @options[:verbose]
puts "Fetching events for issues and PR: Done! #{i}/#{@issues.count + @pull_requests.count}"
end
end end
end end

View File

@ -129,17 +129,20 @@ module GitHubChangelogGenerator
end end
if !options[:user] && !options[:project] if !options[:user] && !options[:project]
remote = `git remote -vv`.split("\n") remote = `git config --get remote.#{options[:branch]}.url`
# try to find repo in format: origin git@github.com:skywinder/Github-Changelog-Generator.git (fetch) # try to find repo in format:
remote.select { |v| v.include? options[:branch] } # origin git@github.com:skywinder/Github-Changelog-Generator.git (fetch)
match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)(?:\.git).*/.match(remote[0]) # git@github.com:skywinder/Github-Changelog-Generator.git
match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)(?:\.git).*/.match(remote)
if match && match[1] && match[2] if match && match[1] && match[2]
puts "Detected user:#{match[1]}, project:#{match[2]}" puts "Detected user:#{match[1]}, project:#{match[2]}"
options[:user], options[:project] = match[1], match[2] options[:user], options[:project] = match[1], match[2]
else else
# try to find repo in format: origin https://github.com/skywinder/ChangelogMerger (fetch) # try to find repo in format:
match = /.*\/((?:-|\w|\.)*)\/((?:-|\w|\.)*).*/.match(remote[0]) # origin https://github.com/skywinder/ChangelogMerger (fetch)
# https://github.com/skywinder/ChangelogMerger
match = /.*\/((?:-|\w|\.)*)\/((?:-|\w|\.)*).*/.match(remote)
if match && match[1] && match[2] if match && match[1] && match[2]
puts "Detected user:#{match[1]}, project:#{match[2]}" puts "Detected user:#{match[1]}, project:#{match[2]}"
options[:user], options[:project] = match[1], match[2] options[:user], options[:project] = match[1], match[2]

View File

@ -1,3 +1,3 @@
module GitHubChangelogGenerator module GitHubChangelogGenerator
VERSION = '1.3.8' VERSION = '1.3.9'
end end