Class: Buildr::HgRelease
Constant Summary
Constants inherited from Release
Class Method Summary collapse
Instance Method Summary collapse
-
#check ⇒ Object
Fails if one of these 2 conditions are not met: 1.
-
#tag_release(tag) ⇒ Object
Tag this release in Mercurial.
-
#update_version_to_next ⇒ Object
Update buildfile with next version number.
Methods inherited from Release
add, #extract_version, find, list, #make, #tag_name=
Class Method Details
.applies_to? ⇒ Boolean
460 461 462 463 464 465 466 467 468 469 470 |
# File 'lib/buildr/core/build.rb', line 460 def applies_to? if File.exist? '.hg/requires' true else curr_pwd = Dir.pwd Dir.chdir('..') do return false if curr_pwd == Dir.pwd # Means going up one level is not possible. applies_to? end end end |
Instance Method Details
#check ⇒ Object
Fails if one of these 2 conditions are not met:
1. The reository is not 'clean'; no content staged or unstaged
2. The repository is only a local repository and has no remote refs
476 477 478 479 480 481 482 |
# File 'lib/buildr/core/build.rb', line 476 def check super info "Working in branch '#{Hg.current_branch}'" uncommitted = Hg.uncommitted_files fail "Uncommitted files violate the First Principle Of Release!\n#{uncommitted.join("\n")}" unless uncommitted.empty? fail "You are releasing from a local branch that does not track a remote!" if Hg.remote.empty? end |
#tag_release(tag) ⇒ Object
Tag this release in Mercurial
485 486 487 488 489 490 491 492 493 494 |
# File 'lib/buildr/core/build.rb', line 485 def tag_release(tag) unless this_version == extract_version info "Committing buildfile with version number #{extract_version}" Hg.commit File.basename(version_file), Hg.push if Hg.remote end info "Tagging release #{tag}" Hg.hg 'tag', tag, '-m', "[buildr] Cutting release #{tag}" Hg.push if Hg.remote end |