Class: SvnAuto::Checkout

Inherits:
Command show all
Defined in:
lib/svnauto/commands/checkout.rb

Constant Summary

Constants inherited from Command

SvnAuto::Command::VALID_SET_KEYS

Instance Method Summary collapse

Methods inherited from Command

commands, force?, inherited, options, reset!

Instance Method Details

#run(project, args) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/svnauto/commands/checkout.rb', line 52

def run (project, args)
  what = 
    case
    when opthash[:co_bug]
      project.branches("bug/#{opthash[:co_bug]}")
    when opthash[:co_exp]
      opthash[:prefix] ||= 'exp'
      project.branches("#{opthash[:prefix]}/#{opthash[:co_exp]}")
    when opthash[:co_release]
      opthash[:co_release]
    else
      nil
    end

  Constants::TERMINAL.say("Checked out to: " + 
    Constants::TERMINAL.color(Path.relative_to_home(project.checkout(what)), :green))
end