Methods
A
B
E
G
S
T
Constants
Branch = Struct.new(:to_str)
 
Class Public methods
get_revisions(path, srcdir = nil)
# File tool/vcs.rb, line 285
def self.get_revisions(path, srcdir = nil)
  gitcmd = %W[git]
  logcmd = gitcmd + %W[log -n1 --date=iso]
  logcmd << "--grep=^ *git-svn-id: .*@[0-9][0-9]*"
  idpat = /git-svn-id: .*?@(\d+) \S+\Z/
  log = IO.pread(logcmd, :chdir => srcdir)
  commit = log[/\Acommit (\w+)/, 1]
  last = log[idpat, 1]
  if path
    cmd = logcmd
    cmd += [path] unless path == '.'
    log = IO.pread(cmd, :chdir => srcdir)
    changed = log[idpat, 1]
  else
    changed = last
  end
  modified = log[/^Date:\s+(.*)/, 1]
  branch = IO.pread(gitcmd + %W[symbolic-ref HEAD], :chdir => srcdir)[%r'\A(?:refs/heads/)?(.+)', 1]
  title = IO.pread(gitcmd + %W[log --format=%s -n1 #{commit}..HEAD], :chdir => srcdir)
  title = nil if title.empty?
  [last, changed, modified, branch, title]
end
Instance Public methods
after_export(dir)
# File tool/vcs.rb, line 352
def after_export(dir)
  FileUtils.rm_rf("#{dir}/.git")
end
branch(name)
Also aliased as: tag
# File tool/vcs.rb, line 310
def branch(name)
  Branch.new(name)
end
branch_list(pat)
# File tool/vcs.rb, line 325
def branch_list(pat)
  cmd = %W"git for-each-ref --format=\%(refname:short) refs/heads/#{pat}"
  IO.popen(cmd, :chdir => srcdir) {|f|
    f.each {|line|
      line.chomp!
      yield line
    }
  }
end
export(revision, url, dir, keep_temp = false)
# File tool/vcs.rb, line 346
def export(revision, url, dir, keep_temp = false)
  ret = system("git", "clone", "-s", (@srcdir || '.'), "-b", url, dir)
  FileUtils.rm_rf("#{dir}/.git") if ret and !keep_temp
  ret
end
grep(pat, tag, *files, &block)
# File tool/vcs.rb, line 335
def grep(pat, tag, *files, &block)
  cmd = %W[git grep -h --perl-regexp #{tag} --]
  set = block.binding.eval("proc {|match| $~ = match}")
  IO.popen([cmd, *files], :chdir => srcdir) do |f|
    f.grep(pat) do |s|
      set[$~]
      yield s
    end
  end
end
stable()
# File tool/vcs.rb, line 320
def stable
  cmd = %W"git for-each-ref --format=\%(refname:short) refs/heads/ruby_[0-9]*"
  branch(IO.pread(cmd, :chdir => srcdir)[/.*^(ruby_\d+_\d+)$/m, 1])
end
tag(name)
Alias for: branch
trunk()
# File tool/vcs.rb, line 316
def trunk
  branch("trunk")
end