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



357
358
359
# File 'lib/braid/operations.rb', line 357

def clean_revision(revision)
  revision.to_i if revision
end

#head_revision(path) ⇒ Object



361
362
363
364
365
366
# File 'lib/braid/operations.rb', line 361

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