Class: Churn::HgAnalyzer
Overview
analizes Hg / Mercurial SCM to find recently changed files, and what lines have been altered
Class Method Summary
collapse
Instance Method Summary
collapse
#get_updated_files_change_info, #get_updated_files_from_log, #initialize, set_source_control
Class Method Details
.supported? ⇒ Boolean
6
7
8
|
# File 'lib/churn/scm/hg_analyzer.rb', line 6
def self.supported?
!!(`hg branch 2>&1` && $?.success?)
end
|
Instance Method Details
#generate_history(starting_point) ⇒ Object
18
19
20
|
# File 'lib/churn/scm/hg_analyzer.rb', line 18
def generate_history(starting_point)
raise "currently the generate history option does not support mercurial"
end
|
#get_logs ⇒ Object
10
11
12
|
# File 'lib/churn/scm/hg_analyzer.rb', line 10
def get_logs
`hg log -v#{date_range}`.split("\n").reject{|line| line !~ /^files:/}.map{|line| line.split(" ")[1..-1]}.flatten
end
|
#get_revisions ⇒ Object
14
15
16
|
# File 'lib/churn/scm/hg_analyzer.rb', line 14
def get_revisions
`hg log#{date_range}`.split("\n").reject{|line| line !~ /^changeset:/}.map{|line| line[/:(\S+)$/, 1] }
end
|