|
@@ -1,3 +1,4 @@ |
|
|
|
|
|
require 'nokogiri' |
|
|
require 'open3' |
|
|
require 'open3' |
|
|
|
|
|
|
|
|
module KGrader::Backend |
|
|
module KGrader::Backend |
|
@@ -10,8 +11,8 @@ module KGrader::Backend |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def revision(repo) |
|
|
def revision(repo) |
|
|
# TODO |
|
|
|
|
|
-1 |
|
|
|
|
|
|
|
|
xml = Nokogiri::XML run('log', '--xml', '-l', '1', repo).first |
|
|
|
|
|
xml.css('logentry').attr('revision').value.to_i |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def clone(repo, semester, assignment, student) |
|
|
def clone(repo, semester, assignment, student) |
|
@@ -19,8 +20,10 @@ module KGrader::Backend |
|
|
run 'checkout', '--ignore-externals', url, repo |
|
|
run 'checkout', '--ignore-externals', url, repo |
|
|
end |
|
|
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 |
|
|
end |
|
|
|
|
|
|
|
|
private |
|
|
private |
|
|