Class: Braid::Operations::GitSvn

Inherits:
Proxy
  • Object
show all
Defined in:
lib/braid/operations.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Proxy

#require_version, #require_version!, #version

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Braid::Operations::Proxy

Class Method Details

.commandObject



324
325
326
# File 'lib/braid/operations.rb', line 324

def self.command;
  "git svn";
end

Instance Method Details

#commit_hash(remote, revision) ⇒ Object

Raises:



328
329
330
331
332
333
334
# File 'lib/braid/operations.rb', line 328

def commit_hash(remote, revision)
  out  = invoke(:log, "--show-commit --oneline", "-r #{revision}", remote)
  part = out.to_s.split("|")[1]
  part.strip!
  raise UnknownRevision, "r#{revision}" unless part
  git.rev_parse(part)
end

#fetch(remote) ⇒ Object



336
337
338
# File 'lib/braid/operations.rb', line 336

def fetch(remote)
  sh("git svn fetch #{remote} 2>&1 >/dev/null")
end

#init(remote, path) ⇒ Object



340
341
342
343
# File 'lib/braid/operations.rb', line 340

def init(remote, path)
  invoke(:init, "-R", remote, "--id=#{remote}", path)
  true
end