[NEW] Initial Revision
[obnox/ohloh/ohloh_scm.git] / lib / scm / adapters / svn / cat_file.rb
1 module Scm::Adapters
2         class SvnAdapter < AbstractAdapter
3                 def cat_file(commit, diff)
4                         cat(diff.path, commit.token)
5                 end
6
7                 def cat_file_parent(commit, diff)
8                         cat(diff.path, commit.token.to_i-1)
9                 end
10
11                 def cat(path=nil, revision='HEAD')
12                         run "svn cat -r #{revision} '#{SvnAdapter.uri_encode(File.join(self.root, self.branch_name.to_s, path.to_s))}@#{revision}'"
13                 end
14         end
15 end