require 'build-tool/commands' require 'build-tool/recipe' require 'mj/vcs/git' module BuildTool; module Commands; module Recipes # # BuildCommand # class Incoming < Standard name "incoming" description "Show the incoming changes to the recipe from the repository." def applicable? BuildTool::Application.instance.name != "build-tool" end def initialize_options @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname}" @options.separator "Options:" @rebase = false @fetch = false options.on( "-f", "--[no-]fetch", "Fetch from origin." ) { |t| @fetch = t } options.on( "-r", "--[no-]rebase", "Rebase against master." ) { |t| @rebase = t } super end def do_execute( args ) if ( args.length != 0 ) return usage("No arguments expected") end recipe = BuildTool::Application::instance.recipe repo = MJ::VCS::Git::Repository.new(recipe.global_path, $noop) if @fetch say "Fetching" repo.fetch("origin") end repo.log("HEAD..origin/master").each do |line| say line end if @rebase say "Rebasing" repo.rebase("master") end return 0 end end # class end; end # module Commands::Recipes end; # module BuildTool