Source

ruby-hglib /

Filename Size Date modified Message
extra/sample_app
lib
test
110 B
90 B
677 B
3.0 KB
915 B

Ruby interface to Mercurial

Hglib provides a handy way to communicate with Mercurial VCS.

It uses command server protocol in order to reduce the overhead of the command execution.

Usage

require 'hglib'

# configure hg executable (optional)
Hglib.configure do
  set :hg_root, '/usr/bin/hg'
end

Hglib.open '/path/to/repo' do |hg|

  # prints revision numbers
  hg.log do |cs|
    puts cs.rev
  end

  # If no block given, returns result as array
  rev5 = hg.log(:rev => 5).first

end  # invokes hg.close