Browse Source

SVN revision, update to rev

master
Ben Kurtovic 8 years ago
parent
commit
da5e849b5b
2 changed files with 8 additions and 5 deletions
  1. +1
    -1
      README.md
  2. +7
    -4
      lib/kgrader/backend/svn.rb

+ 1
- 1
README.md View File

@@ -15,7 +15,7 @@ version of Ruby.

Install dependencies with gem:

gem install ruby-progressbar
gem install nokogiri ruby-progressbar

Download kgrader over git:



+ 7
- 4
lib/kgrader/backend/svn.rb View File

@@ -1,3 +1,4 @@
require 'nokogiri'
require 'open3'

module KGrader::Backend
@@ -10,8 +11,8 @@ module KGrader::Backend
end

def revision(repo)
# TODO
-1
xml = Nokogiri::XML run('log', '--xml', '-l', '1', repo).first
xml.css('logentry').attr('revision').value.to_i
end

def clone(repo, semester, assignment, student)
@@ -19,8 +20,10 @@ module KGrader::Backend
run 'checkout', '--ignore-externals', url, repo
end

def update(repo)
run 'update', '--ignore-externals', '--accept', 'tf', repo
def update(repo, revision = nil)
args = 'update', '--ignore-externals', '--accept', 'tf'
args.push "-r#{revision}" unless revision.nil?
run *args, repo
end

private


Loading…
Cancel
Save