class Churn::HgAnalyzer

analizes Hg / Mercurial SCM to find recently changed files, and what lines have been altered

Public Class Methods

supported?() click to toggle source
# File lib/churn/scm/hg_analyzer.rb, line 6
def self.supported?
  !!(%xhg branch 2>&1` && $?.success?)
end

Public Instance Methods

get_logs() click to toggle source
# File lib/churn/scm/hg_analyzer.rb, line 10
def get_logs
  %xhg log -v#{date_range}`.split("\n").reject{|line| line !~ /^files:/}.map{|line| line.split(" ")[1..-1]}.flatten
end
get_revisions() click to toggle source
# File lib/churn/scm/hg_analyzer.rb, line 14
def get_revisions
  %xhg log#{date_range}`.split("\n").reject{|line| line !~ /^changeset:/}.map{|line| line[/:(\S+)$/, 1] }
end