Class: Braid::Operations::Svn

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

Instance Method Summary collapse

Methods inherited from Proxy

command, #require_version, #require_version!, #version

Dynamic Method Handling

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

Instance Method Details

#clean_revision(revision) ⇒ Object



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

def clean_revision(revision)
  revision.to_i if revision
end

#head_revision(path) ⇒ Object



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

def head_revision(path)
  # not using svn info because it's retarded and doesn't show the actual last changed rev for the url
  # git svn has no clue on how to get the actual HEAD revision number on it's own
  status, out, err = exec!("svn log -q --limit 1 #{path}")
  out.split(/\n/).find { |x| x.match /^r\d+/ }.split(" | ")[0][1..-1].to_i
end