Sha256: 04acc72a7d8ccbd2890a255d85148aa0daa0812f818271efe11628c5c2cadf4d

Contents?: true

Size: 739 Bytes

Versions: 25

Compression:

Stored size: 739 Bytes

Contents

command :heads do |c|
  c.desc "Prints the heads of the repository."
  c.add_opt :rev, "show only heads which are descendants of rev", {:short => "-r"}
  c.add_opt :active, "show only active heads", {:short => "-a"}
  c.add_opt :template, "Which template to use while printing", {:short => "-t", :type => :string, :default => "default"}
  c.on_run do |options, args|
    repo   = options[:repository]
    start  = options[:rev] ? repo.lookup(options[:rev]) : nil
    closed = options[:active]
    if args.size == 0
      heads = repo.heads(start, :closed => closed)
    else
      #branch shit
    end
    
    options.merge!({:template_type => :log})
    heads.each do |n|
      puts repo[n].to_templated_s(options)
    end
    
  end
end

Version data entries

25 entries across 5 versions & 2 rubygems

Version Path
amp-0.5.3 test/functional_tests/resources/commands/heads.rb
amp-0.5.3 test/functional_tests/resources/version5_1/commands/heads.rb
amp-0.5.3 test/functional_tests/resources/version4/commands/heads.rb
amp-0.5.3 test/functional_tests/resources/version3/commands/heads.rb
amp-0.5.3 test/functional_tests/resources/version2/commands/heads.rb
amp-0.5.2 test/functional_tests/resources/version5_1/commands/heads.rb
amp-0.5.2 test/functional_tests/resources/commands/heads.rb
amp-0.5.2 test/functional_tests/resources/version2/commands/heads.rb
amp-0.5.2 test/functional_tests/resources/version3/commands/heads.rb
amp-0.5.2 test/functional_tests/resources/version4/commands/heads.rb
amp-0.5.1 test/functional_tests/resources/commands/heads.rb
amp-0.5.1 test/functional_tests/resources/version2/commands/heads.rb
amp-0.5.1 test/functional_tests/resources/version3/commands/heads.rb
amp-0.5.1 test/functional_tests/resources/version4/commands/heads.rb
amp-0.5.1 test/functional_tests/resources/version5_1/commands/heads.rb
amp-pure-0.5.0 test/functional_tests/resources/version5_1/commands/heads.rb
amp-pure-0.5.0 test/functional_tests/resources/commands/heads.rb
amp-pure-0.5.0 test/functional_tests/resources/version2/commands/heads.rb
amp-pure-0.5.0 test/functional_tests/resources/version3/commands/heads.rb
amp-pure-0.5.0 test/functional_tests/resources/version4/commands/heads.rb