def self.execAction(opts, action)
repo = Repo::load()
travis = TravisChecker::load(repo)
if NO_FETCH_ACTIONS.index(action) == nil && opts[:no_fetch] == false then
repo.stableUpdate()
end
branchList=[]
if opts[:manual_branch] == nil then
unfilteredList = nil
if ALL_BRANCHES_ACTIONS.index(action) != nil then
unfilteredList = repo.getStableBranchList()
else
unfilteredList = repo.getBranchList(opts[:br_suff])
end
branchList = unfilteredList.map(){|br|
branch = Branch::load(repo, br, travis, opts[:br_suff])
case branch.is_targetted?(opts)
when :too_old
GitMaintain::log(:VERBOSE, "Skipping older v#{branch.version}")
next
when :no_match
GitMaintain::log(:VERBOSE, "Skipping v#{branch.version} not matching" +
opts[:version].to_s())
next
end
branch
}.compact()
else
branchList = [ Branch::load(repo, opts[:manual_branch], travis, opts[:br_suff]) ]
end
loop do
system("clear; date") if opts[:watch] != false
branchList.each(){|branch|
if NO_CHECKOUT_ACTIONS.index(action) == nil then
GitMaintain::log(:INFO, "Working on #{branch.verbose_name}")
branch.checkout()
end
branch.send(action, opts)
}
break if opts[:watch] == false
sleep(opts[:watch])
travis.emptyCache()
end
end