Class: Cerberus::SCM::Mercurial
Instance Method Summary collapse
- #current_revision ⇒ Object
- #has_changes? ⇒ Boolean
- #installed? ⇒ Boolean
- #last_author ⇒ Object
- #last_commit_message ⇒ Object
- #new? ⇒ Boolean
- #output ⇒ Object
- #update! ⇒ Object
Methods inherited from Base
Constructor Details
This class inherits a constructor from Cerberus::SCM::Base
Instance Method Details
#current_revision ⇒ Object
39 40 41 |
# File 'lib/cerberus/scm/hg.rb', line 39 def current_revision @revision end |
#has_changes? ⇒ Boolean
30 31 32 |
# File 'lib/cerberus/scm/hg.rb', line 30 def has_changes? @has_changes end |
#installed? ⇒ Boolean
6 7 8 |
# File 'lib/cerberus/scm/hg.rb', line 6 def installed? exec_successful? "#{@config[:bin_path]}hg --version" end |
#last_author ⇒ Object
47 48 49 |
# File 'lib/cerberus/scm/hg.rb', line 47 def @author end |
#last_commit_message ⇒ Object
43 44 45 |
# File 'lib/cerberus/scm/hg.rb', line 43 def @message end |
#new? ⇒ Boolean
35 36 37 |
# File 'lib/cerberus/scm/hg.rb', line 35 def new? @new end |
#output ⇒ Object
51 52 53 |
# File 'lib/cerberus/scm/hg.rb', line 51 def output @status end |
#update! ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cerberus/scm/hg.rb', line 10 def update! @new =false if test( ?d, File.join( @path,'.hg' ) ) r = get_localrev get_updates r_new = get_localrev @has_changes = r_new !=r else FileUtils.rm_rf(@path) if test(?d, @path) encoded_url = (@config[:scm, :url].include?(' ') ? "\"#{@config[:scm, :url]}\"" : @config[:scm, :url]) @new = true @has_changes = true @status = execute("clone", "#{encoded_url} #{@path}", false) if branch = @config[:scm, :branch] execute('update', "-C #{branch}") end end extract_commit_info if @has_changes end |