Sha256: 1bb10ec314fc35aa66a4e8999004923877815bde1a40dca7614d7d54f7119979

Contents?: true

Size: 712 Bytes

Versions: 5

Compression:

Stored size: 712 Bytes

Contents

command "tags" do |c|
  c.workflow :hg
  
  c.desc "Lists the repository tags."
  c.opt :quiet, "Prints only tag names", :short => "-q"
  
  c.on_run do |opts, args|
    repo = opts[:repository]
    list = repo.tag_list
    list.reverse!
    tag_type = ""
    list.each do |entry|
      tag, node, revision = entry[:tag], entry[:node], entry[:revision]
      if opts[:quiet]
        Amp::UI.say "#{tag}"
        next
      end
      if revision == -2
        revision = repo.changelog.rev(node)
      end
      text = "#{revision.to_s.rjust(5)}:#{node.short_hex}"
      tag_type = (repo.tag_type(tag) == "local") ? " local" : ""
      
      Amp::UI.say("#{tag.ljust(30)} #{text}#{tag_type}")  
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
amp-0.5.3 lib/amp/commands/commands/workflows/hg/tags.rb
amp-0.5.2 lib/amp/commands/commands/workflows/hg/tags.rb
amp-0.5.1 lib/amp/commands/commands/workflows/hg/tags.rb
amp-pure-0.5.0 lib/amp/commands/commands/workflows/hg/tags.rb
amp-0.5.0 lib/amp/commands/commands/workflows/hg/tags.rb