Sha256: 9661def8f52bc73d7535fa8f1ca9906adecdef813b19bdd44d1cf55708028911
Contents?: true
Size: 1.56 KB
Versions: 12
Compression:
Stored size: 1.56 KB
Contents
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.has_recipe? 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
Version data entries
12 entries across 12 versions & 1 rubygems